pleiades.nuclear.models module

Core physical quantity models with validation.

class pleiades.nuclear.models.DataRetrievalMethod(value)[source]

Bases: str, Enum

Enumeration of methods to retrieve nuclear data.

DIRECT = 'DIRECT'
API = 'API'
class pleiades.nuclear.models.EndfLibrary(value)[source]

Bases: str, Enum

Enumeration of ENDF library versions.

ENDF_B_VIII_1 = 'ENDF-B-VIII.1'
ENDF_B_VIII_0 = 'ENDF-B-VIII.0'
JEFF_3_3 = 'JEFF-3.3'
JENDL_5 = 'JENDL-5'
CENDL_3_2 = 'CENDL-3.2'
TENDL_2021 = 'TENDL-2021'
class pleiades.nuclear.models.EndfFilenamePattern(value)[source]

Bases: str, Enum

Filename patterns for different ENDF libraries.

MAT_FIRST = 'n_{mat}_{z_nozero}-{element}-{a}.zip'
ELEMENT_FIRST = 'n_{z}-{element}-{a}_{mat}.zip'
class pleiades.nuclear.models.ParticlePair(*, name: str = 'n+', name_a: str = 'neutron', name_b: str = 'UNK-000', parity_a: int = 1, parity_b: int = 1, charge_a: int = 0, charge_b: int = 0, mass_a: float = 1.00866491578, mass_b: float = 0.0, spin_a: float = 0.5, spin_b: float = 0.0, calculate_penetrabilities: bool = False, calculate_shifts: bool = False, q_value: float | None = None, threshold: float | None = None)[source]

Bases: BaseModel

Container for information about a pair of particles used in nuclear calculations. .. attribute:: name

Name of the particle pair (e.g., ‘n+U235’ for neutron + Uranium-235).

type:

str

name_a

Name of particle A (e.g., ‘neutron’).

Type:

str

name_b

Name of particle B (e.g., ‘U-238’).

Type:

str

parity_a

Parity of particle A; relevant if spin is zero and parity is negative.

Type:

int

parity_b

Parity of particle B; relevant if spin is zero and parity is negative.

Type:

int

charge_a

Atomic number of particle A (e.g., 0 for neutron).

Type:

int

charge_b

Atomic number of particle B (e.g., 92 for Uranium).

Type:

int

mass_a

Mass of particle A in atomic mass units (default is neutron mass).

Type:

float

mass_b

Mass of particle B in atomic mass units.

Type:

float

spin_a

Spin of particle A (default is 0.5 for neutron).

Type:

float

spin_b

Spin of particle B (default is 0 for Uranium-238).

Type:

float

calculate_penetrabilities

Whether to calculate penetrabilities for nuclear reactions.

Type:

bool

calculate_shifts

Whether to calculate shifts for nuclear reactions.

Type:

bool

effective_radius

Effective radius for channels of this particle pair (in fermi).

Type:

float

true_radius

True radius for channels of this particle pair (in fermi).

Type:

float

name: str
name_a: str
name_b: str
parity_a: int
parity_b: int
charge_a: int
charge_b: int
mass_a: float
mass_b: float
spin_a: float
spin_b: float
calculate_penetrabilities: bool
calculate_shifts: bool
q_value: float | None
threshold: float | None
__str__()[source]

Print the particle pair information in a formatted table.

validate_q_or_threshold() ParticlePair[source]

Validate that both q_value and threshold are not set at the same time.

Returns:

Self if validation passes

Return type:

ParticlePair

Raises:

ValueError – If both q_value and threshold are set

model_config = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pleiades.nuclear.models.SpinGroupChannelInfo(*, channel_number: int, particle_pair_name: str, exclude_channel: int, orbital_angular_momentum: int | None = None, channel_spin: float | None = None, boundary_condition: str | None = None, effective_radius: float | None = None, true_radius: float | None = None)[source]

Bases: BaseModel

Container for channel information within a given spin group.

Mainly used in SpinGroups to store information about each channel.

channel_number

Channel number associated with this spin group

Type:

int

particle_pair_name

Name of the particle pair (e.g., ‘n+U235’). Should match ParticlePair.name

Type:

str

exclude_channel

Whether to exclude this channel from calculations (1: exclude, 0: include)

Type:

int

orbital_angular_momentum

Orbital angular momentum of the channel (default is None)

Type:

Optional[int]

channel_spin

Spin of the channel (default is None)

Type:

Optional[float]

boundary_condition

Boundary condition for the channel (default is None)

Type:

Optional[str]

effective_radius

Effective radius for the channel (in fermi, default is None)

Type:

Optional[float]

true_radius

True radius for the channel (in fermi, default is None)

Type:

Optional[float]

channel_number: int
particle_pair_name: str
exclude_channel: int
orbital_angular_momentum: int | None
channel_spin: float | None
boundary_condition: str | None
effective_radius: float | None
true_radius: float | None
model_config = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pleiades.nuclear.models.SpinGroups(*, spin_group_number: int = 0, excluded: bool = False, number_of_entry_channels: int = 0, number_of_exit_channels: int = 0, spin: float = 0.0, abundance: float = 0.0, ground_state_spin: float = 0.0, channel_info: List[SpinGroupChannelInfo] = <factory>)[source]

Bases: BaseModel

Container for all the needed information on a given spin group.

spin_group_number

Spin group number

Type:

int

excluded

Whether the spin group is excluded from calculations

Type:

bool

number_of_entry_channels

Number of entry channels for this spin group

Type:

int

number_of_exit_channels

Number of exit channels for this spin group

Type:

int

spin

Spin of the spin group (integer or half-integer). Positive of even parity, negative of odd parity.

Type:

float

Abundance

Abundance of the spin group (dimensionless)

Type:

float

ground_state_spin

Ground state spin of the spin group (integer or half-integer)

Type:

float

channel_info

List of channel information for the spin group.

Type:

List[SpinGroupChannelInfo]

spin_group_number: int
excluded: bool
number_of_entry_channels: int
number_of_exit_channels: int
spin: float
abundance: float
ground_state_spin: float
channel_info: List[SpinGroupChannelInfo]
model_config = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pleiades.nuclear.models.SpinGroupChannels(*, group_number: Annotated[int, Gt(gt=0)], channels: List[int])[source]

Bases: BaseModel

Container for a spin group and its associated channels.

This class represents the mapping between a spin group number and the list of channels that belong to that group.

group_number

The spin group number (must be positive)

Type:

int

channels

List of channel numbers for this spin group

Type:

List[int]

group_number: int
channels: List[int]
classmethod validate_channels(v: List[int]) List[int][source]

Validate channel numbers.

Parameters:

v – List of channel numbers

Returns:

Validated channel numbers

Return type:

List[int]

Raises:

ValueError – If any channel number is invalid

__str__() str[source]

Return a string representation of the spin group and channels.

model_config = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pleiades.nuclear.models.RadiusParameters(*, effective_radius: Annotated[float | None, Ge(ge=0)] = None, true_radius: float | None = None, channel_mode: Annotated[int | None, Ge(ge=0), Le(le=1)] = None, vary_effective: VaryFlag | None = None, vary_true: VaryFlag | None = None, spin_groups: List[SpinGroupChannels] | None = None, channels: List[int] | None = None)[source]

Bases: BaseModel

Container for nuclear radius parameters of isotopes used in SAMMY calculations.

This class represents a set of radius parameters that define both the potential scattering radius and the radius used for penetrabilities and shift calculations. These parameters can be applied globally or to specific spin groups and channels.

effective_radius

The radius (in Fermi) used for potential scattering calculations.

Type:

float

true_radius

The radius (in Fermi) used for penetrabilities and shift calculations. Special values: - If 0: Uses the CRFN value from input file/card set 4 - If negative: Absolute value represents mass ratio to neutron (AWRI),

radius calculated as 1.23(AWRI)^1/3 + 0.8 (ENDF formula)

Type:

float

channel_mode

Determines how channels are specified: - 0: Parameters apply to all channels - 1: Parameters apply only to specified channels in channels list

Type:

int

vary_effective

Flag indicating how effective radius should be treated: - NO (0): Parameter is held fixed - YES (1): Parameter is varied in fitting - PUP (3): Parameter is treated as a propagated uncertainty parameter

Type:

VaryFlag

vary_true

Flag indicating how true radius should be treated: - USE_FROM_EFFECTIVE (-1): Treated as identical to effective_radius - NO (0): Parameter is held fixed - YES (1): Parameter is varied independently - PUP (3): Parameter is treated as a propagated uncertainty parameter

Type:

VaryFlag

spin_groups

List of spin group and channel mappings that use these radius parameters. Each entry contains a group number and its associated channels. Group numbers > 500 indicate omitted resonances.

Type:

List[SpinGroupChannels]

channels

List of channel numbers when channel_mode=1. When channel_mode=0, this should be None.

Type:

Optional[List[int]]

Note

This class supports the three different input formats specified in SAMMY: - Default format (card set 7) for <99 spin groups - Alternate format for >99 spin groups - Keyword-based format However, internally it maintains a consistent representation regardless of input format.

effective_radius: float | None
true_radius: float | None
channel_mode: int | None
vary_effective: VaryFlag | None
vary_true: VaryFlag | None
spin_groups: List[SpinGroupChannels] | None
channels: List[int] | None
classmethod validate_spin_groups(v: List[SpinGroupChannels] | None) List[SpinGroupChannels] | None[source]

Validate spin groups and their channels.

Parameters:

v – List of SpinGroupChannels objects

Returns:

Validated spin groups

Return type:

Optional[List[SpinGroupChannels]]

Raises:

ValueError – If any spin group or channel data is invalid

classmethod validate_vary_true(v: VaryFlag) VaryFlag[source]

Validate vary_true flag has valid values.

For true radius, we allow an additional special value -1 (USE_FROM_PARFILE)

Parameters:

v – Vary flag value

Returns:

Validated flag value

Return type:

VaryFlag

Raises:

ValueError – If flag value is invalid

validate_channels() RadiusParameters[source]

Validate channel specifications.

Ensures that: 1. If channel_mode=1, channels must be provided 2. If channel_mode=0, channels should be None

Returns:

Self if validation passes

Return type:

RadiusParameters

Raises:

ValueError – If channel specifications are invalid

validate_true_radius_consistency() RadiusParameters[source]

Validate consistency between true_radius and vary_true.

Ensures that: 1. If vary_true is USE_FROM_PARFILE, true_radius matches effective_radius 2. If true_radius is 0, vary_true cannot be USE_FROM_PARFILE 3. If true_radius is negative, it represents AWRI and vary_true cannot be USE_FROM_PARFILE

Returns:

Self if validation passes

Return type:

RadiusParameters

Raises:

ValueError – If radius specifications are inconsistent

__str__() str[source]

Return a text table representation of the RadiusParameters object with aligned columns.

model_config = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pleiades.nuclear.models.ResonanceEntry(*, resonance_energy: float, capture_width: float, channel1_width: float | None = None, channel2_width: float | None = None, channel3_width: float | None = None, vary_energy: VaryFlag = VaryFlag.NO, vary_capture_width: VaryFlag = VaryFlag.NO, vary_channel1: VaryFlag = VaryFlag.NO, vary_channel2: VaryFlag = VaryFlag.NO, vary_channel3: VaryFlag = VaryFlag.NO, igroup: int)[source]

Bases: BaseModel

This class handles the parameters for a single resonance entry.

resonance_energy

Resonance energy Eλ (eV)

Type:

float

capture_width

Capture width Γγ (milli-eV)

Type:

float

channel1_width

Particle width for channel 1 (milli-eV)

Type:

float | None

channel2_width

Particle width for channel 2 (milli-eV)

Type:

float | None

channel3_width

Particle width for channel 3 (milli-eV)

Type:

float | None

NOTE

If any particle width Γ is negative, SAMMY uses abs(Γ) for the width and set the associated amplitude γ to be negative.

vary_energy

Flag indicating if resonance energy is varied

Type:

pleiades.utils.helper.VaryFlag

vary_capture_width

Flag indicating if capture width is varied

Type:

pleiades.utils.helper.VaryFlag

vary_channel1

Flag indicating if channel 1 width is varied

Type:

pleiades.utils.helper.VaryFlag

vary_channel2

Flag indicating if channel 2 width is varied

Type:

pleiades.utils.helper.VaryFlag

vary_channel3

Flag indicating if channel 3 width is varied

Type:

pleiades.utils.helper.VaryFlag

NOTE

0 = no, 1 = yes, 3 = PUP (PUP = Partially Unknown Parameter)

igroup

Quantum numbers group number (or spin_groups)

Type:

int

NOTE

If IGROUP is negative or greater than 50, this resonance will be omitted from the calculation.

x_value

Special value used to detect multi-line entries (unsupported)

resonance_energy: float
capture_width: float
channel1_width: float | None
channel2_width: float | None
channel3_width: float | None
vary_energy: VaryFlag
vary_capture_width: VaryFlag
vary_channel1: VaryFlag
vary_channel2: VaryFlag
vary_channel3: VaryFlag
igroup: int
model_config = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pleiades.nuclear.models.IsotopeParameters(*, particle_pairs: List[ParticlePair] | None = <factory>, isotope_information: IsotopeInfo | None = None, abundance: float | None = None, uncertainty: float | None = None, vary_abundance: VaryFlag | None = None, endf_library: EndfLibrary | None = EndfLibrary.ENDF_B_VIII_0, spin_groups: List[SpinGroups] | None = <factory>, resonances: List[ResonanceEntry] | None = <factory>, radius_parameters: List[RadiusParameters] | None = <factory>)[source]

Bases: BaseModel

Container for a single isotope’s parameters which include.

mass, abundance, uncertainty, treatment flag, and associated

spin groups.

IsotopeInformation

Information about the isotope

Type:

Optional[IsotopeInfo]

abundance

Fractional abundance (dimensionless)

Type:

float

uncertainty

Uncertainty on abundance (dimensionless)

Type:

Optional[float]

flag

Treatment flag for abundance (-2=use input, 0=fixed, 1=vary, 3=PUP)

Type:

VaryFlag

spin_groups

List of spin group numbers (negative values indicate omitted resonances)

Type:

List[int]

resonances

List of resonance entries

Type:

List[ResonanceEntry]

radius_parameters

List of radius parameters

Type:

List[RadiusParameters]

particle_pairs: List[ParticlePair] | None
isotope_information: IsotopeInfo | None
abundance: float | None
uncertainty: float | None
vary_abundance: VaryFlag | None
endf_library: EndfLibrary | None
spin_groups: List[SpinGroups] | None
resonances: List[ResonanceEntry] | None
radius_parameters: List[RadiusParameters] | None
validate_groups() IsotopeParameters[source]

Validate spin group constraints.

Validates: - Group numbers are non-zero - Negative groups only used to indicate omitted resonances - Group numbers are within valid range for format

Returns:

Self if validation passes

Return type:

IsotopeParameters

Raises:

ValueError – If spin group validation fails

validate_resonances() IsotopeParameters[source]

Validate that resonance igroups match spin groups.

Validates: - Each resonance igroup is in the list of spin groups

Returns:

Self if validation passes

Return type:

IsotopeParameters

Raises:

ValueError – If resonance igroup validation fails

validate_radius_parameters() IsotopeParameters[source]

Validate that radius parameter spin groups match isotope spin groups.

Validates: - Each spin group in radius parameters is in the list of isotope spin groups

Returns:

Self if validation passes

Return type:

IsotopeParameters

Raises:

ValueError – If radius parameter spin group validation fails

print_resonances() str[source]

Print the resonance entries in a formatted table.

append_particle_pair(particle_pair: ParticlePair)[source]

Append a particle pair to the list of particle pairs, if no particle pairs exist then create a new list. This method is used to add a new particle pair to the isotope parameters.

Parameters:

particle_pair (ParticlePair) – The particle pair to append

append_spin_group(spin_group: SpinGroups)[source]

Append a spin group to the list of spin groups, if no spin groups exist then create a new list. This method is used to add a new spin group to the isotope parameters.

Parameters:

spin_group (SpinGroups) – The spin group to append

__str__() str[source]

Return a text table representation of the IsotopeParameters object.

model_config = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pleiades.nuclear.models.nuclearParameters(*, particle: IsotopeInfo = IsotopeInfo(name='n', mass_number=1, element=None, atomic_number=1, mass_data=IsotopeMassData(atomic_mass=1.00866491578, mass_uncertainty=None, binding_energy=None, beta_decay_energy=None), abundance=None, spin=0.5, material_number=None), isotopes: List[IsotopeParameters] = <factory>)[source]

Bases: BaseModel

Container for nuclear parameters used in SAMMY calculations.

particle

Incoming particle information (default is a neutron)

Type:

IsotopeInfo

isotopes

List of isotope parameters

Type:

List[IsotopeParameters]

particle: IsotopeInfo
isotopes: List[IsotopeParameters]
validate_isotopes() nuclearParameters[source]

Validate isotope parameters.

Validates: - Each isotope has a unique mass - Each isotope has a unique abundance

append_isotope(isotope: IsotopeParameters)[source]

Append an isotope to the list of isotopes.

Parameters:

isotope (IsotopeParameters) – The isotope to append

model_config = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].