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.EquationsCosmology 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:
objectBase 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.EventTests if H^2 is positive
Methods
__call__
-
class
primordial.equations.events.Event(equations, direction=0, terminal=False, value=0)[source]¶ Bases:
objectBase 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.EventInflation entry/exit
Methods
__call__
-
class
primordial.equations.events.ModeExit(equations, direction=0, terminal=False, value=0)[source]¶ Bases:
primordial.equations.events.EventWhen mode exits the horizon
Methods
__call__
-
class
primordial.equations.events.UntilN(equations, direction=0, terminal=False, value=0)[source]¶ Bases:
primordial.equations.events.EventStop 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.EquationsMethods
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
primordial.equations.inflation_potentials module¶
-
class
primordial.equations.inflation_potentials.ChaoticPotential(m=1)[source]¶ Bases:
primordial.equations.inflation_potentials.PotentialMethods
__call__ d dd