pynucastro package#
pynucastro is a python module that interprets the nuclear reaction rates, including those cataloged by the JINA ReacLib project:
It provides both interactive access to the rates, for use in Jupyter notebooks as well as methods for writing python and C++ nuclear reaction networks, including the the righthand side and Jacobian routines.
Several different packages provide the data structures needed to interpret rates and build networks.
library#
library stores Reaclib rate files in Reaclib 1 or 2 formats as well as the directory library/tabular containing tabulated rates. pynucastro will search these directories for rate files as well as the current working directory.
Adding Reaclib rate files simply requires downloading them from the JINA ReacLib project and placing them in the library folder. They must be in the Reaclib 1 format.
nucdata#
nucdata provides:
Nucleus : a single nucleus, with a descriptive name and its properties.
nucdata provides tables of binding energy per nucleon in MeV, partition function and the number of spin states for nuclides specified by their number of neutrons N and atomic number Z.
The data for these tables is derived from the Atomic Mass Evaluations 2012, 2016 and 2020. By default, pynucastro uses Atomic Mass Evaluation 2016, and Nucleus Spin Evaluation 2020. Scripts for reading the Atomic Mass Evaluation tables and generating binding energy tables for pynucastro are provided in pynucastro/nucdata/AtomicMassEvaluation.
networks#
networks provides classes and functions for organizing collection of rates, including:
Composition : this is a container of Nucleus objects along with associated mass fractions. This is used for evaluating rates when doing interactive exploration with pynucastro.
RateCollection : this is simply a collection of rates. It will determine all of the links between the rates and allow you to visualize the dependencies.
Explorer : an explorer takes a rate composition and composition and produces an interactive visualization that can be explored in Jupyter notebooks.
NSENetwork : this extends the RateCollection to allow for solving for the nuclear statistical equilibrium state of a collection of nuclei.
NumpyNetwork : this extends the RateCollection to allow evaluating reaction rates using vectorized NumPy arrays, which may be more efficient for some applications.
PythonNetwork : this extends the RateCollection to enable output of python code that can be used with ODE integrators to solve a network.
BaseCxxNetwork : this extends the RateCollection to enable output of C++ code.
AmrexAstroCxxNetwork : this extends the RateCollection to enable output of C++ code that can be used to add a network to the hydrodynamics codes Castro and MAESTROeX via the AMReX-Astro Microphysics repository.
SimpleCxxNetwork : this extends the RateCollection to enable output of basic C++ code that can be as the starting point for incorporating a pynucastro network into a non-AMReX simulation code.
FortranNetwork : this is a set of wrappers around SimpleCxxNetwork that provide a Fortran interface.
rates#
rates provides classes and functions for interpreting individual reaction rates, including:
Rate : a single Reaclib rate, with methods for plotting and evaluating it.
RatePair : a pair of rates representing the corresponding forward and reverse rates
Tfactors : this is a simple container class that holds the various temperature powers needed to evaluate a rate.
RateLibrary: a container class for Reaclib rates that provides a high level interface for reading Reaclib-formatted files containing one or more rates.
RateFilter: a class implementing search constraints to look up a desired rate or group of rates from a RateLibrary.
screening#
screening provides python screening routines for the rates.
templates#
templates contains subdirectories for generating AmrexAstroCxxNetwork C++ files implementing the ODE right hand side, jacobian, and integration driver routines. pynucastro processes these template files by replacing tags of the form <tag> with generated code specific to a given choice of reaction rates.
Subpackages#
- pynucastro.networks package
- Submodules
- pynucastro.networks.amrexastro_cxx_network module
- pynucastro.networks.base_cxx_network module
- pynucastro.networks.fortran_network module
- pynucastro.networks.nse_network module
- pynucastro.networks.numpy_network module
NumpyNetwork
NumpyNetwork.coef_arr
NumpyNetwork.coef_mask
NumpyNetwork.nuc_prod_count
NumpyNetwork.nuc_cons_count
NumpyNetwork.nuc_used
NumpyNetwork.yfac
NumpyNetwork.prefac
NumpyNetwork.clear_arrays()
NumpyNetwork.evaluate_activity_arr()
NumpyNetwork.evaluate_rates_arr()
NumpyNetwork.evaluate_ydots_arr()
NumpyNetwork.update_prefac_arr()
NumpyNetwork.update_yfac_arr()
- pynucastro.networks.python_network module
- pynucastro.networks.rate_collection module
Composition
Composition.A
Composition.X
Composition.Z
Composition.abar
Composition.bin_as()
Composition.get_molar()
Composition.get_nuclei()
Composition.get_sum_X()
Composition.normalize()
Composition.plot()
Composition.set_all()
Composition.set_array()
Composition.set_equal()
Composition.set_nuc()
Composition.set_random()
Composition.set_solar_like()
Composition.ye
Composition.zbar
Explorer
RateCollection
RateCollection.add_rates()
RateCollection.dedupe_partition_function_temperatures()
RateCollection.evaluate_activity()
RateCollection.evaluate_energy_generation()
RateCollection.evaluate_jacobian()
RateCollection.evaluate_rates()
RateCollection.evaluate_screening()
RateCollection.evaluate_ydots()
RateCollection.find_duplicate_links()
RateCollection.find_reverse()
RateCollection.find_unimportant_rates()
RateCollection.get_forward_rates()
RateCollection.get_nuclei()
RateCollection.get_nuclei_latex_string()
RateCollection.get_nuclei_needing_partition_functions()
RateCollection.get_rate()
RateCollection.get_rate_by_name()
RateCollection.get_rate_by_nuclei()
RateCollection.get_rate_pairs()
RateCollection.get_rates()
RateCollection.get_rates_latex_table_string()
RateCollection.get_reverse_rates()
RateCollection.gridplot()
RateCollection.linking_nuclei()
RateCollection.make_ap_pg_approx()
RateCollection.network_overview()
RateCollection.plot()
RateCollection.plot_jacobian()
RateCollection.plot_network_chart()
RateCollection.pynucastro_dir
RateCollection.rate_pair_overview()
RateCollection.remove_nuclei()
RateCollection.remove_rates()
RateCollection.validate()
RateCollection.write_network()
RateDuplicationError
- pynucastro.networks.simple_cxx_network module
- pynucastro.networks.sympy_network_support module
- pynucastro.nucdata package
- Submodules
- pynucastro.nucdata.elements module
- pynucastro.nucdata.halflife_table module
- pynucastro.nucdata.mass_table module
- pynucastro.nucdata.nucleus module
- pynucastro.nucdata.partition_function module
- pynucastro.nucdata.spin_table module
- pynucastro.rates package
load_rate()
- Submodules
- pynucastro.rates.alternate_rates module
- pynucastro.rates.approximate_rates module
- pynucastro.rates.derived_rate module
- pynucastro.rates.files module
- pynucastro.rates.known_duplicates module
- pynucastro.rates.library module
LangankeLibrary
Library
Library.add_rate()
Library.add_rates()
Library.backward()
Library.derived_backward()
Library.derived_forward()
Library.filter()
Library.find_duplicate_links()
Library.forward()
Library.get_nuclei()
Library.get_rate()
Library.get_rate_by_name()
Library.get_rate_by_nuclei()
Library.get_rates()
Library.heaviest()
Library.lightest()
Library.linking_nuclei()
Library.num_rates
Library.remove_rate()
Library.write_to_file()
RateFilter
ReacLibLibrary
SuzukiLibrary
TabularLibrary
capitalize_rid()
list_known_rates()
- pynucastro.rates.rate module
- pynucastro.rates.reaclib_rate module
- pynucastro.rates.tabular_rate module
- pynucastro.reduction package
- pynucastro.screening package