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
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
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 callable event to be passed to scipy.integrate.solve_ivp
Parameters: - equations: Equations
The equations for computing derived variables.
- direction: int [-1, 0, +1], optional, default 0
The direction of the root finding (if any)
- terminal: bool, optional, default False
Whether to stop at this root
- value: float, optional, default 0
Offset to root
Methods
__call__
(t, y)Vector of derivatives
-
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 aH
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¶
-
class
primordial.equations.inflation.
Equations
(K, potential)[source]¶ Bases:
primordial.equations.equations.Equations
Base class for inflation equations
Methods
H
(t, y)Hubble parameter H2
(t, y)Hubble parameter squared V
(t, y)Potential __call__
(t, y)Vector of derivatives add_variable
(*args)Add dependent variables to the equations d2Vdphi2
(t, y)Potential second derivative dVdphi
(t, y)Potential derivative set_independent_variable
(name)Set name of the independent variable sol
(sol, **kwargs)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
Simple potential
Methods
__call__ d dd