Package: oklo
OKLO: A toolkit for modeling nuclides and nuclear reactions===========================================================The OKLO package provides a set of convenient tools for modelingnuclides and the reactions between them.  It provides methods touniquely identify the known nuclides, define unique reactions whichallow transitions from one nuclide to another, associate arbitraryuser-specified data to these objects, and treat collections ofnuclides and reactions as a single network.While this package was initially designed for the purpose ofcalculating the flux of antineutrinos emitted by nuclear reactors, itis designed in a generic fashion for a broad range of applications(e.g. solar physics, supernova physics, etc.).Installation:=============Installion is most convenient via the pip utility:::$ pip install okloDescription:============Here follows a brief description of the core tools provided by theOKLO package.Nuclide:--------A nuclide is a unique nuclear state identified by the number ofprotons and number of neutrons in the nucleus, as well as an optionalmetastable isomeric energy level.  Each nuclide serves as a data'whiteboard'.  Users can associate arbitrary data with a nuclide usinga standard (key, value) approach.::>>> from oklo.core.ids import NuclideId>>> from oklo.core.nuclide import Nuclide>>> C_12_id = NuclideId(Z=6,A=12,M=0)      # Create unique ID for Carbon-12>>> C_12 = Nuclide(nucl_id=C_12_id)        # Create nuclide object>>> C_12.Z6>>> C_12.A12>>> C_12.M0>>> C_12.N6>>> C_12.name'Carbon_12'>>> C_12.element_name'Carbon'>>> C_12.element_abbrev'C'>>> C_12['current_abundance'] = 0.8   # Associate user-defined data>>> C_12['current_abundance']0.8Reaction:---------A reaction is a unique type of nuclear transition between nuclides,such as the beta decay of 12B to 12C.  Each reaction serves as a data'whiteboard'.  Users can associate arbitrary data with a reactionusing a standard (key, value) approach.::>>> from oklo.core.ids import NuclideId, ReactionId>>> from oklo.core.defs import ReactionType>>> from oklo.core.reaction import Reaction>>> B_12_beta_decay_id = ReactionId(init_nucl_id=NuclideId('Boron_12'), \reac_type=ReactionType.BetaDecay)>>> B_12_beta_decay = Reaction(reac_id=B_12_beta_decay_id)>>> B_12_beta_decay.initial_nuclide_id.nameBoron_12>>> B_12_beta_decay.final_nuclide_id.nameCarbon_12>>> from oklo.core.units import Hz>>> B_12_beta_decay['current_rate'] = 1.0 * Hz>>> B_12_beta_decay['current_rate'] / Hz1.0ReactionNetwork:----------------A ReactionNetwork is a collection of nuclides and reactions relatingthese nuclides.  This class serves as a standard entry point forcalculation of quantities of interest.  For example, users can iterateover the nuclides and reactions within the network to calculate totalquantities for the network.This class is effectively a 'graph' data structure in computer sciencelingo, where a set of nodes (nuclides) are connected by a set of links(reactions).Physical Models (NuclideModel and ReactionModel):-------------------------------------------------A physical model is a user-defined class which defines rules forautomating the addition of user-specified data to the whiteboardsNuclides or Reactions.  For example, you could specify the relativeabundance of each nuclide present within the sun according to yourpreferred physical model.Users should define their own physical model class which inherits fromeither NuclideModel or ReactionModel base classes, and implements a'process(nuclide)' or 'process(reaction)' function which adds theappropriate data to the whiteboard based on the unique nuclide orreaction ID.Factories (NuclideFactory and ReactionFactory):-----------------------------------------------Factories provide a convenient method to populate a ReactionNetworkgiven one or a set of physical models.Examples:=========For a more advance example, demonstrating the use of models andfactories, execute the following::$ python -i oklo/examples/antineutrino_spectrum_endf.pyThis builds a reaction network for modeling a nominal commercial PWRreactor.  The network is populated with tabulated nuclear data oncumulative fission yields and beta decay spectra.  The network is thenused to estimate the average antineutrino energy spectrum emitted perfission in the reactor.If matplotlib is installed, then associated figures will also begenerated.