pynucastro.rates.derived_rate module#

class pynucastro.rates.derived_rate.DerivedRate(rate, compute_Q=False, use_pf=False)[source]#

Bases: ReacLibRate

A reverse rate computed from a forward rate via detailed balance.

Parameters:
  • rate (Rate) – The forward rate that will be used to derive the reverse

  • compute_Q (bool) – Do we recompute the Q-value of the rate from the masses?

  • use_pf (bool) – Do we apply the partition function?

counter_factors()[source]#

Compute the multiplicity factor, nucr! = nucr_1! * … * nucr_r!, for each repeated nucr reactant and nucp! = nucp_1! * … * nucp_p! for each nucp product in a ordered pair (nucr!, nucp!). The factors nucr! and nucp! avoid overcounting when more than one nuclei is involve in the reaction. If there is no multiplicity, then the factor is 1.0.

Return type:

tuple(float, float)

eval(T, *, rho=None, comp=None)[source]#

Evaluate the derived reverse rate.

Parameters:
  • T (float) – the temperature to evaluate the rate at

  • rho (float) – the density to evaluate the rate at

  • comp (Composition) – the composition to evaluate the rate with

Return type:

float

function_string_cxx(dtype='double', specifiers='inline', leave_open=False, extra_args=None)[source]#

Return a string containing the C++ function that computes the derived reverse rate

Parameters:
  • dtype (str) – The C++ datatype to use for all declarations

  • specifiers (str) – C++ specifiers to add before each function declaration (i.e. “inline”)

  • leave_open (bool) – If true, then we leave the function unclosed (no “}” at the end). This can allow additional functions to add to this output.

  • extra_args (list(str)) – A list of strings representing additional arguments that should be appended to the argument list when defining the function interface.

Return type:

str

function_string_py()[source]#

Return a string containing python function that computes the rate.