montepy.Nuclide#

class montepy.Nuclide(name: str | int | Element | Nucleus = '', element: Element = None, Z: int = None, A: int = 0, meta_state: int = 0, library: str = '', node: ValueNode = None)#

Bases: object

A class to represent an MCNP nuclide with nuclear data library information.

Nuclide accepts name as a way of specifying a nuclide. This is meant to be more ergonomic than ZAIDs while not going insane with possible formats. This accepts ZAID and Atomic_symbol-A format. All cases support metastables as m# and a library specification. Examples include:

  • 1001.80c

  • 92235m1.80c

  • 92635.80c

  • U.80c

  • U-235.80c

  • U-235m1.80c

To be specific this must match the regular expression:

import re
parser = re.compile(\"\"\"
    (\d{4,6}) # ZAID
        |
    ([a-z]{1,2} # or atomic symbol
    -?\d*) # optional A-number
    (m\d+)? # optional metastable
    (\.\d{{2,}}[a-z]+)? # optional library
    \"\"\",
    re.IGNORE_CASE | re.VERBOSE
)

Note

As discussed in MCNP 6.3.0 manual § 5.6.1:

To represent a metastable isotope, adjust the AAA value using the following convention: AAA’=(AAA+300)+(m × 100), where m is the metastable level and m=1, 2, 3, or 4.

MontePy attempts to apply these rules to determine the isomeric state of the nuclide. This requires MontePy to determine if a ZAID is a realistic base isomeric state.

This is done simply by manually specifying 6 rectangles of realistic ZAIDs. MontePy checks if a ZAID is inside of these rectangles. These rectangles are defined by their upper right corner as an isotope. The lower left corner is defined by the Z-number of the previous isotope and A=0.

These isotopes are:

  • Cl-52

  • Br-101

  • Xe-150

  • Os-203

  • Cm-251

  • Og-296

Warning

Due to legacy reasons the nuclear data for Am-242 and Am-242m1 have been swapped for the nuclear data provided by LANL. This is documented in section 1.2.2 of the MCNP 6.3.1 manual :

As a historical quirk, 242m1Am and 242Am are swapped in the ZAID and SZAID formats, so that the former is 95242 and the latter is 95642 for ZAID and 1095242 for SZAID. It is important to verify if a data library follows this convention. To date, all LANL-published libraries do. The name format does not swap these isomers. As such, Am-242m1 can load a table labeled 95242.

Due to this MontePy follows the MCNP convention, and swaps these ZAIDs. If you have custom generated ACE data for Am-242, that does not follow this convention you have a few options:

  1. Do nothing. If you do not need to modify a material in an MCNP input file the ZAID will be written out the same as it was in the original file.

  2. Specify the Nucleus by ZAID. This will have the same effect as before. Note that MontePy will display the wrong metastable state, but will preserve the ZAID.

  3. Open an issue. If this approach doesn’t work for you please open an issue so we can develop a better solution.

Added in version 1.0.0: This was added as replacement for montepy.data_inputs.Isotope.

Parameters:
  • name (str) – A fancy name way of specifying a nuclide.

  • ZAID (str) – The ZAID in MCNP format, the library can be included.

  • element (Element) – the element this Nucleus is based on.

  • Z (int) – The Z-number (atomic number) of the nuclide.

  • A (int) – The A-number (atomic mass) of the nuclide. If this is elemental this should be 0.

  • meta_state (int) – The metastable state if this nuclide is isomer.

  • library (str) – the library to use for this nuclide.

  • node (ValueNode) – The ValueNode to build this off of. Should only be used by MontePy.

Raises:
  • TypeError – if a parameter is the wrong type.

  • ValueError – if non-sensical values are given.

Methods:

get_base_zaid()

Get the ZAID identifier of the base isotope this is an isomer of.

mcnp_str()

Returns an MCNP formatted representation.

nuclide_str()

Creates a human readable version of this nuclide excluding the data library.

Attributes:

A

The A number for this isotope.

Z

The Z number for this isotope.

ZAID

The ZZZAAA identifier following MCNP convention

element

The base element for this isotope.

is_metastable

Whether or not this is a metastable isomer.

library

The MCNP library identifier e.g. 80c.

meta_state

If this is a metastable isomer, which state is it?

nucleus

The base nuclide of this nuclide without the nuclear data library.

get_base_zaid() int#

Get the ZAID identifier of the base isotope this is an isomer of.

This is mostly helpful for working with metastable isomers.

Returns:

the mcnp ZAID of the ground state of this isotope.

Return type:

int

mcnp_str() str#

Returns an MCNP formatted representation.

E.g., 1001.80c

Returns:

a string that can be used in MCNP

Return type:

str

nuclide_str() str#

Creates a human readable version of this nuclide excluding the data library.

This is of the form Atomic symbol - A [metastable state]. e.g., U-235m1.

Return type:

str

property A: int#

The A number for this isotope.

Returns:

the isotope’s mass.

Return type:

int

property Z: int#

The Z number for this isotope.

Returns:

the atomic number.

Return type:

int

property ZAID: int#

The ZZZAAA identifier following MCNP convention

Return type:

int

property element: Element#

The base element for this isotope.

Returns:

The element for this isotope.

Return type:

Element

property is_metastable: bool#

Whether or not this is a metastable isomer.

Returns:

boolean of if this is metastable.

Return type:

bool

property library: Library#

The MCNP library identifier e.g. 80c

Return type:

Library

property meta_state: int#

If this is a metastable isomer, which state is it?

Can return values in the range [0,4]. 0 corresponds to the ground state. The exact state number is decided by who made the ACE file for this, and not quantum mechanics. Convention states that the isomers should be numbered from lowest to highest energy.

Returns:

the metastable isomeric state of this “isotope” in the range [0,4]l

Return type:

int

property nucleus: Nucleus#

The base nuclide of this nuclide without the nuclear data library.

Return type:

Nucleus