opencr.core.species
Species and their quantum states.
A Species is a particle kind named by its formula, as in plasmacoll
and carafe ("e", "H", "H+", "H2", "H-"), with its
charge, mass and elemental composition. A State is one state of a
species that the model resolves: an atomic level H(n=2), a fine-structure
level, a molecular electronic-vibrational state H2(X,v=3), or the species
as a whole (an empty label) when it is not resolved. The solver sees only
states, so the resolution of a model changes without changing the solver.
Energies of the states of one element share one scale: zero at the ground state of the neutral, the ion’s ground state at the ionization energy. Detailed balance and the photon energies of radiative transitions are computed from these energies.
The mass of a species and the energy of a state take an astropy Quantity or a
string such as "1.008 u" or "10.2 eV" as well as a number in kg or eV
(see plasmacoll.units).
Attributes
| Name | Description |
|---|---|
ELECTRON | No description. |
ELECTRON_STATE | No description. |
Functions
| Name | Description |
|---|---|
species_from_formula | Return the species of a simple formula such as "H", "H2+", "Ar" or "H-". |
ELECTRONattributemodule attribute#
ELECTRON = Species('e', -1, ELECTRON_MASS, {})ELECTRON_STATEattributemodule attribute#
ELECTRON_STATE = State(ELECTRON, weight=2.0)Speciesclassdataclass#
class Species(name: str, charge: int, mass: float = unit_field('kg'), composition: Mapping[str, int] = dict())A particle kind.
Attributes
chargeattributeinstance attribute#
charge: intcompositionattributeclass attributeinstance attribute#
composition: Mapping[str, int] = field(default_factory=dict)massattributeclass attributeinstance attribute#
mass: float = unit_field('kg')nameattributeinstance attribute#
name: strStateclassdataclass#
class State(species: Species, label: str = '', energy: float = unit_field('eV', 0.0), weight: float = 1.0, quantum_numbers: Mapping[str, Any] = dict())One resolved state of a species.
Attributes
| Name | Type | Description |
|---|---|---|
species | Species | The species. |
label | str | The quantum label, e.g. "n=2" or "X,v=3"; empty when the
species is not resolved further. |
energy | float | The energy in eV on the common scale of the element (see the module docstring). |
weight | float | The statistical weight g. |
quantum_numbers | Mapping[str, Any] | The quantum numbers by name, e.g. {"n": 2},
{"n": 2, "l": 1} or {"electronic": "X", "v": 3}. |
energyattributeclass attributeinstance attribute#
energy: float = unit_field('eV', 0.0)labelattributeclass attributeinstance attribute#
label: str = ''quantum_numbersattributeclass attributeinstance attribute#
quantum_numbers: Mapping[str, Any] = field(default_factory=dict)speciesattributeinstance attribute#
species: Speciesweightattributeclass attributeinstance attribute#
weight: float = 1.0chargeproperty#
charge: intThe charge in units of e.
nameproperty#
name: strThe state’s name, "H(n=2)", or the species’ name when unresolved.
species_from_formulafunction#
def species_from_formula(formula: str) -> SpeciesReturn the species of a simple formula such as "H", "H2+", "Ar" or "H-".
The formula is one element symbol, an optional atom count and the charge
as repeated signs ("H2+", "H-", "Ar++"). The mass is the sum of
the atomic masses minus the missing electrons (plus the extra ones of a
negative ion).