pynucastro.reduction.drgep module#
- pynucastro.reduction.drgep.calc_interaction_matrix(net, rvals)[source]#
Calculate direct interaction coefficients.
- pynucastro.reduction.drgep.calc_interaction_matrix_numpy(net, rvals_arr)[source]#
Calculate direct interaction coefficients using NumPy.
- pynucastro.reduction.drgep.drgep(net, conds, targets, tols, returnobj='net', use_mpi=False, use_numpy=False)[source]#
Implementation of Directed Relation Graph with Error Propagation (DRGEP) reduction method described in Pepiot-Desjardins and Pitsch [2008] and Niemeyer and Sung [2011].
- Parameters:
net – The network (RateCollection) to reduce.
conds – A set of conditions to reduce over. Should either be a sequence of (composition, density, temperature) sequences/tuples if running in standard mode, or a sequence of 3 sequences ((composition, density, temperature) ordering) if running in NumPy mode. In the latter case, the sequences will be permuted to create the dataset. The compositions should be pynucastro Composition objects.
targets – A collection of target nuclei (or a single target nucleus) to run the graph search algorithm from. Should be supplied as pynucastro Nucleus objects or strings.
tols – Tolerance(s) or cutoff threshold(s) to use for paths from each of the target nuclei. Nuclei whose interaction coefficients do not meet the specified tolerance will have their interaction coefficients set to 0.0. Can be a single number (will be the same for all targets) or a separate value for each target nucleus.
returnobj – The type of object to return. Options are ‘net’ (a reduced network, the default setting), ‘nuclei’ (unique nuclei with nonzero interaction coefficients, ordered so the interaction coefficients are descending), and ‘coeff’ (the interaction coefficients as a NumPy array, with entries corresponding to nuclei in net.unique_nuclei).
use_mpi – Whether to divide up the set of conditions across MPI processes or not. Default setting is False.
use_numpy – Whether to use NumPy to vectorize the interaction coefficient calculations or not. This is more memory intensive and may actually hinder performance for some setups. Conditions should be supplied as 3 lists that will be permuted to form the dataset (see conds parameter). Default setting is False.