primordial.equations package

Submodules

primordial.equations.cosmology module

class primordial.equations.cosmology.Equations(H0, Omega_r, Omega_m, Omega_k, Omega_l)[source]

Bases: primordial.equations.equations.Equations

Cosmology equations

Solves background variables in cosmic time for curved and flat universes using the Friedmann equation.

Independent variable:
N: efolds
Variables:
t: cosmic time

Methods

H(t, y) Hubble parameter
H2(t, y) The square of the Hubble parameter, computed using the Friedmann equation
__call__(t, y) Vector of derivatives
add_variable(*args) Add dependent variables to the equations
set_independent_variable(name) Set name of the independent variable
sol(sol, **kwargs) Post-process solution of solve_ivp
H(t, y)[source]

Hubble parameter

H2(t, y)[source]

The square of the Hubble parameter, computed using the Friedmann equation

sol(sol, **kwargs)[source]

Post-process solution of solve_ivp

primordial.equations.equations module

class primordial.equations.equations.Equations[source]

Bases: object

Base class for equations.

Allows one to compute derivatives and derived variables. Most of the other classes take ‘equations’ as an object.

Attributes:
i : dict

dictionary mapping variable names to indices in the solution vector

independent_variable : string

name of independent variable

Methods

__call__(t, y) Vector of derivatives
add_variable(*args) Add dependent variables to the equations
set_independent_variable(name) Set name of the independent variable
sol(sol, **kwargs) Amend solution from from solve_ivp
add_variable(*args)[source]

Add dependent variables to the equations

  • creates an index for the location of variable in y
  • creates a class method of the same name with signature name(self, t, y) that should be used to extract the variable value in an index-independent manner.
Parameters:
*args : str

Name of the dependent variables

set_independent_variable(name)[source]

Set name of the independent variable

Parameters:
name : str

Name of the independent variable

sol(sol, **kwargs)[source]

Amend solution from from solve_ivp

primordial.equations.events module

class primordial.equations.events.Collapse(equations, direction=0, terminal=False, value=0)[source]

Bases: primordial.equations.events.Event

Tests if H^2 is positive

Methods

__call__  
class primordial.equations.events.Event(equations, direction=0, terminal=False, value=0)[source]

Bases: object

Base class for events.

Gives a more usable wrapper to

Derived classes must define:

__call__(self, t, y)
Scalar root function for determining event
equations: Equations
The equations for computing derived variables.
direction: [-1, 0, +1]
The direction of the root finding (if any)
terminal: bool
Whether to stop at this root
class primordial.equations.events.Inflation(equations, direction=0, terminal=False, value=0)[source]

Bases: primordial.equations.events.Event

Inflation entry/exit

Methods

__call__  
class primordial.equations.events.ModeExit(equations, direction=0, terminal=False, value=0)[source]

Bases: primordial.equations.events.Event

When mode exits the horizon

Methods

__call__  
class primordial.equations.events.UntilN(equations, direction=0, terminal=False, value=0)[source]

Bases: primordial.equations.events.Event

Stop at N

Methods

__call__  

primordial.equations.inflation module

Base classes for inflationary solvers

class primordial.equations.inflation.Equations(K, potential)[source]

Bases: primordial.equations.equations.Equations

Methods

H(t, y) Hubble parameter
V(t, y) Potential
__call__(t, y) Vector of derivatives
add_variable(*args) Add dependent variables to the equations
dVdphi(t, y) Potential derivative
set_independent_variable(name) Set name of the independent variable
sol(sol, **kwargs) Post-process solution of solve_ivp
H(t, y)[source]

Hubble parameter

V(t, y)[source]

Potential

dVdphi(t, y)[source]

Potential derivative

sol(sol, **kwargs)[source]

Post-process solution of solve_ivp

primordial.equations.inflation_potentials module

class primordial.equations.inflation_potentials.ChaoticPotential(m=1)[source]

Bases: primordial.equations.inflation_potentials.Potential

Methods

__call__  
d  
dd  
d(phi)[source]
dd(phi)[source]
class primordial.equations.inflation_potentials.Potential[source]

Bases: object

Module contents