grrproc package

A package of python routines to follow r-process nucleosynthesis with graph theory.

A module for the graphical r process.

class grrproc.grp.GrRproc(net)[source]

Bases: object

A class for handling graph-based r-process calculations.

Args:

net: A wnnet network object.

compute_dyndt(y_current, y_n)[source]

Method to compute the rate of change of the free neutron abundance in the network.

Args:

y_current (numpy.array): A two-dimensional array giving the abundances to be used as the current abundances for each Z and N.

y_n (float): The abundance of neutrons per nucleon.

Returns:

float: The rate of change of the free neutron abundance.

compute_f_l(z_c, y_n, d_t)[source]

Method to compute the F_L’s.

Args:

z_c (int): The atomic number at which to compute F_L.

y_n (float): The abundance of neutrons per nucleon.

d_t (float): The time step (in seconds).

Returns:

numpy.array: A one-dimensional array containing the F_L’s for the given Z.

compute_f_u(z_c, y_n, d_t)[source]

Method to compute the F_U’s.

Args:

z_c (int): The atomic number at which to compute F_L.

y_n (float): The abundance of neutrons per nucleon.

d_t (float): The time step (in seconds).

Returns:

numpy.array: A one-dimensional array containing the F_L’s for the given Z.

compute_g_down(z_c, y_n, d_t, z_lower=None)[source]

Method to compute matrices \(G(Z, t + \Delta t; Z', t)\) for \(Z'\) less than or equal to fixed \(Z\).

Args:

z_c (int): The fixed atomic number \(Z\).

y_n (float): The abundance of neutrons per nucleon.

d_t (float): The time step (in seconds).

z_lower (int, optional): The lower atomic number \(Z' \leq Z\) to which to compute the \(G\) matrices.

Results:

dict: A dictionary of \(G(Z, t + \Delta t; Z', t)\) matrices for given \(Z\). The key for each entry is \(Z'\).

compute_g_up(z_c, y_n, d_t, z_upper=None)[source]

Method to compute matrices \(G(Z, t + \Delta t; Z', t)\) for \(Z\) greater than or equal to fixed \(Z'\).

Args:

z_c (int): The fixed atomic number \(Z'\).

y_n (float): The abundance of neutrons per nucleon.

d_t (float): The time step (in seconds).

z_upper (int, optional): The upper atomic number \(Z \geq Z'\) to which to compute the \(G\) matrices.

Results:

dict: A dictionary of \(G(Z, t + \Delta t; Z', t)\) matrices for given \(Z'\). The key for each entry is \(Z\).

compute_r(z_c, y_0, y_n, d_t)[source]

Method to compute the R_L’s and R_U’s.

Args:

z_c (int): The atomic number at which to compute F_L.

y_0 (numpy.array): A two-dimensional array giving the abundances to be used as input for each Z and N.

y_n (float): The abundance of neutrons per nucleon.

d_t (float): The time step (in seconds).

Returns:

tuple: The first element of the tuple is a one-dimensional numpy.array array containing the R_L’s for the given Z. The second element is a numpy.array array containing the R_U’s for the given Z.

compute_y(y_t, y_n, d_t, method='graph')[source]

Method to compute the Y’s.

Args:

y_t (numpy.array): A two-dimensional array giving the abundances to be used as input for each Z and N.

y_n (float): The abundance of neutrons per nucleon.

d_t (float): The time step (in seconds).

method (string, optional): Keyword to select between solving the isotopic abundances from recursive graph relations (graph–the default) or from standard matrix operations (matrix).

Returns:

numpy.array: A two-dimensional array containing the Y’s for each Z and N.

compute_y_l(z_c, y_0, y_n, d_t)[source]

Method to compute the Y_L’s.

Args:

z_c (int): The atomic number at which to compute F_L.

y_0 (numpy.array): A two-dimensional array giving the abundances to be used as input for each Z and N.

y_n (float): The abundance of neutrons per nucleon.

d_t (float): The time step (in seconds).

Returns:

tuple: The first element of the tuple is a one-dimensional numpy.array array containing the Y_L’s for the given Z. The second element is the F_L for the input Z that was used to compute the Y_L’s.

compute_y_u(z_c, y_0, y_n, d_t)[source]

Method to compute the Y_U’s.

Args:

z_c (int): The atomic number at which to compute F_L.

y_0 (numpy.array): A two-dimensional array giving the abundances to be used as input for each Z and N.

y_n (float): The abundance of neutrons per nucleon.

d_t (float): The time step (in seconds).

Returns:

tuple: The first element of the tuple is a one-dimensional numpy.array array containing the Y_U’s for the given Z. The second element is the F_U for the input Z that was used to compute the F_U’s.

get_n_lims(z_c)[source]

Method to return the smallest and largest neutron number in an isotopic chain in the network.

Args:

z_c (int): The atomic number giving the isotopic chain.

Returns:

tuple: A tuple whose first element is the smallest neutron number in the isotopic chain and whose second element is the largest neutron number in the isotopic chain.

get_net()[source]

Method to return the network.

Returns:

A wnnet network object.

get_rates()[source]

Method to return the current rates.

Returns:

dict: A dictionary of current rates for valid reactions. The dictionary keys are the types of reactions. Entries with keys n_cap (neutron-captures), gamma (photodisintegrations), and beta total (total beta-decays) are two-dimensional numpy.array, each with the given rate type indexed by Z and N. Entries with key beta are three-dimensional numpy.array, each with the given beta-decay rate indexed by Z, N, and j, where j is the number of beta-delayed neutrons emitted in the decay. The total beta-decay rate for species (Z, N) is the sum over the beta-decay rates with the different values of j.

get_z_lims()[source]

Method to return the smallest and largest atomic numbers in the network.

Returns:

tuple: A tuple of two int objects. The first element is the smallest atomic number present in the network (greater than one) and the second element is the largest atomic number.

update_rates(t_9, rho)[source]

Method to update the network reactions.

Args:

t_9 (float): The temperature in billions of K.

rho (float): The mass density in g/cc.

Returns:

On successful return, the network rates have been updated.