atomic_data

NIST atomic energy-level database and loader. Field-free level energies for each element are stored in starkzee/data/atomic_levels.json as cm-1 values above the ground state (NIST vacuum convention). The loader is called by starkzee.radiator.build_hamiltonian() when use_empirical_data=True. Use python scripts/update_nist_levels.py H --spectrum "H I" to refresh the bundled JSON from the NIST ASD levels query. The downloader is intentionally a development tool; runtime profile calculations only read the committed JSON file.

class starkzee.atomic_data.AtomicState(energy, n, l=None, j=None, spin=None)[source]

Bases: object

Explicitly represents an atomic quantum state.

Parameters:
energy: float
n: int
l: int | None = None
j: float | None = None
spin: float | None = None
starkzee.atomic_data.get_data_path()[source]

Returns the absolute path to the data directory.

Return type:

str

starkzee.atomic_data.load_levels(atom, fine_structure)[source]

Load atomic states from the JSON database.

Parameters:
  • atom (str) – Chemical symbol of the element (e.g. 'H', 'He').

  • fine_structure (bool) – If True, load \((n, l, j)\)-resolved levels (fine_structure_true section); otherwise load shell-averaged levels (fine_structure_false section).

Returns:

Atomic states ordered as stored in the JSON file, with energies in cm-1 above the ground state.

Return type:

list of AtomicState

Raises:

ValueError – If atom or the requested fine-structure section is absent from the database.

starkzee.atomic_data.calculate_wavenumber(upper_state, lower_state, lambda_shift=0.0)[source]

Compute the transition wavenumber between two atomic states.

Parameters:
  • upper_state (AtomicState) – Upper energy level.

  • lower_state (AtomicState) – Lower energy level.

  • lambda_shift (float, optional) – Additional shift added to the computed wavenumber (default 0.0).

Returns:

Transition wavenumber \(E_u - E_l + \lambda_\mathrm{shift}\) in cm-1.

Return type:

float

Raises:

ValueError – If upper_state has lower energy than lower_state.