optmat.gas.models.formulas#

Published dispersion formulas, built from the source records.

A source record’s [[formulas]] entry that names a form is a model. Its coefficients are kept as printed, as strings; a misprinted coefficient is corrected by a corrections entry that names the term, the printed and the corrected value, the reason and the evidence, exactly like a dataset erratum, and the printed value is checked on loading.

The forms (lambda the vacuum wavelength, s = 1/lambda in um^-1, nu the vacuum wavenumber in cm^-1, omega the angular frequency in atomic units):

dn_sigma2

n - 1 = scale (A + sum_i B_i / (C_i - s^2)), the Peck and Bideau-Mehu form and refractiveindex.info’s formula 6.

dn_wavenumber2

n - 1 = scale (A + sum_i B_i / (C_i - nu^2)), the atmospheric-science form (He et al. 2021, Wilmouth & Sayres 2020).

n2_sellmeier

n^2 - 1 = A + sum_i B_i lambda^2 / (lambda^2 - C_i) with lambda in um (Borzsonyi et al. 2008, Ermolov et al. 2015), refractiveindex.info’s formula 2.

alpha_series

alpha = sum_k c_k omega^(2k) in atomic units, a Cauchy series of the polarizability itself (Bhatia & Drachman as quoted by Stone & Stejskal 2004).

molar_refractivity_series

A_R = sum_k a_k lambda^(-2k) in cm^3/mol with lambda in nm (Stone & Stejskal).

oscillator

alpha = sum_i f_i / (E_i^2 - omega^2) in atomic units, a pseudo-spectrum (Kumar and Meath); the entry’s energy_unit (“hartree”, the default, “eV” or “rydberg”) says in what the E_i are printed.

The first three give n - 1 (or n^2 - 1) at the formula’s reference state; the polarizability follows by inverse Lorentz-Lorenz with the density the source meant (density: real or ideal gas). The last two are per particle and need no state.

Module Attributes

FORMS

The formula forms a source record may name.

Functions

published_model(name)

Return one gas formula model, reading only its source's record.

published_models()

Return every formula model defined in the source records, by name.

Classes

FormulaModel(gas, name, citation, ...[, ...])

A published formula as a polarizability model.

optmat.gas.models.formulas.FORMS: Final = frozenset({'alpha_series', 'dn_sigma2', 'dn_wavenumber2', 'molar_refractivity_series', 'n2_sellmeier', 'oscillator'})#

The formula forms a source record may name.

class optmat.gas.models.formulas.FormulaModel(gas, name, citation, wavelength_range, kind, form='', terms=<factory>, state=None, ideal=False, energy_scale=1.0, *, status='user', status_reason='', modified=(), base='', intervals=())[source]#

Bases: Model

A published formula as a polarizability model.

Attributes:
formstr

One of FORMS.

termsdict of str to tuple of float

The coefficients after corrections: A, B, C, scale for the refractivity forms, c or a for the series.

stateState or None

The reference state of a refractivity form.

idealbool

True if the source related its refractivity to the state with the ideal gas.

energy_scalefloat

Hartree per printed energy unit, for the oscillator form.

Its overrides are the coefficients (``terms``) and the intervals.
EVALUATION_VERSION: ClassVar[int] = 1#
INPUTS: ClassVar[tuple[str, ...]] = ('intervals', 'terms')#

The parameters with_parameters() may change.

energy_scale: float = 1.0#
form: str = ''#
ideal: bool = False#
property reference_density: float[source]#

The number density of the formula’s reference state, resolved once.

Returns:
float

The density, m^-3 (ideal where the source used the ideal gas); NaN for a per-particle series, which has no reference state.

state: State | None = None#
terms: Mapping[str, tuple[float, ...]]#
optmat.gas.models.formulas.published_model(name)[source]#

Return one gas formula model, reading only its source’s record.

published_models() reads every record with formulas; a lookup by name needs one.

Parameters:
namestr

<source>/<formula>.

Returns:
FormulaModel

The model, the same as published_models() holds under that name.

Raises:
KeyError

If no gas formula has that name.

Examples

>>> published_model("bideau_mehu_1981/sellmeier_Ar").gas.value
'Ar'
optmat.gas.models.formulas.published_models()[source]#

Return every formula model defined in the source records, by name.

Returns:
dict of str to FormulaModel

The models, named <source>/<formula>.

Examples

>>> model = published_models()["bideau_mehu_1981/sellmeier_Ar"]
>>> f"{float(model.refractivity(253.7e-9)) * 1e6:.1f}"
'303.2'