Core package¶
The core page documents the package-level exports together with the utility modules that support kinematics and nuclear data, and shared helper functions.
Public package entry points for jitr.
Utilities¶
The jitr.utils package re-exports the most common helper modules and
functions. The defining modules are documented below so objects only
appear once in the API index.
Physical constants used throughout jitr.
Analytic and tabulated proton/neutron density utilities.
- class jitr.utils.density.DensityTable(A, Z, model, symbol, dr, radial_grid, proton_density_grid, neutron_density_grid)[source]¶
Bases:
objectTabulated proton and neutron densities for a single nuclide.
- Parameters:
A (
int) – Atomic mass number.Z (
int) – Atomic number.model (
str) – Density-model identifier.symbol (
str) – Chemical symbol used by the packaged table.dr (
float) – Nominal radial-grid spacing in fm.radial_grid (
ndarray[tuple[Any,...],dtype[double]]) – Tabulated radial grid in fm.proton_density_grid (
ndarray[tuple[Any,...],dtype[double]]) – Proton density sampled onradial_grid.neutron_density_grid (
ndarray[tuple[Any,...],dtype[double]]) – Neutron density sampled onradial_grid.
- class jitr.utils.density.TwoParameterFermiDensity(R, a, rho0=None, N=None)[source]¶
Bases:
objectCallable two-parameter Fermi density profile.
- Parameters:
- Raises:
ValueError – If neither
rho0norNis provided.
- jitr.utils.density.densities(A, Z, r, model='d1m')[source]¶
Return proton and neutron densities on the requested radial grid.
- jitr.utils.density.density_from_array(r_array, rho_array, clip_negative=True)[source]¶
Wrap a tabulated radial density as a callable interpolator.
- Parameters:
- Return type:
Callable[[float|TypeAliasType],ndarray[tuple[Any,...],dtype[double]]]- Returns:
A callable density interpolator that returns zero outside the tabulated range and exposes
r_maxas the maximum tabulated radius.- Raises:
ValueError – If the tabulated arrays have different shapes or the radial grid is not strictly increasing.
- jitr.utils.density.density_table(A, Z, model='d1m')[source]¶
Return the tabulated density table for a nuclide.
- Parameters:
- Return type:
- Returns:
The packaged density table for
(A, Z).- Raises:
KeyError – If no table exists for the requested nuclide/model.
- jitr.utils.density.density_targets(model='d1m', Z=None)[source]¶
Return the available nuclides for a density model.
- jitr.utils.density.init_density_db()[source]¶
Load the packaged density tables into memory if needed.
- Return type:
- jitr.utils.density.matter_density(A, Z, r, model='d1m')[source]¶
Return the total matter density on the requested radial grid.
- jitr.utils.density.neutron_density(A, Z, r, model='d1m')[source]¶
Return the neutron density on the requested radial grid.
- jitr.utils.density.proton_density(A, Z, r, model='d1m')[source]¶
Return the proton density on the requested radial grid.
- jitr.utils.density.two_parameter_fermi(r, R, a, rho0=None, N=None)[source]¶
Return a two-parameter Fermi density.
- Parameters:
r (
float|TypeAliasType) – Radial coordinate or coordinates in fm.R (
float) – Half-density radius in fm.a (
float) – Surface diffuseness in fm.rho0 (
float|None) – Central density normalization. Mutually exclusive withN.N (
float|None) – Integrated particle number used to normalize the profile.
- Return type:
- Returns:
Density values sampled at
r.- Raises:
ValueError – If neither
rho0norNis provided.
Free-particle and Coulomb asymptotic solutions.
- jitr.utils.free_solutions.Gamow_factor(l, eta)[source]¶
Return the Coulomb Gamow factor for angular momentum
l.
- class jitr.utils.free_solutions.FreeAsymptotics[source]¶
Bases:
objectSpherical-Bessel asymptotics for neutral-particle scattering.
- class jitr.utils.free_solutions.CoulombAsymptotics[source]¶
Bases:
objectCoulomb asymptotic functions evaluated through
mpmath.
- jitr.utils.free_solutions.H_plus(s, l, eta, asym=<class 'jitr.utils.free_solutions.CoulombAsymptotics'>)[source]¶
Return the outgoing Coulomb-Hankel function.
- jitr.utils.free_solutions.H_minus(s, l, eta, asym=<class 'jitr.utils.free_solutions.CoulombAsymptotics'>)[source]¶
Return the incoming Coulomb-Hankel function.
- jitr.utils.free_solutions.coulomb_func_deriv(func, s, l, eta)[source]¶
Differentiate Coulomb or Coulomb-Hankel functions using recurrence relations.
- jitr.utils.free_solutions.H_plus_prime(s, l, eta, asym=<class 'jitr.utils.free_solutions.CoulombAsymptotics'>)[source]¶
Return the derivative of the outgoing Coulomb-Hankel function.
- jitr.utils.free_solutions.H_minus_prime(s, l, eta, dx=1e-06, asym=<class 'jitr.utils.free_solutions.CoulombAsymptotics'>)[source]¶
Return the derivative of the incoming Coulomb-Hankel function.
Kinematic helpers for entrance, exit, and frame-conversion calculations.
- class jitr.utils.kinematics.ChannelKinematics(Elab, Ecm, mu, k, eta)[source]¶
Bases:
objectKinematic quantities for a single reaction channel.
- Variables:
Elab – Laboratory-frame kinetic energy in MeV.
Ecm – Center-of-mass kinetic energy in MeV.
mu – Reduced mass in MeV/c^2.
k – Center-of-mass wavenumber in fm^-1.
eta – Sommerfeld parameter.
- Parameters:
- jitr.utils.kinematics.semi_relativistic_kinematics(mass_target, mass_projectile, Elab, Zz=0)[source]¶
Compute semi-relativistic entrance-channel kinematics.
Uses the approximation from Ingemarsson (1974) for a projectile scattering from a fixed target.
- Parameters:
- Return type:
- Returns:
A populated
ChannelKinematicsinstance.
- jitr.utils.kinematics.classical_kinematics(mass_target, mass_projectile, Elab, Zz=0)[source]¶
Compute non-relativistic kinematics from a laboratory energy.
- Parameters:
- Return type:
- Returns:
A populated
ChannelKinematicsinstance.
- jitr.utils.kinematics.classical_kinematics_cm(mass_target, mass_projectile, Ecm, Zz=0)[source]¶
Compute non-relativistic kinematics from a center-of-mass energy.
- Parameters:
- Return type:
- Returns:
A populated
ChannelKinematicsinstance.
- jitr.utils.kinematics.cm_to_lab_frame(angles_cm_deg, ma, mb, mc, md, E, Q)[source]¶
Convert center-of-mass angles to laboratory angles.
- Parameters:
- Return type:
- Returns:
A NumPy array of laboratory-frame angles in degrees.
- jitr.utils.kinematics.lab_to_cm_frame(angles_lab_deg, ma, mb, mc, md, E, Q)[source]¶
Convert laboratory angles to center-of-mass angles.
- Parameters:
- Return type:
- Returns:
A NumPy array of center-of-mass angles in degrees.
General-purpose numerical helpers used across jitr.
- jitr.utils.utils.block(matrix, block_index, block_size)[source]¶
Extract a sub-block from a block-structured matrix.
- jitr.utils.utils.second_derivative_op(s, channel, interaction, args=())[source]¶
Evaluate the scaled radial Schrödinger operator.
- jitr.utils.utils.schrodinger_eqn_ivp_order1(s, y, channel, interaction, args=())[source]¶
Convert the radial Schrödinger equation to a first-order system.
- jitr.utils.utils.smatrix(Rl, a, l, eta, asym=<class 'jitr.utils.free_solutions.CoulombAsymptotics'>)[source]¶
Compute an S-matrix element from a channel R-matrix value.
- jitr.utils.utils.eval_scaled_interaction(s, interaction, ch, args)[source]¶
Evaluate a local interaction in dimensionless coordinates.
- jitr.utils.utils.eval_scaled_nonlocal_interaction(s, sp, interaction, ch, args)[source]¶
Evaluate a nonlocal interaction in dimensionless coordinates.
- jitr.utils.utils.interaction_range(A, rA=1.2, r0=0.0)[source]¶
Estimate an interaction radius in femtometers.
- jitr.utils.utils.suggested_dimensionless_channel_radius(interaction_range, k)[source]¶
Suggest a dimensionless channel radius for a given interaction range.
The estimate leaves roughly one asymptotic wavelength beyond the interaction region.
- jitr.utils.utils.suggested_basis_size(a, zeros_per_node=5)[source]¶
Suggest an R-matrix basis size for a dimensionless channel radius.
Mass-table accessors and simple derived nuclear-mass observables.
- jitr.utils.mass.init_mass_db()[source]¶
Load the packaged mass tables into memory if needed.
- Return type:
- jitr.utils.mass.mass_excess(A, Z, model='ame2020')[source]¶
Return the mass excess and uncertainty in MeV.
The uncertainty is
Nonewhen the mass table does not include an uncertainty for the requested model, or when the nuclide is not found.
- jitr.utils.mass.binding_energy(A, Z, **kwargs)[source]¶
Return the total binding energy and uncertainty in MeV.
- jitr.utils.mass.neutron_separation_energy(A, Z, **kwargs)[source]¶
Return the one-neutron separation energy and uncertainty in MeV.
- jitr.utils.mass.proton_separation_energy(A, Z, **kwargs)[source]¶
Return the one-proton separation energy and uncertainty in MeV.
- jitr.utils.mass.neutron_fermi_energy(A, Z, **kwargs)[source]¶
Return the neutron Fermi-energy estimate and uncertainty in MeV.
- jitr.utils.mass.proton_fermi_energy(A, Z, **kwargs)[source]¶
Return the proton Fermi-energy estimate and uncertainty in MeV.
Evaluate low-order polynomials and their derivatives.
- jitr.utils.poly.poly1d(x, coeffs, start_i=0)[source]¶
Evaluate a one-dimensional polynomial in ascending-power form.
- Parameters:
- Return type:
- Returns:
Polynomial values evaluated at
x.
- jitr.utils.poly.poly2d(x, y, coeffs, start_i=0, start_j=0)[source]¶
Evaluate a two-dimensional polynomial in ascending-power form.
- Parameters:
x (
float|TypeAliasType) – First evaluation coordinate or coordinates.y (
float|TypeAliasType) – Second evaluation coordinate or coordinates.coeffs (
TypeAliasType) – Coefficient matrix wherecoeffs[i, j]multipliesx ** (start_i + i) * y ** (start_j + j).start_i (
int) – Lowest power represented along thexaxis.start_j (
int) – Lowest power represented along theyaxis.
- Return type:
- Returns:
Polynomial values evaluated on the paired
xandyinputs.
- jitr.utils.poly.poly1d_deriv(coeffs, start_i=0)[source]¶
Differentiate a one-dimensional ascending-power polynomial.
- Parameters:
coeffs (
TypeAliasType) – Polynomial coefficients wherecoeffs[i]multipliesx ** (start_i + i).start_i (
int) – Lowest polynomial power represented bycoeffs.
- Return type:
- Returns:
Tuple of derivative coefficients and the new lowest represented power.
- jitr.utils.poly.poly2d_deriv(coeffs, start_i=0, start_j=0, wrt='y')[source]¶
Differentiate a two-dimensional ascending-power polynomial.
- Parameters:
coeffs (
TypeAliasType) – Coefficient matrix wherecoeffs[i, j]multipliesx ** (start_i + i) * y ** (start_j + j).start_i (
int) – Lowest power represented along thexaxis.start_j (
int) – Lowest power represented along theyaxis.wrt (
str) – Coordinate to differentiate with respect to, either"x"or"y".
- Return type:
- Returns:
Tuple of derivative coefficients and the new
start_i/start_jvalues suitable for passing back intopoly2d().- Raises:
ValueError – If
wrtis not"x"or"y".