optmat.gas.molecular_ionisation_validation#
The molecular rates against their references.
The references that test a rate of an unaligned molecule are rates resolved in the
angle between the field and the molecular axis, averaged over that angle. Majety and
Scrinzi (2015) give all-electron static rates of N2 at seven angles, of CO at thirteen
and of H2 at two; Jagau (2018) gives coupled-cluster rates of O2 at nine angles, of CO
at thirteen, of H2 at two and of CH4 in three orientations.
orientation_averaged_rates() averages them over the orientations and compares the
models of optmat.gas.molecular_ionisation_rates with the averages. The
references are for fixed nuclei at the equilibrium distance, and the models are
compared at fixed nuclei.
vibrational_factors() compares the vibrational factor of H2 with Saenz’s (2002)
rates averaged over the vibrational ground state. fitted_constants() recomputes
the constants that the default model’s correction and vibrational factor were fitted
to, so that a test can hold the curated values to their data.
Module Attributes
The angle-resolved static rates of each molecule: the datasets' keys and a label. |
|
Jagau's (2018) correlated static rates of each molecule: a pattern of the keys, and a label. |
|
The reference each molecule's alpha is fitted to (or, for CO, tested against). |
Functions
|
Recompute the default model's fitted constants from their references. |
|
Return the average of a rate over the orientations of a linear molecule. |
|
Compare a molecular rate with the orientation average of resolved rates. |
|
Compare H2's vibrational factor with Saenz's averaged rates. |
Classes
|
The constants of the default model, as fitted to their references. |
|
A molecular rate against the orientation average of angle-resolved rates. |
|
The vibrational factor of a model against Saenz's averaged rates. |
- optmat.gas.molecular_ionisation_validation.ANGLE_RESOLVED: Final[Mapping[str, tuple[str, str]]] = {'CO': ('majety_2015/tableA2_CO_{angle}deg', 'Majety & Scrinzi 2015, haCC(6)'), 'H2': ('majety_2015/table{angle}_hacc5_H2', 'Majety & Scrinzi 2015, haCC(5)'), 'N2': ('majety_2015/tableA1_N2_{angle}deg', 'Majety & Scrinzi 2015, haCC(5)')}#
The angle-resolved static rates of each molecule: the datasets’ keys and a label.
For N2 the angles are 0 to 90 degrees in steps of 15, for CO, which is polar, 0 to 180 (0 degrees: the field from the O atom to the C atom). For H2 only the parallel and the perpendicular rates exist (
2_paralleland3_perpendicular).
- optmat.gas.molecular_ionisation_validation.FITTED_REFERENCES: Final[Mapping[str, str]] = {'CH4': 'jagau_2018', 'CO': 'majety_2015', 'H2': 'majety_2015', 'N2': 'majety_2015', 'O2': 'jagau_2018'}#
The reference each molecule’s alpha is fitted to (or, for CO, tested against).
- class optmat.gas.molecular_ionisation_validation.FittedConstants(alpha, free_electrons, free_alpha, vibrational_constant)[source]#
Bases:
objectThe constants of the default model, as fitted to their references.
- Attributes:
- alphadict of str to float
Tong and Lin’s alpha of each molecule of
FITTED_REFERENCESby least squares in the logarithm, with the model’s electron count, against the orientation-averaged all-electron static rates. H2’s, N2’s, O2’s and CH4’s are the curated ones; CO takes N2’s, and its own is what the test of that transfer would ask for.- free_electronsdict of str to float
The electron count when it is fitted too.
- free_alphadict of str to float
Alpha when the count is fitted too.
- vibrational_constantfloat
\(c\) of H2’s vibrational factor, by least squares in its logarithm.
- optmat.gas.molecular_ionisation_validation.JAGAU_2018: Final[Mapping[str, tuple[str, str]]] = {'CH4': ('jagau_2018/tableS8_ccsd_CH4_([ABC])', 'Jagau 2018, CCSD'), 'CO': ('jagau_2018/tableS6_ccsd_CO_(\\d+)deg', 'Jagau 2018, CCSD'), 'H2': ('jagau_2018/tableS3_fci_H2_(\\d+)deg', 'Jagau 2018, full CI'), 'O2': ('jagau_2018/tableS(?:9|10)_ccsd_O2_(\\d+)deg', 'Jagau 2018, CCSD')}#
Jagau’s (2018) correlated static rates of each molecule: a pattern of the keys, and a label.
O2’s angles are 0 to 90 degrees, at every field for 0 and 90 (Table S9) and at 0.06 and 0.10 au for those between (Table S10): the average exists at 0.06 and 0.10 au. CO’s are 0 to 180 degrees with 0 degrees the field from C to O, the reverse of Majety and Scrinzi’s. CH4’s orientations are A (along a CH bond, towards H), B (along a CH bond, towards C) and C (bisecting two CH bonds), averaged with the weights 0.3, 0.3 and 0.4 of Lebedev’s 14-point rule.
- class optmat.gas.molecular_ionisation_validation.OrientationAverage(gas, model, label, angles, field, resolved, expected, predicted)[source]#
Bases:
objectA molecular rate against the orientation average of angle-resolved rates.
- Attributes:
- gasGas
The molecule.
- modelstr
The molecular rate model.
- labelstr
The reference.
- anglesnumpy.ndarray
The angles of the reference, degrees.
- fieldnumpy.ndarray
The static fields, V/m.
- resolvednumpy.ndarray
The reference’s rates, atomic units, first axis the angle.
- expectednumpy.ndarray
Their average over orientations, atomic units.
- predictednumpy.ndarray
The model’s static rate, atomic units.
- angles: Float[ndarray, 'n_angle']#
- property anisotropy: Float[ndarray, 'n']#
The reference’s rate along the axis over its average.
- Returns:
- numpy.ndarray
resolved[0] / expected.
- expected: Float[ndarray, 'n']#
- field: Float[ndarray, 'n']#
- predicted: Float[ndarray, 'n']#
- property ratio: Float[ndarray, 'n']#
The model over the reference.
- Returns:
- numpy.ndarray
predicted / expected.
- resolved: Float[ndarray, 'n_angle n']#
- class optmat.gas.molecular_ionisation_validation.VibrationalFactors(field, expected, predicted)[source]#
Bases:
objectThe vibrational factor of a model against Saenz’s averaged rates.
- Attributes:
- fieldnumpy.ndarray
The static fields, V/m.
- expectednumpy.ndarray
Saenz’s rate averaged over the vibrational ground state (v = 0) over his rate at 1.4 bohr, the field along the axis.
- predictednumpy.ndarray
The model’s factor \(e^{c/F^2}\).
- expected: Float[ndarray, 'n']#
- field: Float[ndarray, 'n']#
- predicted: Float[ndarray, 'n']#
- property ratio: Float[ndarray, 'n']#
The model over the reference.
- Returns:
- numpy.ndarray
predicted / expected.
- optmat.gas.molecular_ionisation_validation.fitted_constants(model='default')[source]#
Recompute the default model’s fitted constants from their references.
With \(y = \ln(W_\text{reference}/W_0)\), \(W_0\) the model at fixed nuclei without its correction and its count, and \(x = F/(I_p\kappa^3)\): \(y = \ln N - \alpha x\), \(N\) fixed at the model’s count, gives \(\alpha\); with \(N\) free, both. \(\ln V = c/F^2\) against Saenz’s ratios gives \(c\).
- Parameters:
- modelstr, optional
The model whose electron count, energy and coefficients are used.
- Returns:
- FittedConstants
The constants.
- optmat.gas.molecular_ionisation_validation.orientation_average(angles, rates)[source]#
Return the average of a rate over the orientations of a linear molecule.
For a molecule without a permanent dipole the rate is even about 90 degrees, and the average over the sphere is \(\int_0^{\pi/2} w(\theta) \sin\theta\, d\theta\). The rate is a smooth function of \(\cos^2\theta\). For two angles it is taken as \(w_\perp + (w_\parallel - w_\perp) \cos^2\theta\), whose average is \((w_\parallel + 2 w_\perp)/3\). For more, the logarithm of the rate is interpolated in \(\cos^2\theta\) by a shape-preserving cubic (which does not oscillate between the angles as a polynomial through all of them can) and the rate integrated by Gauss-Legendre quadrature. For a polar molecule, whose angles run to 180 degrees, the average is \(\frac12 \int_0^\pi w(\theta) \sin\theta\, d\theta\), and the logarithm is interpolated in \(\cos\theta\).
- Parameters:
- anglesnumpy.ndarray
Angles between the field and the molecular axis, degrees, in [0, 90], including 0 and 90, or in [0, 180], including 0 and 180.
- ratesnumpy.ndarray
The rates at those angles, first axis the angle, > 0.
- Returns:
- numpy.ndarray
The average, with the shape of the remaining axes.
- Raises:
- ValueError
If the angles do not span 0 to 90 or 0 to 180 degrees.
Examples
The average of \(1 + \cos^2\theta\) over the sphere is 4/3:
>>> import numpy as np >>> angles = np.arange(0.0, 91.0, 15.0) >>> rates = 1 + np.cos(np.radians(angles)) ** 2 >>> f"{float(orientation_average(angles, rates)):.3f}" '1.333'
- optmat.gas.molecular_ionisation_validation.orientation_averaged_rates(gas, model='default', reference='majety_2015')[source]#
Compare a molecular rate with the orientation average of resolved rates.
- Parameters:
- gasGas or str
N2, CO or H2 (
majety_2015); O2, CO, H2 or CH4 (jagau_2018).- modelstr, optional
A model of
optmat.gas.molecular_ionisation_rates.molecular_rate_model()with a static limit (not thepptforms). It is evaluated at fixed nuclei: without its vibrational factor.- referencestr, optional
majety_2015, Majety and Scrinzi’s haCC rates, orjagau_2018, Jagau’s coupled-cluster rates.
- Returns:
- OrientationAverage
The comparison, at the fields the reference gives at every angle.
- Raises:
- DataError
If no angle-resolved rate of the reference is curated for the molecule.
- optmat.gas.molecular_ionisation_validation.vibrational_factors(model='default')[source]#
Compare H2’s vibrational factor with Saenz’s averaged rates.
- Parameters:
- modelstr, optional
A model with a vibrational factor for H2.
- Returns:
- VibrationalFactors
The factor of the model and of the reference, at the fields of both (0.06 to 0.12 au).
Examples
>>> comparison = vibrational_factors() >>> [f"{x:.2f}" for x in comparison.expected] ['1.56', '1.32', '1.16', '1.16']