pynucastro.screening.screen module#
Python implementations of common electron screening routines.
- class pynucastro.screening.screen.NseState(*args, **kwargs)[source]#
Bases:
NseStateStore precomputed values that are reused in the NSE state screening calculations
- Parameters:
- class_type = jitclass.NseState#7accbddb16d0<temp:float64,dens:float64,ye:float64,gamma_e_fac:float64>#
- class pynucastro.screening.screen.PlasmaState(*args, **kwargs)[source]#
Bases:
PlasmaStateStore precomputed values that are reused for all screening correction factor calculations.
- Parameters:
- class_type = jitclass.PlasmaState#7accbdf523c0<temp:float64,dens:float64,qlam0z:float64,taufac:float64,aa:float64,zbar:float64,z2bar:float64,n_e:float64,gamma_e_fac:float64>#
- class pynucastro.screening.screen.ScreenFactors(*args, **kwargs)[source]#
Bases:
ScreenFactorsStore values that will be used to calculate the screening correction factor for a specific pair of nuclei.
- Parameters:
- class_type = jitclass.ScreenFactors#7accbddb1950<z1:int32,z2:int32,a1:int32,a2:int32,zs13:float64,zhat:float64,zhat2:float64,lzav:float64,aznut:float64,ztilde:float64>#
- pynucastro.screening.screen.chugunov_2007(state, scn_fac)[source]#
Calculate screening factors based on Chugunov et al. [2007].
Follows the approach in Yakovlev et al. [2006] to extend to a multi-component plasma.
- Parameters:
state (PlasmaState) – the precomputed plasma state factors
scn_fac (ScreenFactors) – the precomputed ion pair factors
- Returns:
Logarithm of the screening enhancement, with derivatives when the state was constructed with make_plasma_state_with_derivatives.
- Return type:
- pynucastro.screening.screen.chugunov_2009(state, scn_fac)[source]#
Calculate screening factors based on Chugunov and DeWitt [2009].
- Parameters:
state (PlasmaState) – the precomputed plasma state factors
scn_fac (ScreenFactors) – the precomputed ion pair factors
- Returns:
Logarithm of the screening enhancement, with derivatives when the state was constructed with make_plasma_state_with_derivatives.
- Return type:
- pynucastro.screening.screen.debye_huckel(state, scn_fac)[source]#
Calculate the Debye-Huckel enhancement factor for weak Coloumb coupling, following the appendix of Chugunov and DeWitt [2009].
- Parameters:
state (PlasmaState) – the precomputed plasma state factors
scn_fac (ScreenFactors) – the precomputed ion pair factors
- Returns:
Logarithm of the screening enhancement, with derivatives when the state was constructed with make_plasma_state_with_derivatives.
- Return type:
- pynucastro.screening.screen.f0(gamma)[source]#
Calculate the free energy per ion in a OCP from Chugunov and DeWitt [2009] eq. 24
- pynucastro.screening.screen.get_screening_func(screen_method)[source]#
Return the screening function by its name
- Parameters:
screen_method (str) – name of the screening function
- Return type:
Callable
- pynucastro.screening.screen.make_plasma_state(temp, dens, composition, *, compute_derivatives=False)[source]#
Construct a PlasmaState object from simulation data.
- Parameters:
temp (float) – temperature in K
dens (float) – density in g/cm^3
composition (Composition or dict(Nucleus)) – a Composition object or a dictionary of molar abundances for each ion, as returned by
Composition.get_molar()compute_derivatives (bool) – Seed derivatives with respect to Ye = sum(Z Y) and S2 = sum(Z**2 Y). The default is False.
- Returns:
With compute_derivatives=True, a named tuple whose composition-dependent fields carry two derivatives.
- Return type:
PlasmaState or tuple
- pynucastro.screening.screen.make_plasma_state_with_derivatives(temp, dens, Ys, Zs)[source]#
Construct a state carrying two composition derivatives.
- Parameters:
temp (float) – Temperature in K, held fixed during differentiation.
dens (float) – Density in g/cm^3, held fixed during differentiation.
Ys (numpy.ndarray) – Molar abundances, Y_i = X_i / A_i.
Zs (numpy.ndarray) – Nuclear charges in the same order as Ys.
- Returns:
Named tuple with the same attributes as PlasmaState. Composition-dependent fields are Dual values with DerivativePair seeds: d1 corresponds to Ye = sum(Z_i Y_i), and d2 to S2 = sum(Z_i**2 Y_i).
- Return type:
Notes
The total molar abundance is held fixed when seeding these moments. It cancels out of the screening expressions. For a returned log screening factor h, dh/dY_i = Z_i * h.deriv.d1 + Z_i**2 * h.deriv.d2, without renormalizing the abundances. Reuse this state for different ion pairs.
- pynucastro.screening.screen.make_screen_factors(n1, n2)[source]#
Construct a ScreenFactors object from a pair of nuclei.
- Parameters:
- Return type:
- pynucastro.screening.screen.potekhin_1998(state, scn_fac)[source]#
Calculate screening factors based on Chabrier and Potekhin [1998].
- Parameters:
state (PlasmaState) – the precomputed plasma state factors
scn_fac (ScreenFactors) – the precomputed ion pair factors
- Returns:
Logarithm of the screening enhancement, with derivatives when the state was constructed with make_plasma_state_with_derivatives.
- Return type:
- pynucastro.screening.screen.screen5(state, scn_fac)[source]#
Calculate screening factors following the appendix of Wallace et al. [1982].
Based on Graboske et al. [1973] for weak screening. Based on Alastuey and Jancovici [1978] with plasma parameters from Itoh et al. [1979], for strong screening.
- Parameters:
state (PlasmaState) – the precomputed plasma state factors
scn_fac (ScreenFactors) – the precomputed ion pair factors
- Returns:
Logarithm of the screening enhancement, with derivatives when the state was constructed with make_plasma_state_with_derivatives.
- Return type:
- pynucastro.screening.screen.screening_check(check_func=CPUDispatcher(<function debye_huckel>), threshold=0.01)[source]#
Create a decorator factory that wraps a screening function with a check that determines whether that function can be skipped for a given plasma state and screening pair.
- Parameters:
func – the function to check against the threshold
threshold – the threshold to check against. If screen_check is less than the threshold, skip screen_func
- Returns:
a decorator for wrapping screening functions