0% found this document useful (0 votes)
10 views

Pynucastro Code

pynucastro: A Python Library for Nuclear Astrophysics

Uploaded by

sara
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

Pynucastro Code

pynucastro: A Python Library for Nuclear Astrophysics

Uploaded by

sara
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 24

The Astrophysical Journal, 947:65 (24pp), 2023 April 20 https://doi.org/10.

3847/1538-4357/acbaff
© 2023. The Author(s). Published by the American Astronomical Society.

pynucastro: A Python Library for Nuclear Astrophysics


Alexander I. Smith1 , Eric T. Johnson1 , Zhi Chen1 , Kiran Eiden2 , Donald E. Willcox3 , Brendan Boyd1 , Lyra Cao4 ,
Christopher J. DeGrendele5 , and Michael Zingale1
1
Department of Physics and Astronomy, Stony Brook University, Stony Brook, NY 11794-3800, USA; [email protected]
2
Department of Astronomy, University of California, Berkeley, Berkeley, CA 94720-3411, USA
3
Center for Computational Sciences and Engineering, Lawrence Berkeley National Lab, USA
4
Department of Astronomy, Ohio State University, Columbus, OH 43210-1173, USA
5
Department of Applied Mathematics, University of California, Santa Cruz, Santa Cruz, CA 95064-1077, USA
Received 2022 October 18; revised 2023 February 3; accepted 2023 February 8; published 2023 April 21

Abstract
We describe pynucastro 2.0, an open-source library for interactively creating and exploring astrophysical
nuclear reaction networks. We demonstrate new methods for approximating rates and use detailed balance to create
reverse rates, show how to build networks and determine whether they are appropriate for a particular science
application, and discuss the changes made to the library over the past few years. Finally, we demonstrate the
validity of the networks produced and share how we use pynucastro networks in simulation codes.
Unified Astronomy Thesaurus concepts: Nuclear astrophysics (1129); Nucleosynthesis (1131); Nuclear fusion
(2324); Astrophysical processes (104); Reaction rates (2081); Astronomy software (1855); Computational
astronomy (293)

1. Introduction Finally, pynucastro can generate the reaction networks needed for
the AMReX-Astrophysics suite of simulation codes (Zingale et al.
We present pynucastro 2.0, the latest version of our open-
2018) and leverage their ability to offload onto GPUs for
source Python library for nuclear astrophysics.6 pynucastro accelerated computing. In this paper, we describe these new
began as a simple Python library that could interpret the features, show examples of how we use the library, and
reaction rate format used by REACLIB (Cyburt et al. 2010) demonstrate its validity.
and output the Python code to integrate a network linked by The general evolution of a species involved in a two-body
reaction rates from that library. The initial intent was for reaction rate, A + B → C + D, takes the form
use in a classroom, to make it easier for students to work with,
and interactively explore reaction networks. It quickly grew dnA dn ásvñ
= B = - (1 + dAB) nA nB , (1 )
beyond that role, as we recognized the need to explore reaction dt dt 1 + dAB
rates, determine which reactions are important in different
environments, and generate networks for multidimensional where nA and nB are the number densities of species A and B,
hydrodynamics simulation codes. Nuclear experiments are respectively, and 〈σv〉 is the reaction rate, expressed as an
constantly refining our understanding of nuclei and reactions average of the product of the cross section, σ, and the relative
(Schatz et al. 2022), and we want to be able to use the most up- velocity, v (assumed to follow a Maxwellian distribution), and
to-date reaction rates in our simulations without having to the denominator corrects for double-counting if particles A and
manually update the simulation codes. pynucastro meets this B are identical (see, e.g., Clayton 1968; Arnett 1996). The
need by interfacing with compilations of nuclear reaction rates minus sign here signifies that species A and B are destroyed in
and nuclear properties generating the Python or C++ code
this reaction, and the factor of (1 + δAB) in the numerator
needed to integrate a reaction network in a simulation code.
pynucastro’s object-oriented design makes it easy to expand indicates that if A and B are the same, then two of the nuclei are
its capabilities by building on existing rate or network classes. destroyed in the reaction. A corresponding equation for
The development process is fully opened, managed on Github products C and D will have a plus sign:
through pull requests and issues. dnC dn ásvñ
Since the the 1.0 release of pynucastro (Willcox & = D = + nA nB . (2 )
Zingale 2018), a lot of new features were added, including C+ dt dt 1 + dAB
+ code generation, the ability to modify and approximate rates, In terms of molar fraction, Yi ≡ nimu/ρ, we have, for example,
nuclear partition functions and the derivation of reverse rates via for species A
detailed balance, support for weak rate tables, nuclear statistical
dYA NA ásvñ
equilibrium state determination, electron screening support, many = - (1 + dAB) rYA YB , (3 )
new plot types, and Numba acceleration of Python networks. dt 1 + dAB

6
where NA is Avogadro’s number. The form NA〈σv〉 is the
https://github.com/pynucastro/pynucastro/ quantity that reaction rate tabulations usually provide (as a fit or
a table in terms of temperature, T), for example, as in the classic
Original content from this work may be used under the terms
compilation (Caughlan & Fowler 1988). There are other
of the Creative Commons Attribution 4.0 licence. Any further
distribution of this work must maintain attribution to the author(s) and the title variations to this, including for three-body reactions and
of the work, journal citation and DOI. decays, but the general idea is the same—the change in species

1
The Astrophysical Journal, 947:65 (24pp), 2023 April 20 Smith et al.

molar fraction is given by an ordinary differential equation This paper is organized as follows. In Section 2 we describe
(ODE) that depends on the molar fraction of reactants, the the overall design of the library. In Section 3 we walk
reaction rate, and density. Reaction networks usually work in through the process of creating a reaction network and
terms of molar fractions, since it is easy to match the integrating it. We describe the ability to approximate rates in
coefficients in the ODEs to the stoichiometric values from Section 4, discuss tabular rates in Section 5, and show how to
the reaction balance (see Hix & Meyer 2006 for a review of compute inverse rates via detailed balance in Section 6. In
reaction rates). Sections 7 and 8 we describe screening and establishing
A reaction network is the collection of nuclei and the rates that nuclear statistical equilibrium, respectively. Finally, in
link them together, and it is expressed as a system of ODEs, Section 9 we compare a Python and a C++ generated
{dYk/dt}. Each term on the right-hand side of the ODE network. A set of Jupyter notebooks is provided as supple-
represents a link between the kth nucleus (with mass fraction Yk) mentary material archived on Zenodo7 that reproduces allthe
and another nucleus in the network. Astrophysical simulations figures shown in the paper. We will refer to individual
use networks ranging from a few nuclei to several thousand, and notebooks in the figure captions.
managing and integrating the reaction network can be
computationally challenging (see, e.g., Timmes 1999). Nuclear
timescales can be short, and often the reaction network is 2. Library Structure
integrated using implicit methods, requiring a Jacobian to solve pynucastro uses an extensible, object-oriented design and is
the linearized system representing a single step. A network can written completely in Python. It leverages Numba just-in-time
evolve the species alone, at fixed temperature and density; compilation for acceleration of performance-critical parts,
include a temperature/internal energy equation under the SymPy for C++ code generation, SciPy for integrating Python
assumption of constant density or pressure (a self-heating networks, and NetworkX and matplotlib for plotting. We use
network, as in, e.g., Chamulak et al. 2008); evolve according to a pytest for unit testing and have extensive documentation
prescribed thermodynamic trajectory (as is often done with tracer prepared with Sphinx and Jupyter notebooks. pynucastro is
particles; e.g., Seitenzahl et al. 2010); be used in an operator split available on PyPI and can easily be installed via pip.
fashion with a hydrodynamics code, with or without an energy The library is built from a few core classes that represent
equation integrated together with the species (e.g., Müller 1986); nuclei, rates, and other concepts. A user works directly with
or be fully coupled to the hydrodynamics equations and include objects of these classes to build a network and explore it. The
the velocity-dependent advective terms in addition to energy core classes in pynucastro are as follows:
evolution (as, e.g., done in Zingale et al. 2022).
pynucastro is designed to aid in the creation and manage- 1. Nucleus: a Nucleus represents a single nuclear
ment of reaction networks. It knows how to compute the isotope and stores the nuclear properties, including
reaction rates, NA〈σv〉, and assemble the terms in Equation (3) proton number, atomic weight, and binding energy. It
that describe a reaction’s contribution to the evolution of a also holds SpinNuclide and PartitionFunction
nucleus. The goal is to produce a network that can be used in a objects that can express the nuclear spin and partition
simulation with just a few lines of Python, with the library function, respectively. Finally, a Nucleus knows how
pulling in the up-to-date reaction rates, finding all of the links, to print the nucleus to a screen / Jupyter notebook in both
and writing out the code that represents the right-hand side of plain text and MathJax formatting.
the system of ODEs. Additionally, since we usually want to use 2. Composition: a Composition object stores the
a minimally sized network for multidimensional simulations, mass fractions of a collection of nuclei, with methods that
pynucastro understands rate approximations and has methods enable us to initialize them in various fashions (e.g.,
for determining whether specific rates are important for a solar) and convert them to molar fractions. A Composi-
particular application. tion object is needed when evaluating a reaction rate in
There are already a number of freely available nuclear reaction Python.
networks, including the set of approximate (aprox13 and 3. Rate: a Rate is a base class that implements functions
aprox19) and general (torch) networks (Timmes 1999), common to all rate types. Two main classes are derived
BRUSLIB/NETGEN (Aikawa et al. 2005; Xu et al. 2013), and from this: ReacLibRate for rates from the REACLIB
SkyNet (Lippuner & Roberts 2017). pynucastro has different library and TabularRate for rates that are
goals than these, and as such, it provides complementary benefits specified as a table of (ρYe, T). These classes can evaluate
to the community. pynucastro encourages interactive exploration the rate in Python and output the source code needed to
of rates and networks in Jupyter notebooks and is designed to construct the rate in both C++ and Python.
output fixed-sized reaction networks (potentially with approximate Several other classes described below are constructed
rates) that can be used in simulation codes. Being written from these, including ApproximateRate, which
completely in Python, it has a low barrier of entry for new groups rates together into a single effective rate
contributions and encourages the addition of new features through approximation, and DerivedRate, which recomputes
an open development model. By writing out the code explicitly for an inverse rate from a forward rate using detailed balance.
a particular network, and not for a general net that can be 4. Library: a Library is a collection of Rate objects,
configured at runtime, we are able to produce networks that can which can be from a particular source (e.g., the
run efficiently on GPUs as part of large simulation codes (Katz REACLIB database can be read in as a Library). A
et al. 2020). Additionally, when coupling to hydrodynamics, we Library provides many methods for filtering the rates,
need to integrate the network with an energy equation and possibly allowing one to select based on the nuclei involved.
advective terms, which requires more flexibility in how the
7
integration is done than other libraries permit. https://doi.org/10.5281/zenodo.7202413

2
The Astrophysical Journal, 947:65 (24pp), 2023 April 20 Smith et al.

A reaction network is built by selecting one or more rich nuclei, where systematic measurements dominate. The
rates from a Library. partition function values are tabulated in Rauscher (2003) and
5. RateCollection: a RateCollection is the base Rauscher et al. (1997) and merged in the case where each
class for representing a network—a set of Nucleus nucleus is present in both tables. We linearly interpolate the
objects and the list of Rate objects that link them logarithm of the partition function from the table data.
together. A RateCollection has a number of
methods that help manage a network. For example, it is 2.2. Development Model
at the RateCollection level that one can approx-
imate the network or recompute reverse rates via detailed pynucastro is openly developed on github, with all the
balance. RateCollection also has many ways to changes done via issues and pull requests. Issues includes new
visualize a network, including interactively with Jupyter feature requests, bug reports, and questions. Pull requests
notebook widgets. The PythonNetwork and Amrex- require a review from a developer, along with all tests and
AstroCxxNetwork classes build off of RateCol- workflows passing before they can be merged. Currently, there are
lection to produce the source code for a Python or C+ over 400 issues + pull requests filed. Developers who have
+ network in the AMReX-Astrophysics suite framework. contributed regularly in the past are granted permission to approve
and merge pull requests. Contributors who have made significant
contributions were invited to be coauthors of this paper and also
2.1. Data Sources appear in the Zenodo record created for each new library
pynucastro uses the REACLIB rate library (Cyburt release. Code checkers (pylint and flake8) are run on every pull
et al. 2010) for most rates. REACLIB aims to be a single source request, as well as a suite of unit tests (managed through pytest); a
for thermonuclear reaction rates, aggregating different community test compilation and run of a C++ network with the AMReX-
contributions into a single, uniform format. This provides fits to the Astro Microphysics framework, comparing to a previously stored
NA〈σv〉 portion of the rate in terms of a standard function of answer; and a build of the docs to ensure that changes do not break
temperature. REACLIB does not provide rates for density- existing notebook examples. This is all managed via github
dependent electron capture reactions. For these, we currently actions. The unit tests currently cover 70% of the code, with
include the tables of Suzuki et al. (2016), and other sources can plotting and Numba-wrapped routines as the main exceptions.
easily be added.
A REACLIB Rate is described in terms of sets, each of 3. Designing a Network in Python
which has seven coefficients, making up a fit of the form 3.1. Selecting Nuclei and Rates
5 Creating an astrophysical nuclear reaction network is an art
NA ásvñ = exp ⎛⎜a 0 + å ai T9(2i- 5) 3
+ a 6 log T9⎞⎟ (4 ) form that requires understanding which nuclei are important for
⎝ i=1 ⎠ your application and which rates need to be included to
with T9 = T/(10 K). A single rate can consist of multiple sets,
9 accurately capture the energy generation rate. In pynucastro
this translates into assembling the rates that are important into
representing, for instance, resonances and the smooth part of the
one or more Library objects and then creating a Rate-
rate, and these are added together to give the total rate. A Collection (or one of its derived classes). We often begin
ReacLibRate stores a Python list of SingleSet objects, each by using a network that is described elsewhere in the literature
representing a set that contributes to the total rate. A SingleSet as inspiration. As a result of the complexity of ensuring that a
knows how to numerically evaluate the set and output the Python network accurately captures all of the processes important to
and C++ code to compute the set as part of a reaction network. your application, a few networks (like the venerable
The ReacLibLibrary class reads in the latest stored version of aprox13) dominate most of the multidimensional simulation
the entire REACLIB rate library, and Libraryprovides the work done today. pynucastro has tools to help understand
starting point for filtering out the rates of interest. what rates and nuclei may be important.
Electron capture and beta-decay rates are taken from Suzuki There are a number of ways to select rates for your network:
et al. (2016) and stored as a two-dimensional table (electron 1. pass in a list of just the individual rate files you want to
density and temperature) as part of the TabularRate class. use (e.g., downloaded from the REACLIB website);
Linear interpolation is used to return the needed data at an arbitrary 2. read in a large library (like the entire REACLIB
thermodynamic point. The TabularLibrary class reads in all database) and filter the rates based on which nuclei are
of the tabular weak rates known to pynucastro as a library. It involved.
is important to note that there can be overlap with tabular weak
rates and approximate weak rates in REACLIB. Usually in these This will result in a Library containing just the rates you
cases, one should use the tabular version of the rate (since it want to use. But now there are two potential worries:
captures the density dependence).
1. Some key nuclei or rates might be missing.
Several nuclear properties are needed to derive inverse rates.
2. The network may be larger than need be if it includes
In our implementation we use the ground-state spin and the
unimportant nuclei and/or rates.
mass excesses from Huang et al. (2021) and Wang et al. (2021)
under strong experimental arguments. Each rate’s Q-value is A RateCollection provides methods to help with both of
obtained from REACLIB; however, we have implemented an these issues.
alternative option to compute it directly from the measured The easiest way to assess a network is to simply plot it and
mass excesses. The spin measurements may be different from look to make sure that all of the connections you expect are
the NuDat database used in Cyburt et al. (2010); therefore, we present. The validate() function also helps here—it takes a
may expect significant differences in heavy or neutron-poor/ larger Library as an argument and checks the rates in the

3
The Astrophysical Journal, 947:65 (24pp), 2023 April 20 Smith et al.

Figure 1. A simple network made by finding all rates that connect the input nuclei. (supplemental notebook: cno-network.ipynb)

RateCollection against all of those present in the do:


comparison library, andreport if any products are not
consumed by other rates (signifying an endpoint in the
network) or if you are missing any other rates with the exact
same reactants (because, for instance, you included protons but We can then interact with this Rate object directly, for
not neutrons in your initial rate filtering). An example of the example, to plot it or evaluate it at some temperature.
latter is that you might have 12C(12C, p)23Na but not 12C(12C, We will take a different approach for our CNO network. We
n)23Mg, because you did not include neutrons and 23Mgin the can start with a list of nuclei we are interested in and then use
initial list of nuclei you wanted to consider. linking_nuclei() to select only rates that involve these
The find_unimportant_rates() method can help input nuclei.
trim down a network by computing the relative magnitude of
each rate in a network. Given a list of thermodynamic states (as
a tuple: (density, temperature, Composition))
and a threshold, ò, it returns a list of all the rates that are always
smaller than ò × |fastest rate|. This can then be used to
automatically remove rates.
Optional arguments to linking_nuclei allow one to
To illustrate the process of creating a network, we will show
consider just the reactants or products. More sophisticated
how to make a simple CNO network and discuss the above filtering can also be done. Figure 1 shows a plot of the network
considerations. In the examples that follow we import the created in this manner (created simply via pynet.plot()).
pynucastro library as: The arrows indicate the direction of the rate, with double-ended
arrows meaning that both the forward and reverse rates are
present (the two can be optionally plotted as arcs so they do not
overlap). We see that this network has more rates than we
really needed if we just want to consider H burning via CNO.
We will start with the REACLIB library. The class In conditions where CNO is important, the triple-alpha rate
ReacLibLibrary (derived from Library) reads the entire probably is not. In addition, it is unlikely that we will need the
library (currently >80,000 rates). reverse rates for the CNO sequence (p + p is probably
important, but we omit that here to simplify the example).
To simplify this network, we evaluate the rates at a
thermodynamic state slightly hotter than the Sun’s core
temperature and remove the small rates. We need to build a
There are a number of ways to filter rates from the library. Composition object that stores the mass fractions for this
For instance, if we want just the 12C(p, γ)13N rate, then we can network—we will assume a solar-like distribution. First, we

4
The Astrophysical Journal, 947:65 (24pp), 2023 April 20 Smith et al.

Figure 2. The CNO network with the links colored by reaction rate strength. (supplemental notebook: cno-network.ipynb)

Figure 3. Filtering the RateCollection from Figure 1 by removing unimportant rates. (supplemental notebook: cno-network.ipynb)

can look at a plot with the links colored by the reaction rate rates as well.
strength for this thermodynamic state—this is shown in
Figure 2. As we suspected, the reverse rates are all small, as
is the triple-α rate, compared to the main CNO rates. In fact, on
this scale, the rates span 300 orders of magnitude.
We can now remove the slow rates. We will use an
automated method and filter the rates that are less than 10−20
compared to the fastest rate. We do not worry about screening
under these conditions, but this check can be done for screened

5
The Astrophysical Journal, 947:65 (24pp), 2023 April 20 Smith et al.

Figure 4. Example integration of the CNO network. (supplemental notebook: cno-network.ipynb)

Figure 3 shows the result. We note that 4He and p are not shown fractions, using the nuclear properties in the network module.
by default, unless p + p or triple-α are present in the network. This becomes the initial conditions for the integration:
We see that now the range of rates is much more reasonable. The
reverse rates are gone, as is the triple-α rate, and we see that the
CNO cycle is all that remains. It is also clear from the plot that
the 14N(p, γ)15O rate is the limiting rate for the cycle.
This was a simple example, and we could have just specified
the exact rates that make up the CNO cycle from the start. But
for larger networks and applications to new problem domains,
we might not know what rates are needed. Furthermore,
find_unimportant_rates() can take a list of thermo-
dynamic states, for instance, sampled from a real simulation at
different times and positions in the domain, and remove only the
rates that are never important under any of those conditions.

3.2. Integrating
Once we are happy with the network, we can write out the
Python code that implements all of the functions needed to
integrate the network via pynet.write_network(). In We use the BDF integration method, since that works well with
particular, this will define a module that contains a function rhs stiff ODEs and we explicitly pass in the Jacobian function. The
() that fills the right-hand side of the vector of ODEs that describe density and temperature are passed into the function via the
the network (Yk ), a function jac() that creates a Jacobian array args keyword argument—if we wished, we could easily make
(Jkm = dYk dYm ), and the nuclear properties like proton number,
these time dependent, computing them on the fly from the
Zk, and atomic mass, Ak. Reaction networks are often stiff,
requiring implicit methods, and hence a Jacobian. Each rate also current simulation time. Finally, we specify both a relative
knows how to write the function that computes its temperature- tolerance and an absolute tolerance, which are combined into a
dependent NA〈σv〉. single error of the form òi = rtol|Xi| + atol. Figure 4 shows
The following code shows how to write the network and the evolution of the nuclei. For these conditions—slightly
integrate it using SciPy solve_ivp(). We create and hotter than the central temperature of the Sun—we see that H is
initialize an array of mass fractions and then convert to molar depleted in about 1017 s.

6
The Astrophysical Journal, 947:65 (24pp), 2023 April 20 Smith et al.

4. Approximate Rates l p , al g , p
l ¢g , a = l g , a + , (10b)
Reaction networks with a lot of nuclei can be computation- l p, g + l p, a
ally expensive—both because of the size of the linear system
that needs to be solved during the implicit integration and when and the evolution equations reduce to
used in a hydrodynamics code owing to the memory needed to dYA
carry and advect each species separately. As a result, networks = - rYA Ya l ¢a, g + YB l ¢g , a (11a)
dt
are often approximated—removing rates and nuclei deemed not
important and replacing a collection of rates with an dYB
effective rate. = + rYA Ya l ¢a, g - YB l ¢g , a. (11b)
dt
One of the most common rate approximations is to group the
sequence A(α, p)X(p, γ)B and A(α, γ)B into a single effective This approximation is the basis of the popular “aprox”
rate. This is done by assuming that nucleus X and protons are in networks (Timmes 1999) and traces its origins at least as far
equilibrium. The evolution equations for these two reaction back as Weaver et al. (1978). We note that as an effect of this
sequences, including forward and reverse rates, are given as approximation, the protons produced by (α, p) are assumed to
dYA dY only react with the nucleus X and not with any other nuclei in
= a = - rYA Ya l a, g + YB l g , a the network. pynucastro can do this rate approximation
dt dt
- rYA Ya l a,p + rYX Yp l p, a (5a) automatically.
Consider a simple network that links 24Mg, 28Si, and 32S via
dYB (α, p)(p, γ) and (α, γ). Fully connecting these nuclei requires
= + rYA Ya l a, g - YB l g , a that we include 27Al and 31P as the intermediate nuclei from the
dt
+ rYX Yp l p, g - YB l g ,p (5b) (α, p) reactions. For the approximate version, we would like to
remove those two nuclei from the network but approximate the
dYX dYp flow through them using the effective rates derived above. The
= = + rYA Ya l a,p - rYX Yp l p, g
dt dt code to make this approximation is:
+ YB l g ,p - rYX Yp l p, a. (5c)
Here we use the shorthand notation for the rates, with the
forward rates
l a, g = NA ásvñA (a, g ) B (6a)
l a,p = NA ásvñA (a,p) X (6b)
l p, g = NA ásvñX (p, g ) B (6c) The method make_ap_pg_approx() looks to see whether
and reverse rates all of the necessary (α, γ), (α, p), and (p, γ) rates (and their
inverses) exist in the RateCollection and, if so, creates an
l g , a = NA ásvñB (g , a) A (7a)
ApproximateRate object that replaces the rates with the
l g ,p = NA ásvñB (g ,p) X (7b) effective approximation (while storing the original rates
l p, a = NA ásvñX (p, a) A . (7c) internally to evaluate them for computing the approximation).
We then explicitly remove the intermediate nuclei from the
Finally, notice that the evolution equations for YX and Yp are network. The original and approximate network is visualized in
identical and the evolution equations for YA and Yα are Figure 5. The gray links in the approximate version indicate
identical. that those rates are still computed and used as part of the
If we assume an equilibrium in the proton flow, dYp/dt = 0, approximation. We note one other feature of this approx-
then we can solve for the product ρYXYp: imation: there was a link between 27Al and 31P, but since we
rYA Ya l a, p + YB l g , p removed these nuclei, that link is also removed.
rYX Yp = . (8 )
l p, g + l p, a To see how well this approximation works, we can integrate
it along with the full network (no approximate rates) and a
Substituting this into the dYA/dt expression and grouping the reduced network with no (α, p) links at all (approximate or
forward and reverse terms together, we have explicit). We pick ρ = 107 g cm−3, T = 3 × 109 K, and the
initial composition X(4He) = X(24Mg) = 0.5. The temperature
dYA ⎡ l p, a ⎞⎤ and density are kept fixed. Figure 6 shows the comparison. We
= - rYA Ya ⎢l a, g + l a, p ⎛⎜1 -
dt l p, g + l


p, a ⎠ ⎦
see that the network without any (α, p)(p, γ) links (dashed
⎣ ⎝ lines) takes the longest to burn the 24Mg and the trajectories of
l pa l g , p ⎤ all of the isotopes are very different from the full network (solid
+ YB ⎡l g , a + . (9 ) lines). In contrast, the approximate network (dotted lines)
⎢ l p, g + l p, a ⎥
⎣ ⎦ captures the timescale for 24Mg depletion and 32S creation well,
This allows us to identify the effective forward and reverse agreeing with the full network after a brief transient. There is
rates: also good agreement in the intermediate 28Si abundance, with a
departure only at very low abundances, as it is almost depleted.
l a, pl p, g
l a¢ , g = l a, g + (10a) This shows that the approximate rate infrastructure in
l p, g + l p, a pynucastro works as intended.

7
The Astrophysical Journal, 947:65 (24pp), 2023 April 20 Smith et al.

Figure 5. The full 24Mg-burning network (left), and the approximate version (right). Rates that are approximated are shown as dotted lines, and nuclei that are not part
of the actual network are shown in gray. (supplemental notebook: approximate-rates.ipynb)

Figure 6. Comparison of a full network with p, 4He, 24Mg, 27Al, 28Si, 31P, 32S (solid), an approximate version that removes 27Al and 31P, by combining the (α, p)(p, γ)
and (α, γ) rates (dotted) and a reduced network that has no links (explicit or approximate) to 27Al and 31P (dashed). Only the nuclei in common to all three networks
are shown. We see that the approximate network follows the full network closely, but the reduced network takes longer to burn the initial 24Mg because it is missing
the additional pathway through 27Al. (supplemental notebook: approximate-rates.ipynb)

Approximate networks can be exported both to Python and the endpoint nuclei are, and the Q-value for the rate is
to C++. In this case, pynucastro writes the source code of the recomputed. An example use case for this is if you want to
functions needed to evaluate each of the rates, as well as the capture carbon burning in a network. REACLIB has three rates
code, needed to arrange them together in the approximation, to that involve 12C + 12C, but if you created your network without
a file. While this is one of the most commonly used neutrons, then you will not have pulled in 12C(12C, n)23Mg(n,
approximations in nuclear reaction networks, it is straightfor- γ)24Mg. The neutron capture here tends to be very fast, so we
ward to create other approximations using the same framework could simply approximate this rate as 12C(12C, γ)24Mg. This
in pynucastro. can be done using the modify_products() method on the
Another easy approximation that pynucastro supports is rate. The end result is that we approximate this branch of
modifying a rate. In this case, the rate itself is not changed, but carbon burning without having to pull two more nuclei into our

8
The Astrophysical Journal, 947:65 (24pp), 2023 April 20 Smith et al.

Figure 7. The left panel shows the reaction rate for the 23Ne beta decay for a range of electron density and temperature. The right panel shows the energy-loss rate due
to neutrinos for the 23Ne beta decay. (supplemental notebook: urca_network.ipynb)

network (n and 23Mg). This was used in the network described 23


Ne. Then, we specify rates from the ReacLibLibrary by
in Zingale et al. (2022) and is illustrated in the network using each rate’s name:
described in Appendix E.

5. Tabular Weak Rates


Weak rates are of great interest to many applications,
especially in stellar environments. These rates often depend on
both temperature and density, requiring the rates to be tabulated
prior to integration of a network. pynucastro natively includes
tabular rates for sd-shell nuclei pairs with A of 17–28 from
Suzuki et al. (2016). These rates are accessed through the
TabularRate class and can be included in networks with the
more standard REACLIB rates.
TabularRate reads a file given in a (ρYe, T) format and
performs linear interpolation to calculate the appropriate rate
and the energy lost to neutrinos. The energy loss presupposes
that the neutrinos free stream out of the environment. Figure 7
demonstrates this capability over a range of electron density
and temperature for the 23Ne beta-decay reaction. These two
plots are both easily made with the TabularRate class and
allow for exploration of the various weak rates in pynucastro.
A nice example of a full network that incorporates The resulting network is shown in Figure 8. This demonstrates
TabularRate is the A = 23 Urca reactions with simple how we can easily incorporate both TabularRate and
carbon burning. The A = 23 Urca reactions consist of a beta ReacLibRate rates into a single network. For C++
decay and electron capture, linking the isotopes 23Na and 23Ne: networks, AmrexAstroCxxNetwork automatically adds
the calls to interpolate from the rate tables when filling the
 23Na + e- + n¯e
23Ne reaction rates. This network was used for convective Urca
23Na + e-  23Ne + n .
e (12) simulations (Calder et al. 2019) with the MAESTROeX code
(Fan et al. 2019).
Both weak reactions were tabulated rates by Suzuki et al.
(2016). Rates related to carbon burning are from REACLIB. 6. Reverse Rates and Nuclear Partition Functions
Here we see how to create this network with pynucastro. First, The relationship between the inverse and the forward
we search the TabularLibrary for rates linking 23Na and reaction may be obtained by detailed balance calculations—

9
The Astrophysical Journal, 947:65 (24pp), 2023 April 20 Smith et al.

Figure 8. A network with simple carbon burning and the A = 23 Urca reactions. (supplemental notebook: urca_network.ipynb)

under the assumption of equilibrium in the reaction, we can temperature tables and the FDRM mass model as our default
derive the inverse reaction rate Nap - 1 ásvñB1, B2,  , Bp in terms of options.
the forward rate Nar - 1 ásvñC1, C2,  , Cr (see the derivation in Similarly, the tabulated spin of the ground-state nuclei from
Appendix B). Each detailed balance inverse rate can be Huang et al. (2021) and Wang et al. (2021) is also stored in a
decomposed as a multiplication between a component that suitable format to be read by pynucastro. From this point, we
satisfies fit (4), as in REACLIB, and an additional component can choose between using all the unique-value ground-state spin
that involves partition functions: measurements, regardless of the experimental or theoretical
arguments, or to keep only the strong experimental observed
Nap - 1ásvñB1, B2  , Bp = Nap - 1ásvñC¢ 1, C2 , Cp measurements. In our implementation for the spin of the ground-
state nuclei in pynucastro, we have considered the latter choice.
G C1  G Cr (T ) In order to compute the inverse rate by detailed balance (13),
´ , (13)
G B1  G Bp (T ) we have implemented the DerivedRate class. The Deri-
vedRate class inherits from Rate and computes the
REACLIB component that satisfies fit (4) Nap - 1 ásvñ¢B1, B2  , Bp
where Nap - 1 ásvñB1, B2  , Bp is defined by Equation (B9) and from the chosen forward rate. However, the DerivedRate
Nap - 1 ásvñ¢B1, B2  , Bp is the rate parameterization (4) with the class may go further and compute Equation (13) by using
constants a0,rev, a1,rev, L, a6,rev given by Equations (B10a– interpolations of the tabulated values of the partition functions
B10g), and each Gni is the nuclear partition function of the as requested. It is important to note that DerivedRate does
ni-nuclei defined in Equation (A8). not support constructing inverse weak rate reactions. This
The nuclear partition function information tables are stored decision has been made because weak rates are not required to
in a suitable format to be read by pynucastro, switching be in equilibrium to occur (see, e.g., Clifford & Tayler 1965;
between merging the low- and high-temperature tables in Seitenzahl et al. 2009), breaking the necessary assumptions to
Rauscher et al. (1997) and Rauscher (2003), or to use the low- compute Equation (B9).
temperature table only, in Rauscher et al. (1997). Furthermore, To show the effects of the partition function correction and
we can decide between using the finite-range droplet model the accuracy of the DerivedRate rates, we have defined the
(FDRM) and using the Thomas-Fermi approach with Strutinski iron56_end network with 48,49,55,56Cr, 52–56Mn, 52–56Fe,
integral (ETFSI-Q) mass models to compute the partition
55,56
Co, and 56Ni species, along with n, p, and α. This network
function values. In our implementation of the partition is inspired by the high-Z portion of the popular aprox21
functions in pynucastro, we have considered merging both network, as illustrated in Figure 9.

10
The Astrophysical Journal, 947:65 (24pp), 2023 April 20 Smith et al.

The required code to create iron56_end is:

The screening and inverse screening factors of the iro-


n56_end network are computed from Equations (19) and
(C7), respectively. It is important to mention that Equation (C7)
is computed under the assumption of the linear mixing rule, but
not all the screening routines may satisfy this requirement (see,
e.g., Wallace et al. 1982; Chugunov 2021). In order to cover
these cases, we have implemented symmetric screening to the
forward and inverse rates, i.e., the same enhancement factor
assigned to the forward rate is assigned also to the inverse rate.
We can explore the partition function temperature behavior by
plotting Gni = Gni (T ) for different nuclei ni of the network, as
depicted in Figure 10. Notice that the nuclei with the same
atomic number have a more similar behavior than the nuclei
with the same atomic mass number.
To validate our results, we have compared the results
obtained from the iron56_end network by replacing the
REACLIB detailed balance rates with DerivedRate rates
and replacing the results obtained by integrating the iro-
n56_end network with just REACLIB detailed balance
inverse rates. Setting ρ = 108 g cm−3, T = 7.0 × 109 K, and
the composition
X (p) = X (n) = X (a) = X ( 56Ni) = 5 37, (14a)
X ( 48Cr) = 17 37, (14b)
with all the remaining mass fractions set to zero as our initial
conditions, we can show the comparison of these two reaction
Figure 9. The integrated network iron56_end inspired by the high-Z portion network calculations and introduce the role of the partition
of the popular aprox21 network by replacing the REACLIB detailed balance
reverse rates with the DerivedRate rates under use_pf=True. (supple-
function in the previous reaction network under the same initial
mental notebook: derived_network.ipynb) conditions (Figure 11). The convergence of the network with

11
The Astrophysical Journal, 947:65 (24pp), 2023 April 20 Smith et al.

Figure 10. An example of the partition function temperature behavior of 56Ni, 56Cr, 56Mn (left), and 52Fe, 54Fe, 55Fe, 56Fe (right). The partition function value of each
nucleus, with identical atomic mass number A but different atomic number Z, changes significantly around 1010 K. This behavior is different in nuclei with different A
and the same Z, where all the nuclei tend to have similar values around 1010 K. Although we should not generalize this behavior to all existing nuclei from this
particular case, this behavior dominates in the nuclei of our network. (supplemental notebook: plot_pf.ipynb)

Figure 11. Comparing the nuclei 55Cr, 54,56Mn, and 56Ni of the iron56_end network with the REACLIB detailed balanced inverse rates replaced by
DerivedRate objects under the effects of the partition functions (right) and the iron56_end network comparison without any modification from the partition
functions (left). The maximum molar fraction absolute error in the left case is ∼10−7. The density and temperature in both comparisons are ρ = 108 g cm−3 and
T = 7.0 × 109 K, respectively. (supplemental notebook: iron56_end_networks.ipynb)

the inclusion of partition function may differ significantly as we products {Bj},


increase the temperature around ∼1010 K. This temperature
regime is common in stellar atmospheres of neutron stars or C1 + C2+  + Cr  O*  B1 + B2 +  + Bp, (15)
inside the cores of white dwarfs, where the nuclear statistical
equilibrium regime takes place. is enhanced owing to the Coulomb screening of the reactants,
by a factor f cl given by
7. Electron Screening
mC (ZC1) +  + mC (ZCr )
So far we have been treating the nuclei as if they were fCcl1 Cr  O* = exp ⎡

⎣ kB T
decoupled from the surrounding sea of electrons, but inside a
star densities are sufficiently high to invalidate this approx- m (ZC1 + ZCr ) ⎤
C
imation. Accurate reaction rate calculation requires us to - , (16)
kB T ⎥

account for Coulomb screening, where the free electrons
surrounding each nucleus are preferentially attracted to the *

positively charged nuclei. This reduces the nucleus effective where O is the composite nuclei of the reactants. We need to
charge, thus lowering the Coulomb barrier to fusion and greatly highlight that Equation (16) only describes the classical
enhancing reaction rates. enhancement corrections. If we introduce quantum effects,
*
From Dewitt et al. (1973) and imposing the linear mixing the tunneling probability and the total width of each O channel
rule, any reaction rate with a set of reactants {Ci} and a set of modify the total enhancement factor (see more details in

12
The Astrophysical Journal, 947:65 (24pp), 2023 April 20 Smith et al.

Kushnir et al. 2019; Chugunov 2021) as follows: According to Chabrier & Potekhin (1998) and the definitions
provided in Equation (20),
fC1 Cr  B1 Bp = fCcl1 Cr  O* fCq1 Cr  B1 Bp , (17)
mC
Fisc = k iT = A1 [ Gi (A2 + Gi )
where fC1 Cr  B1 Bp is the total screening factor and B

fCq1 Cr  B1 Bp is the quantum enhancement sector given by


G
- A2 ln ( Gi
A2
1+ ⎤

Gi
A2 )
fCq1 Cr  B1 Bp = fCq1 Cr  O* f Bq1 Bp O* . (18) + 2A3 [ Gi - arctan ( Gi )] , (21)

Γ and G̃ are the total width in vacuum and in the plasma, where A1 = −0.9052, A2 = 0.6322, and A3 = - 3 2 - A1
respectively. Note that fCq1 Cr  B1 Bp = f Bq1 Bp  C1 Cr , i.e., the A2 is valid within a range 0.01 < Γi  170. The
quantum enhancement screening sector is symmetric with iron56_end network, under the initial conditions (14a)–
respect to the reactants and the products. To implement these (14b), at ρ = 108 g cm−3 and T = 7.0 × 109 K, defines a range
corrections, in principle, we need to sum over all the 0.01 < Γi < 3.09, which agrees within the boundaries of the fit.
Nar - 1 (sv )Csc1 Cr reaction channels in order to accurately This fit is provided in pynucastro by the function
potekhin_1998.
compute Nar - 1 ásvñCsc1 Cr . Once the enhancement calculations are completed and
However, in pynucastro we fix fCq1 Cr  B1 Bp = 1; thus, returned to the RateCollection network, we rely on the
the total enhancement factor used in our implementation is ScreeningPair class and the evaluate_screening
given by method to hold the necessary information to compute the
screening factor. The ScreeningPair class is a container of
fC1 Cr = fCcl1 Cr  O* . (19) all the same two-nucleus reactant rates. The core idea of this
class is to contain the required information, relative to the
This assumption may introduce an uncertainty of ≈10% in the reactants. For REACLIB we use only one ScreeningPair
screening factor, as in the pp-reaction (Kushnir et al. 2019). For object for each reaction, with the exception of the triple-α
our purposes, it is out of the scope to perform calculations on reaction. The method evaluate_screening constructs a
each state of the compound nuclei. However, an exceptional PlasmaState object from the density, temperature, and
case discussed in Chugunov (2021) can be easily implemented molar composition of the network to compute the ne factor, Γe,
in a future version of pynucastro. and Γi, respectively. It then creates a list with all the
From Equations (16) and (19), we need to understand the ScreeningPair objects required to screen the network,
functional form of mCi , which appears as a part of the free holding their information inside ScreenFactors. Finally, it
energy Fsc = μC/kBT. In pynucastro we have implemented uses these objects to compute the screening factor for each rate
three different fits that construct F and perform the enhance- using the specified fit method. It is important to recall that we
ment factor calculations in a reaction network: chugu- have described only the use of the potekhin_1998 method,
nov_2007 from Chugunov et al. (2007), chugunov_2009 but chugunov_2007 and chugunov_2009 are also avail-
from Chugunov & DeWitt (2009), and potekhin_1998 able in our implementation.
from Chabrier & Potekhin (1998). Note that only Chabrier & Finally, we note that it is easy to use one of the screening
Potekhin (1998) is available to be used in the nuclear statistical implementations when integrating a Python network—simply
equilibrium (NSE) state that we discuss in the next section. add the name of the screening function to the args tuple
Since this fit is implemented in both reaction networks and discussed in Section 3.2, and it will be called when evaluating
NSE, we will center our discussion on it. the rates. For C++ networks, we have C++ ports of the
We start by defining the ith nuclei Coulomb-coupling screening routines that are automatically hooked in when using
constant Γi of a multicomponent plasma (MCP) by AmrexAstroCxxNetwork.

e2 4pne ⎞-1 3 8. Nuclear Statistical Equilibrium


Gi = Ge Zi5 3, Ge = , ae = ⎛ . (20)
ae kB T ⎝ 3 ⎠ One additional feature we have implemented in pynucastro
is the ability to compute the NSE mass fractions using several
The approximation ne ∼ ρYe/mu is used in some references, for iterations of the hybrid Powell’s method (Powell 1964, 1970).
example, in Seitenzahl et al. (2009); however, in pynucastro In Python, this is implemented by the SciPy fsolve()
we always update Ye to be consistent with the current estimate function. In C++, we converted the FORTRAN 77 imple-
of the composition. Two important container classes store the mentation of Powell’s method from MINPACK (More et al.
necessary information to compute the screening factor: 1980) to C++ as a templated header library. This solver is
PlasmaState and ScreenFactors. A PlasmaState more robust than the traditional Newton–Raphson method in
two ways. From our tests, Powell’s method can handle a larger
object holds the temperature, the density, the molar fraction,
range of thermodynamic conditions than simple Newton–
and the atomic number values of each nucleus inside the
Raphson iterations. It is also capable of handling the problem
reaction network to be screened. Similarly, a Screen- of the Jacobian becoming singular during Newton–Raphson
Factors object holds the reactant nucleus information of iterations. As pointed out in Lippuner & Roberts (2017), we
the rate to be screened. Given the two nuclei contained in a will follow the same strategy to accelerate the solution
ScreeningPair object, a ScreenFactors object is convergence, by updating Ye from the computed composition
initialized to hold the two-reactant nucleus information. of the previous iteration.

13
The Astrophysical Journal, 947:65 (24pp), 2023 April 20 Smith et al.

We begin setting the NSE variables (ρ, T, Ye) and an initial


guess for (midp , mid
n)
—we have chosen (midp , mid
n)
to be (−3.5, −
15.0); however, a different pair may be chosen if the solution
does not converge uniformly. We start the first iteration with
mCi = 0 . The solution is then obtained by iterating over the
following:
1. First, we compute the NSE mass fractions (see the
derivation in Appendix D):

mi kBT 3 2
Xi =
mi
r
(2Ji + 1) G (T ) ( 2p  2 )
Z i mid
p + Ni mnid + Qi
´ exp ⎡ kBT

Z i mCp - mCi Figure 12. This figure shows the NSE mass fraction at a range of electron
+ kBT
⎤. (22) fractions from 0.4 to 0.6 at ρ = 107 g cm−3 and at temperature T = 9.0 × 109
⎦ K. The nuclei p, n, and 4He dominate at high temperature, and there is a
symmetry correspondence between the mass fraction of p and n once Ye = 0.5.
2. Next, we use the predicted mass fractions in the A similar figure is observed in Figure 1 in Seitenzahl et al. (2008).
constraint equations, (supplemental notebook: nse.ipynb)

å Xi - 1 = 0 (23a) nuclei with Coulomb correction is shown below:


i

Zi Xi
Ye - å Ai
= 0, (23b)
i

and solve for midp and midn . The first constraint equation
ensures that the predicted mass fractions sum to 1, and the
second enforces that the electron fraction of the state
agrees with the electron fraction input.
3. From the computed (midp , mid n)
pair we evaluate the
network composition of the nuclei, using Equation (22)
and the electron number density ne from

r Zi Xi
ne = å
m u i Ai
, (24)
Figures 12 and 13 are shown to compare the computed NSE
distribution at different thermodynamic conditions to the ones
where mu is the atomic unit mass.
obtained from the literature to show the validity of the solver.
4. Using Equations (20) and (21), we compute mCi by
The nuclei that are not present in the corresponding figures for
replacing the computed electron number density of the comparison are in dashed lines and transparent colors for better
previous step (24). Is important to recall that we may take readability. Both Figures 12 and 13 show how NSE mass
mCi = 0 for any iteration if no Coulomb screening is fractions change for a range of electron fractions from 0.4 to
considered. 0.6 at a fixed density, ρ = 107 g cm−3, and temperature.
n , setting each nucleus mi
5. Finally, we compute midp and mid C
Figure 12 is at a relatively high temperature, T = 9.0 × 109 K.
to the value computed in the previous step and by the use There is a domination of mass fractions by p, n, and α and a
of the hybrid Powell’s method again. symmetry in mass fractions at Ye = 0.5. Figure 13 is at a
relatively low temperature, T = 3.5 × 109 K. Mass fractions
We iterate this process until the values of midp and mid n change drastically before Ye = 0.5 but become steady and
converge to an absolute and relative tolerance of ∼10−10. stable once Ye > 0.5. Figures 1 and 3 in Seitenzahl et al. (2008)
These values may be adjusted by hand, as the initial guess, to used the same thermodynamic conditions and have a similar
ensure the convergence of the solution. result for comparison.
The method get_comp_nse implemented in the Rate- Finally, in order to compare how the reaction network agrees
Collection network follows the previous four steps to with the NSE calculations, we have considered the iro-
compute the solution, ensuring that mCi is constant for each n56_end network, described in Figure 9, under the initial
iteration, while the hybrid Powell’s method computes the conditions (14a–14b). By keeping the default options intact, we
solution. A sample code that solves the NSE state given a set of obtain the comparison between integrating the reaction network

14
The Astrophysical Journal, 947:65 (24pp), 2023 April 20 Smith et al.

Figure 13. This figure shows the NSE mass fraction at a range of electron fractions from 0.4 to 0.6 at ρ = 107 g cm−3 and at temperature T = 3.5 × 109 K. Dashed
lines with transparent colors are nuclei that are not present in Figure 3 in Seitenzahl et al. (2008) for easier comparison. This figure shows a distinct behavior once
Ye = 0.5, which is observed in Seitenzahl et al. (2008). (supplemental notebook: nse.ipynb)

Figure 14. Comparing the mass fractions Xi of each nucleus ni contained in the reaction network, by integrating the iron56_end reaction network and computing its
NSE mass fractions (left). In addition, we compute the absolute and relative mass fraction differences with respect to each nucleus (right). The Coulomb correction is
included in the NSE state and reaction network calculations. The density and temperature are ρ = 108 g cm−3 and T = 7.0 × 109 K, respectively. (supplemental
notebook: iron56_end_integrate.ipynb)

and computing the NSE state mass fractions, shown in reaction networks in C++. A key concern for the C++ code
Figure 14. From this comparison we can assert an excellent generation is that it be able to work on both GPUs and CPUs.
agreement between the NSE solve and integrating the network We do this in the AMReX-Astro framework, utilizing the
to steady state; however, it is important to mention that our AMReX (Zhang et al. 2019) data structures and lambda
initial conditions choice significantly impacts the convergence capturing of compute kernels to offload the entire network
of the steady state of the network into the NSE state integration to GPUs. pynucastro generates the right-hand side
composition. and Jacobian of the network, as well as the metadata needed to
interpret it, and this can be directly used by our codes. The C+
9. C++ Code Generation + networks differ from the simple Python networks described
pynucastro works closely with the AMReX-Astro simula- above owing to the need to couple with hydrodynamics.
tion codes, Castro (Almgren et al. 2020) and MAESTROeX Castro supports three different coupling strategies: an operator
(Fan et al. 2019). The codes are written in C++, for split approach where reactions and advection are independent
performance portability, and therefore we need to output of one another, a traditional spectral deferred corrections (SDC)

15
The Astrophysical Journal, 947:65 (24pp), 2023 April 20 Smith et al.

approach that supports second- and fourth-order space-and- solve_ivp integration (we use the "bdf" option, which is
time integration (Zingale et al. 2019), and a simplified SDC an implementation of Shampine & Reichelt 1997).
approach (Zingale et al. 2022). The C++ network generated by Figure 15 shows the comparison. We select ρ = 106 g cm−3,
pynucastro needs to be compatible with each of these T = 2 × 109 K, and the initial composition 99% 4He and 1%
14
approaches. As part of this approach, we integrate mass N by mass. In the top panel, we show the history of the mass
fractions, Xk, or partial densities, (ρXk), in the reaction network, fractions from Python (solid lines) and C++ (points) and see
instead of the molar fractions used internally in pynucastro. that they lie right on top of one another. For clarity, we only
Integrating astrophysical reaction networks requires stiff plot mass fractions that go above X = 10−5 at some point in
integrators, and a lot of work has been done on assessing the their history. In the bottom panel, for those same species, we
performance of different algorithms (Timmes 1999; Longland plot the difference between the Python and C++ abundances
et al. 2014). The AMReX-Microphysics suite uses the VODE as a function of time. We see that this absolute error is always
integrator (Brown et al. 1989) to integrate the reaction network. below 10−6. This is despite the integrators being different
VODE is a fifth-order implicit backward difference integrator implementations of a backward difference integrator. This
that handles stiff reaction networks well. VODE was originally shows that our C++ and Python code generation is remarkably
written in FORTRAN 77, but we completely ported it to C++ consistent.
to work in our GPU framework and added a number of
integration step checks to help preserve ∑kXk = 1 without 10. Summary and Future Work
having to resort to renormalization of the species. The details of
our integrator are given in Zingale et al. (2022). There are many areas of development to focus on in the
The AMReX-Astro networks are implemented in header files future. First, there are a lot of other examples of approxima-
to enable function inlining. pynucastro contains templates tions to networks that could be added. For instance, CNO and
with these headers with keyword placeholders for the network- hot CNO burning can be reduced to just a few rates, carbon and
specific code to be injected. The AmrexAstroCxxNetwork oxygen burning can likewise be simplified to a few endpoints,
write_network() function reads the templates and at each and approximations to iron-group equilibrium like those made
keyword encountered calls an appropriate function to write out in the aprox19 network and others can make lower Ye
the appropriate piece of the network, for instance, functions to accessible with a reduced network. Adding a separate
evaluate reaction rates, ydot terms, and Jacobian. We represent “photoionization” proton, as done in aprox19, is also
the ydot terms as SymPy objects and use the SymPy C++ code desirable, since it reduces the complexity of the Jacobian of
generator to write the expressions to compute them. Since we the system. We can build a derived class off of the Rate class
evolve energy in the C++ networks, we include temperature to implement some of these approximations. Very specialized
derivatives in the Jacobian, and the rate functions use networks like the iso7 network (Timmes et al. 2000) or the
templating to compile this out when not needed (for instance, rp-process approximate network of Wallace & Woosley (1981)
when using a numerical Jacobian). For our application codes, might require specialized code paths but are still possible to
we generate the networks once and keep them under version implement to allow for interactive exploration and exporting
control in our Microphysics project repository (AMReX-Astro the network in different formats with updated rates.
Microphysics Development Team et al. 2022). Microphysics The Python interface to nuclear reaction data and network
contains unit tests to exercise any network, which are run structure allows for easier analysis of trends in reaction
nightly. The C++ networks have the same screening functions networks, like the work of Zhu et al. (2016) and Meyer
as in pynucastro. Additionally, the C++ networks have a (2018), and the development of machine-learning approaches
plasma neutrino loss term, which has not yet been ported to to approximating nuclear kinetics (Fan et al. 2022).
Python. This augments the energy from the network. We are also in the process of implementing two methods for
reaction network reduction that were originally developed for
the chemical reaction networks used in combustion simula-
9.1. Comparison of Python to C++ Nets tions. The first method was originally outlined by Sun et al.
(2010), and the second was developed by Pepiot-Desjardins &
To check for consistency between the Python and C++ Pitsch (2008) and explored further in Niemeyer & Sung (2011).
networks, we do a simple one-zone burn. Although the C++ The pyMARS library (Mestas et al. 2019) implements these
networks are often done with hydro evolution, or at least a methods for chemical networks and inspired their inclusion in
temperature/energy equation (a self-heating network), we pynucastro.
compare without any temperature evolution here. We compare We also want to expand the range of nuclear physics data
using the subch_approx network—this is an approximate sources we encompass. Since this is developed openly, on
version of the network described in detail in Zingale et al. github, the hope is that others in the community will directly
(2022). The code needed to generate it is given in Appendix E. contribute new rates as they become available. In the near term,
In our C++ Microphysics burn_cell unit test, we set the we will increase our coverage of weak rates. At the moment,
initial thermodynamic state and then instruct VODE to we include those from Suzuki et al. (2016), since Urca was an
integrate by a Δt and return the new solution. In order to see initial application area. The tabulated weak rates of Fuller et al.
the history of the evolution, we evolve to t = 10−3 s in 100 (1985), Langanke & Martínez-Pinedo (2000), and others fit
increments, logarithmically spaced between 10−10 and 10−3 s. into the TabularRate framework well. This coverage will
It is not enough to just disable the energy evolution (by setting also allow us to generate NSE tables from large networks that
de/dt = 0), but we also need to skip obtaining the temperature include Ye evolution that can be used within hydro codes, as in
from the equation of state each step, since even with fixed e the Ma et al. (2013), to capture the energetic and Ye evolution from
composition change will cause T to change. With this set, we a large network in tandem to a more reasonably sized network
can compare the C++-VODE integration to the Python-Scipy used for advection. In this case, tabulating dYe/dt in addition to

16
The Astrophysical Journal, 947:65 (24pp), 2023 April 20 Smith et al.

Figure 15. Comparison between the Python and C++ integration of the subch_approx network at fixed T and ρ. The top panel shows the mass fractions, with the
Python result as lines and the C++ result as points. The bottom panel shows the difference between the two codes. (supplemental notebook:
subch_approx_comparison.ipynb)

the NSE state would allow for a second-order-accurate the AMReX-Astro simulation codes. Similar templates can be
predictor-corrector time integration scheme with NSE (espe- used for other codes with few modifications to the code. This
cially when combined with the spectral deferred corrections would be a good project for a student using a simulation code
integrator, as in Zingale et al. 2022). in their research.
Although our primary source for thermonuclear rates is Finally, the focus of pynucastro so far is on nuclear
REACLIB, other rate compilations exist in the community, properties and networks, but support for more areas of nuclear
including STARLIB (Sallaska et al. 2013). STARLIB goes astrophysics can be added as needed, such as wrappers for
beyond REACLIB in including error information associated popular equations of state and neutrinos. Plasma neutrino
with the tabulated rates. Support for STARLIB can be added in losses would make it easy to plot ignition curves, for example,
a straightforward manner by subclassing either Rate or and since we keep track of the individual rates, we can handle
ReacLibRate and would be a good project for a new the neutrino losses from H-burning reactions in a straightfor-
contributor. ward manner.
It is also straightforward to increase the application codes
that we can output networks to. We use a template find-and- We thank Jim Truran for teaching us all about nuclear
replace strategy to insert the functions needed to evaluate the astrophysics. We thank Luna for her help sniffing out bugs in
network into the C++ code functions that communicate with pynucastro.

17
The Astrophysical Journal, 947:65 (24pp), 2023 April 20 Smith et al.

The work at Stony Brook was supported by DOE/Office of and the National Nuclear Security Administration. A.S.C. is
Nuclear Physics grant DE-FG02-87ER40317. This material is funded by the Chilean Government ANID grant No.
based on work supported by the U.S. Department of Energy, 56160017 and the U.S Department of State, Fulbright grant
Office of Science, Office of Advanced Scientific Computing No. PS00280789.
Research and Office of Nuclear Physics, Scientific Discovery Software: AMReX (Zhang et al. 2019), Jupyter (Kluyver
through Advanced Computing (SciDAC) program under et al. 2016), matplotlib (Hunter 2007), NetworkX (Hagberg
award No. DE-SC0017955. This research was supported by et al. 2008), Numba (Lam et al. 2015), NumPy (Oliphant 2007;
the Exascale Computing Project (17-SC-20-SC), a collabora- van der Walt et al. 2011), pytest (Krekel et al. 2004), SymPy
tive effort of the U.S. Department of Energy Office of Science (Meurer et al. 2017).

Appendix A
Ideal Boltzmann Gas Approximation
In order to relate the different thermodynamics quantities computed in a reaction network, an equation of state should be provided.
In the pynucastro design we assumed the nondegenerate, noninteracting, and nonrelativistic regime for the nuclei, with exceptions
discussed in Section 7. As we increase the temperature, keeping the density 1011 g cm−3, the Boltzmann statistics governs the
behavior of the nuclei involved in all the reaction networks. In this section we want to stress the relationship between the number
density n, chemical potential μ, and temperature T under this approximation. These calculations are standard and can be found in
many references (see, e.g., Hill & Hill 1960).
The grand-canonical partition function  for k subsystems is given by

= å (z k Z k ) , (A1)
k

where Zk is the canonical partition function for the subsystem with k identical particles, z = em kB T is the fugacity parameter, and kB
is the Boltzmann constant. From here

Z1k- p
Zk = , (A2)
k!
where Z1-p is the canonical partition function for only one particle,

Z1 - p = å ò d 3p d 3x e- (l,p ,x ) k i i BT , (A3)


l

where x are the space parameters, p are the momentum parameters, and l labels the internal degrees of freedom. For a spherically
symmetric potential bounded particle, the energy of each nucleus is given by

p2
 (l , p , x ) =
+ Dl + mc2 + mC, (A4)
2m
with p2 = p · p as the squared momentum magnitude, Δl as the discrete energy levels of each particle, mc2 as the rest energy, and μC
as the Coulomb screening constant, which is the consequence of the electron cloud interactions that surround each ionized nucleus.
Combining Equations (A1)–(A4), we may compute  by

3 2
k B T V ⎛ mk B T ⎞
å (2Jl + 1) e-D e(m - mc
2 - mC )
= l kBT , (A5)
k ⎝ ⎠ 2p  2
where V is the volume, Jl is the l-energy level spin of the nuclei, and m is the mass of the nuclei. Thus, the grand-canonical potential
Ω is given by

W = - k B T log 
mk B T 3 2 (m - mc 2 - mC ) k B T
= - k B T å (2Jl + 1) e-Dl
l
(k B T ) V
( )
2p  2
e . (A6)

18
The Astrophysical Journal, 947:65 (24pp), 2023 April 20 Smith et al.

The number of particles as a function of (T, V, μ), where μ is the chemical potential, can be expressed as

N =- ( )
¶W
¶m V , T

mk T 3 2 (m - mc 2 - mC ) k B T
= V ⎡å (2Jl + 1) e-Dl k B T ⎤ 2pB2
⎢ l



( )
e . (A7)

After identifying the number density n = N/V and introducing the normalized partition function definition (Fowler et al. 1967;
Rauscher 2003),

(2J0 + 1) G (T ) = å (2Jl + 1) e-D l kBT , (A8)


l
where J0 is the nucleus ground-state spin, we canrewrite Equation (A7) in terms of μ as

3 2
⎛ 2p  ⎞
n 2
m = k B T log ⎡
⎢ (2J0 + 1) G (T ) mk B T
⎜ ⎟
⎤ + mc2 + mC.
⎥ (A9)
⎣ ⎝ ⎠ ⎦
Finally, we can define the kinematic term of the chemical potential by

3 2
⎛ 2p  ⎞
n 2
mid = k B T log ⎡
⎢ (2J0 + 1) G (T ) mk B T
⎜ ⎟
⎤,
⎥ (A10)
⎣ ⎝ ⎠ ⎦
suggesting μ = μid + mc2 + μC. The case μC = 0 is the noninteracting or no-screening case. By computing the derivatives of
Equation (A6), it is possible to compute the entropy per ion and pressure in terms of n and T (Lippuner & Roberts 2017).

Appendix B
Reverse Rates and Detailed Balance Calculations
The relationship between the inverse and the forward reaction may be obtained by detailed balance calculations (see, e.g.,
Clayton 1968; Arnett 1996; Rauscher et al. 1997; Angulo et al. 1999; Cyburt et al. 2010; Lippuner & Roberts 2017). Here we
describe how the detailed balance calculations are performed. A nuclear reaction between a set of reactants {Ci} and a set of products
{Bj} in equilibrium is represented by

C1 + C2+  + Cr  B1 + B2 +  + Bp, (B1)


where r and p represent the number of reactants and products, respectively. The right-pointing arrow represents a forward reaction,
while the left-pointing arrow represents a reaction in the opposite direction known as the inverse reaction. After applying
Equation (1) to the forward reaction with r reactants,
1 dnC1 1 dnC2 1 dnCr n C n C  n Cr
= == = - 1 2 ásvñC1C2 Cr , (B2)
cC1 dt cC2 dt cCr dt  cC i !
Ci
and to the inverse reaction with the p products as reactants,
1 dn B1 1 dn B2 1 dn Bp n B1 n B2  n Bp
= == = - ásvñB1B2  Bp (B3)
c B1 dt c B2 dt c Bp dt  c Bi !
Bi

where nCi is the nuclei Ci number density, cCi is the count of the reactant nuclei Ci, and similarly cBi is the count of the product nuclei
Bi. From Equations (B2) and (B3) and imposing the conservation of nucleons,

 c Bi !
ásvñB1B2  Br n C n C  n Cr Bi
= 1 2 ´ . (B4)
ásvñC1C2 Cr n B1 n B2  n Bp  cC i !
Ci
Furthermore, after computing n Ni in terms of m Ni , from Equation (A9), for each Nith nucleus, and using the approximation
m Ni = A Ni mu ,
3 2
m k T
e(m Ni- m Ni c
2- m C )
n Ni = (2J0 + 1) A N3i 2 ⎛ u B2 ⎞ Ni kBT
G Ni (T ). (B5)
⎝ 2p  ⎠

19
The Astrophysical Journal, 947:65 (24pp), 2023 April 20 Smith et al.

From Equations (B4) and (B5) we obtain, depending on the value of μ , a relationship between the forward and reverse rate. The
C

case μC = 0 is the no-screening case, where μC ≠ 0 implies the presence of Coulomb screening.
Case μC = 0: In this case, the previous substitution leads to

1 r - p (2JC1 + 1)  (2JCr + 1) AC1  ACr


3 2 3 (r - p )
Nap - 1 ásvñB1B 2  Br
Nar - 1 ásvñC1C2  Cr
= ( )
Na

(2JB1 + 1)  (2JBp + 1) A B1  A Bp
⎞ mu kB
2p  2
⎝ ⎠
( ) 2
T 2 (r - p)
3

 c Bi! r p
G C1  G Cr (T )
exp ⎡
⎢ - kB T ⎜å mCi - å m B ⎞ c2⎤⎥
1 ⎛
´ Bi
G B1  G Bp (T )  c Ci! i⎟
Ci ⎣ ⎝i = 1 i=1 ⎠ ⎦
r p
´ exp ⎡
⎢ k B T ⎜å m C i - å m B ⎞ ⎤⎥,
1 ⎛
i
⎟ (B6)
⎣ ⎝i = 1 i=1 ⎠⎦
where Na is Avogadro’s number, JNi is the spin value of the Nith nucleus ground state, cNi is the count of nuclei Ni in the reaction, and
G Ni (T ) is the ground spin-state normalized nuclear partition function (A8), with D Ni, l and JNi, l as the energy spectrum and the l-
energy level spin of the nuclei Ni, respectively. The quantities G Ni are constructed and tabulated between 107 and 1011 K in Rauscher
et al. (1997) and Rauscher (2003). In pynucastro we import these tables and convert them into a suitable format to be merged;
consequently, no calculations of Equation (A8) are performed. Each Ani represents the atomic weight of the nuclei ni, and we define
Q as the capture energy of the reaction, by

r p
Q = ⎛⎜å mi - å mp ⎞ c2. ⎟ (B7)
⎝i = 1 i=1 ⎠
Since the reaction is in equilibrium, we can assert that

r p
å mC i
- å mB i
= 0. (B8)
i=1 i=1

Using Equations (B7) and (B8), we can write the detailed balance inverse rate of the forward rate Nar - 1 ásvñC1 C2 Cr by

1 r - p (2JC1 + 1)  (2JCr + 1) AC1  ACr


3 2 3 (r - p )
Nap - 1 < sv>B1, B2,  , Bp = ( )
Na

(2JB1 + 1)  (2JBp + 1) A B1  A Bp
⎞ mu kB
2p  2
⎝ ⎠
( ) 2
T 2 (r - p)
3

 c Bi!
G  G (T ) k BT N r- 1
´ G C1  G Cr (T ) Bi
e-Q < sv>C1, C2,  , Cr . (B9)
B1 Bp  c Ci! a
Ci

From Equation (B9), the determination of the quantities Jni and Q becomes essential in the goal of computing the reverse rates. In
REACLIB, each rate Nan - 1 ásvñn1, n2  , nn is represented by seven parameters described in Equation (4). After setting each partition
function by Gni (T ) = 1 in Equation (B9), replacing Equation (4), and taking the logarithm on both sides, we may rewrite
Equation (B9) as Equation (13), where Nap - 1 ásvñB1, B2  , Bp ¢ should satisfy fit (4) with the set a0,rev, L ,a6,rev of reverse coefficients
described in Rauscher et al. (1997), but generalized for r reactants and p products as


⎪ (2JC1 + 1)  (2JCr + 1) ⎛ AC1  ACr ⎞
3 2  c Bi ! ⎫

Bi
a 0,rev = log F + a0 (B10a)

⎜ ⎟
⎨ (2JB1 + 1)  (2JBp + 1) A B1  A Bp cC i ! ⎬
⎪ ⎝ ⎠ ⎪
⎩ Ci ⎭
a1,rev = a1 - Q (109 K · k B) (B10b)

a 2,rev = a 2 (B10c)

a3,rev = a3 (B10d)

a4,rev = a4 (B10e)

a 5,rev = a 5 (B10f)
3
a 6,rev = a 6 + (r - p ) , (B10g)
2

20
The Astrophysical Journal, 947:65 (24pp), 2023 April 20 Smith et al.

with F defined by

r- p 3 (r - p )
3 (r - p ) 1 ⎛ mu k B ⎞
2
F=⎛ ⎞ T 2 (r - p).
3
T92 ⎜ ⎟ (B12)
N
⎝ a⎠ ⎝ 2p  2 ⎠
Case μC ≠ 0: In this case, the rates are screened, and due to μC ≠ 0, we have to incorporate the screening interactions in the detailed
balance calculations. We may find an example of these calculations in Seitenzahl et al. (2009) and Calder et al. (2007). From
Equations (B9) and (B5),

1 r - p (2JC1 + 1)  (2JCr + 1) AC1  ACr


3 2 3 (r - p )
Nap - 1 < sv>sc
B1, B2,  , Bp = ( )Na

(2JB1 + 1)  (2JBp + 1) A B1  A Bp


mu kB
2p  2

( ) 2
T 2 (r - p)
3

 c Bi!
G C1  G Cr (T )
´ Bi
e-Q kBT
G B1  G Bp (T )  c Ci!
Ci

r p
´ exp ⎡ C ⎞ ⎤ r- 1
⎢ - k B T ⎜å mCi - å m Bi ⎟ ⎥ Na < sv>C1, C2,  , Cr .
1 ⎛ C sc
(B13)
⎣ ⎝i = 1 i=1 ⎠⎦
This equation will become essential for the discussion in the next appendix.

Appendix C
Electron Screening: Theoretical Considerations
The Coulomb screening enhancement factors (16) and (19) of a reaction can be decomposed as the product of the enhancement
factors of the intermediate reactions. Similarly, from Equation (B13) we can assert that the enhancement factor of an inverse detailed
balance reaction replaces the reactants by the products in Equation (19). Let us explore these interesting features of the factor (19).
From the chain of rates

C1 + C2+  + Cr  [C1 + C2+  + Cr - 1] + Cr  B1 + B2 +  + Bp, (C1)

where the brackets denote a composite nucleus obtained as a result of the r − 1 original C1, C2, L Cr−1 nucleus collisions, we have

fC1 Cr - 1 f[C1+  + Cr - 1], Cr = e[m C1) +  + mC (Z Cr - 1) - mC (Z C1+  Z Cr - 1)] k B T


C (Z

´ e[m (Z C1+  + Z Cr - 1) + m (Z Cr ) - m (Z C1+  Z Cr )]


C C C kBT

=e[m (Z C1) +  + m (Z Cr ) - m (Z C1+  Z Cr )] k B T


C C C

=fC1 Cr . (C2)

Therefore, independent of the number of reactants, each rate can be screened in sequences of pairs until all the remaining reactants
are exhausted. Using this property, screening factors of reactions like the triple-α chain,

a + a + a  8Be + a  12C, (C3)


may be computed in two steps: first we compute fαα and f8Be, a , and then we multiply them to obtain the original rate fααα screening
factor.
The quantities miC required to compute the screening factors are also required to perform the NSE state calculations of the network,
as shown in Equation (22). Therefore, the electron screening not only enhances the reaction network convergence but also modifies
its NSE state. Similarly, according to the extra term μC from Equation (A9), the reverse reactions are also modified by the screening
effects into Equation (B13), altering the performance of the network convergence (Kushnir et al. 2019). Let us examine how the
detailed balance calculations (B9) are modified by the inclusion of μC in Equation (B13), where

⎛ ⎞
⎜å m Ci - m C1+ C2 +  + Cr ⎟
C C
kBT
Nar - 1 < sv>Csc1, C2,  , Cr = Nar - 1 < sv>Cno1,-
C2,  , Cr ´ e ⎝ i
sc C ⎠ (C4)

21
The Astrophysical Journal, 947:65 (24pp), 2023 April 20 Smith et al.

is the forward screened rate expressed in terms of the forward unscreened rate by Equation (19). Substituting this into
Equation (B13),

1 r - p (2JC1 + 1)  (2JCr + 1) AC1  ACr


3 2 3 (r - p )
Nap - 1 < sv>sc
B1, B2,  , Bp = ( )
Na

(2JB1 + 1)  (2JBp + 1) A B1  A Bp

⎞ mu kB
2p  2

( ) 2
T 2 (r - p)
3

 c Bi!
G  G (T ) k BT N r- 1
´ G C1  G Cr (T ) Bi
e-Q < sv>Cno1,- sc
C2,  , Cr
B1 Bp  c Ci! a
Ci

⎛ ⎞ ⎛ ⎞
⎜å m Ci - m C1+ C2 +  + Cr ⎟ k B T ⎜- å m CC + å m CB ⎟
C C
kBT
´ e⎝ Ci
i i
⎠ e⎝ Ci Bi ⎠ , (C5)

and from the conservation of charge ZC1+  +ZCr = Z B1+  +Z Bp ,

mCC1+  + Cr = m CB1+  + Bp , (C6)

we can write, from Equations (C5) and (C6) and by identifying Nap - 1 á svñno - sc
B1, B2,  , Bp from Equation (B9),

⎛ ⎞ ⎛ ⎞
⎜å m Ci - m C1+ C2 +  + Cr ⎟ k B T ⎜- å m CC + å m CB ⎟
C C
kBT
Nap - 1 < sv>sc
B1, B2,  , Bp = Na
p-1
< sv>no - sc
B1, B2,  , Bp ´ e ⎝ i
i i
C ⎠ e⎝ Ci Bi ⎠

⎛ ⎞
⎜å m Bi - m B1+ B 2 +  + Br ⎟
C C
kBT
=Nap - 1 < sv>no - sc
B1, B2,  , Bp ´ e ⎝ i
B ⎠

=Nap - 1 < sv>no - sc


B1, B2,  , Bp ´ fB1 Bp , (C7)

where fB1 Bp is the screening factor of the reverse reaction rate. This is a very powerful result because each rate, independent of its
forward/inverse nature, may be computed by using its reactants/products, respectively. Therefore, in order to implement screening
in detailed balanced reverse rates, we need to just consider the reversed rate in the definition of the enhancement factor (19), leaving
the unscreened detailed balance calculations unchanged.

Appendix D
Computing the NSE State
The NSE state of a network describes a unique composition in which each nucleus’s set of protons and neutrons are in equilibrium
if the protons and neutrons that assemble the nuclei were free, given a set of thermodynamic state variables and electron fraction (see,
e.g., Kushnir & Katz 2020). In this state, the energy required to assemble the ith nuclei is just the energy required to set up Zi free
protons and Ni free neutrons (Clifford & Tayler 1965). This condition is given by
mi = Zi mp + Ni mn. (D1)
Using Equation (A9),

miid + mi c2 + miC = Zi (midp + m p c2 + mCp ) + Ni (mid


n + m n c + mn ) ,
2 C
(D2)

or equivalently, after setting mCn = 0, because neutrons are not charged, and introducing the binding energy of the ith nuclei,

Qi = (Zi m p + Ni m n - mi ) c2 , (D3)
we can write

miid = Zi midp + Ni mnid + Qi - miC + Zi mCp. (D4)

From Equations (D4) and (A10), and using the nucleon fraction Xi definition ni = ρXi/mi, we may finally compute Equation (22).

Appendix E
The subch_approx Network
The subch_approx network is designed to model explosive helium and carbon burning, containing the nuclei in the standard
aprox13 network, as well as other nuclei and pathways identified in Shen & Bildsten (2009) for bypassing the 12C(α, γ)16O rate.
The original version of this network appeared in Zingale et al. (2022). This approximate version approximates some of the (α, p)(p,

22
The Astrophysical Journal, 947:65 (24pp), 2023 April 20 Smith et al.

γ) rates, as described in Section 4. It also modifies rates, as described in that same section, to change the endpoints, assuming fast
neutron captures. It is generated as follows:

This network is visualized in Figure 16.

Figure 16. The subch_approx network.

ORCID iDs References


Alexander I. Smith https://orcid.org/0000-0001-5961-1680
Aikawa, M., Arnould, M., Goriely, S., Jorissen, A., & Takahashi, K. 2005,
Eric T. Johnson https://orcid.org/0000-0003-3603-6868 A&A, 441, 1195
Zhi Chen https://orcid.org/0000-0002-2839-107X Almgren, A., Sazo, M. B., Bell, J., et al. 2020, JOSS, 5, 2513
Kiran Eiden https://orcid.org/0000-0001-6191-4285 AMReX-Astro Microphysics Development Team, Bishop, A., Fields, C. E.,
et al. 2022, AMReX-Astro/Microphysics: Release 22.10, Zenodo, doi:10.
Donald E. Willcox https://orcid.org/0000-0003-2300-5165 5281/zenodo.7133136
Brendan Boyd https://orcid.org/0000-0002-5419-9751 Angulo, C., Arnould, M., Rayet, M., et al. 1999, NuPhA, 656, 3
Lyra Cao https://orcid.org/0000-0002-8849-9816 Arnett, D. 1996, Supernovae and Nucleosynthesis: An Investigation of the
History of Matter from the Big Bang to the Present (Princeton, NJ: Princeton
Christopher J. DeGrendele https://orcid.org/0000-0002-
Univ. Press)
7815-1496 Brown, P. N., Byrne, G. D., & Hindmarsh, A. C. 1989, SJSC, 10, 1038
Michael Zingale https://orcid.org/0000-0001-8401-030X Calder, A. C., Townsley, D. M., Seitenzahl, I. R., et al. 2007, ApJ, 656, 313

23
The Astrophysical Journal, 947:65 (24pp), 2023 April 20 Smith et al.

Calder, A. C., Willcox, D. E., DeGrendele, C. J., et al. 2019, JPhCS, 1225, Ma, H., Woosley, S. E., Malone, C. M., Almgren, A., & Bell, J. 2013, ApJ,
012002 771, 58
Caughlan, G. R., & Fowler, W. A. 1988, ADNDT, 40, 283 Mestas, P. O., Clayton, P., & Niemeyer, K. E. 2019, JOSS, 4, 1543
Chabrier, G., & Potekhin, A. Y. 1998, PhRvE, 58, 4941 Meurer, A., Smith, C. P., Paprocki, M., et al. 2017, PeerJ Comput. Sci., 3, e103
Chamulak, D. A., Brown, E. F., Timmes, F. X., & Dupczak, K. 2008, ApJ, Meyer, B. S. 2018, in AIP Conf. Ser. 1947, 14th Int. Symp. Origin of Matter
677, 160 and Evolution of Galaxies (OMEG 2017) (Melville, NY: AIP), 020016
Chugunov, A. I. 2021, JPhCS, 1787, 012047 More, J. J., Garbow, B. S., & Hillstrom, K. E. 1980, User guide for
Chugunov, A. I., & DeWitt, H. E. 2009, PhRvC, 80, 014611 MINPACK-1. [In FORTRAN], ANL-80-74
Chugunov, A. I., DeWitt, H. E., & Yakovlev, D. G. 2007, PhRvD, 76, 025028 Müller, E. 1986, A&A, 162, 103
Clayton, D. D. 1968, Principles of Stellar Evolution and Nucleosynthesis (New Niemeyer, K. E., & Sung, C.-J. 2011, CoFl, 158, 1439
York: McGraw-Hill) Oliphant, T. E. 2007, CSE, 9, 10
Clifford, F. E., & Tayler, R. J. 1965, MNRAS, 129, 104 Pepiot-Desjardins, P., & Pitsch, H. 2008, CoFl, 154, 67
Cyburt, R. H., Amthor, A. M., Ferguson, R., et al. 2010, ApJS, 189, 240 Powell, M. J. D. 1964, CompJ, 7, 155
Dewitt, H. E., Graboske, H. C., & Cooper, M. S. 1973, ApJ, 181, 439 Powell, M. J. D. 1970, in Numerical Methods for Nonlinear Algebraic
Fan, D., Nonaka, A., Almgren, A. S., Harpole, A., & Zingale, M. 2019, ApJ, Equations, ed. P. Rabinowitz (London: Gordon and Breach)
887, 212 Rauscher, T. 2003, ApJS, 147, 403
Fan, D., Willcox, D. E., DeGrendele, C., Zingale, M., & Nonaka, A. 2022, Rauscher, T., Thielemann, F.-K., & Kratz, K.-L. 1997, PhRvC, 56, 1613
ApJ, 940, 134 Sallaska, A. L., Iliadis, C., Champange, A. E., et al. 2013, ApJS, 207, 18
Fowler, W. A., Caughlan, G. R., & Zimmerman, B. A. 1967, ARA&A, 5, 525 Schatz, H., Becerril Reyes, A. D., Best, A., et al. 2022, JPhG, 49, 110502
Fuller, G. M., Fowler, W. A., & Newman, M. J. 1985, ApJ, 293, 1 Seitenzahl, I. R., Röpke, F. K., Fink, M., & Pakmor, R. 2010, MNRAS,
Hagberg, A. A., Schult, D. A., & Swart, P. J 2008, in Proceedings of the 7th 407, 2297
Python in Science Conf., ed. G. Varoquaux, T. Vaught, & J Millman, 11, Seitenzahl, I. R., Timmes, F. X., Marin-Laflèche, A., et al. 2008, ApJL,
https://conference.scipy.org/proceedings/scipy2008/SciPy2008_ 685, L129
proceedings.pdf Seitenzahl, I. R., Townsley, D. M., Peng, F., & Truran, J. W. 2009, ADNDT,
Hill, T. L. 1960, An Introduction to Statistical Thermodynamics (Reading, 95, 96
MA: Addison-Wesley) Shampine, L. F., & Reichelt, M. W. 1997, SJSC, 18, 1
Hix, W. R., & Meyer, B. S. 2006, NuPhA, 777, 188 Shen, K. J., & Bildsten, L. 2009, ApJ, 699, 1365
Huang, W., Wang, M., Kondev, F., Audi, G., & Naimi, S. 2021, ChPhC, 45, Sun, W., Chen, Z., Gou, X., & Ju, Y. 2010, CoFl, 157, 1298
030002 Suzuki, T., Toki, H., & Nomoto, K. 2016, ApJ, 817, 163
Hunter, J. D. 2007, CSE, 9, 90 Timmes, F. X. 1999, ApJS, 124, 241
Katz, M. P., Almgren, A., Sazo, M. B., et al. 2020, in Proc. Int. Conf. High Timmes, F. X., Hoffman, R. D., & Woosley, S. E. 2000, ApJS, 129, 377
Performance Computing, Networking, Storage and Analysis, SC '20 van der Walt, S., Colbert, S. C., & Varoquaux, G. 2011, CSE, 13, 22
(Piscataway, NJ: IEEE), https://dl.acm.org/doi/abs/10.5555/3433701. Wallace, R. K., & Woosley, S. E. 1981, ApJS, 45, 389
3433822 Wallace, R. K., Woosley, S. E., & Weaver, T. A. 1982, ApJ, 258, 696
Kluyver, T., Ragan-Kelley, B., Pérez, F., et al. 2016, in Positioning and Power Wang, M., Huang, W., Kondev, F., Audi, G., & Naimi, S. 2021, ChPhC, 45,
in Academic Publishing: Players, Agents and Agendas, ed. F. Loizides & 030003
B. Schmidt (Amsterdam: IOS Press), 87 Weaver, T. A., Zimmerman, G. B., & Woosley, S. E. 1978, ApJ, 225, 1021
Krekel, H., Oliveira, B., Pfannschmidt, R., et al. 2004, pytest 7.0, GitHub, Willcox, D. E., & Zingale, M. 2018, JOSS, 3, 588
https://github.com/pytest-dev/pytest Xu, Y., Goriely, S., Jorissen, A., Chen, G. L., & Arnould, M. 2013, A&A,
Kushnir, D., & Katz, B. 2020, MNRAS, 493, 5413 549, A106
Kushnir, D., Waxman, E., & Chugunov, A. I. 2019, MNRAS, 486, 449 Zhang, W., Almgren, A., Beckner, V., et al. 2019, JOSS, 4, 1370
Lam, S. K., Pitrou, A., & Seibert, S. 2015, in Proc. Second Workshop on the Zhu, L., Ma, Y.-G., Chen, Q., & Han, D.-D. 2016, NatSR, 6, 31882
LLVM Compiler Infrastructure in HPC, 1 Zingale, M., Almgren, A. S., Sazo, M. G. B., et al. 2018, JPhCS, 1031,
Langanke, K., & Martínez-Pinedo, G. 2000, NuPhA, 673, 481 012024
Lippuner, J., & Roberts, L. F. 2017, ApJS, 233, 18 Zingale, M., Katz, M. P., Bell, J. B., et al. 2019, ApJ, 886, 105
Longland, R., Martin, D., & José, J. 2014, A&A, 563, A67 Zingale, M., Katz, M. P., Nonaka, A., & Rasmussen, M. 2022, ApJ, 936, 6

24

You might also like