40 qns.has(QuantumNumberType::Omega,
42 QuantumNumberType::Lambda,
43 QuantumNumberType::S)) {
44 auto& Omega = qns[QuantumNumberType::Omega];
45 auto& J = qns[QuantumNumberType::J];
46 auto& Lambda = qns[QuantumNumberType::Lambda];
47 auto& S = qns[QuantumNumberType::S];
49 Omega.upp(), J.upp(), Lambda.upp(), S.upp(), GS, GL),
51 Omega.low(), J.low(), Lambda.low(), S.low(), GS, GL)};
55 qns.has(QuantumNumberType::N,
57 QuantumNumberType::Lambda,
58 QuantumNumberType::S)) {
59 auto&
N = qns[QuantumNumberType::N];
60 auto& J = qns[QuantumNumberType::J];
61 auto& Lambda = qns[QuantumNumberType::Lambda];
62 auto& S = qns[QuantumNumberType::S];
75 return SimpleG(qid.val, GS, GL);
93 using std::atan2, std::cos, std::sin;
98 auto nom = (lB + lD * (J * J + J + 1) + lH * pow2(J * J + J + 1)) *
99 (2 *
sqrt(J * J + J) / (2 * J + 1));
102 B * J * (J - 1) - D * pow2(J * (J - 1)) + H * pow3(J * (J - 1)) +
103 (gB + gD * J * (J - 1) + gH * pow2(J * (J - 1))) * (J - 1) +
104 (lB + lD * J * (J - 1) + lH * pow2(J * (J - 1))) *
105 (2. / 3. - 2 * J / (2 * J + 1)) -
106 (B * (J + 2) * (J + 1) - D * pow2((J + 2) * (J + 1)) +
107 H * pow3((J + 2) * (J + 1)) -
108 (gB + gD * (J + 2) * (J + 1) + gH * pow2((J + 2) * (J + 1))) * (J + 2) +
109 (lB + lD * (J + 2) * (J + 1) + lH * pow2((J + 2) * (J + 1))) *
110 (2. / 3. - 2 * (J + 1) / (2 * J + 1)));
112 auto phi = atan2(2 * nom, denom) / 2;
114 if (J ==
N)
return (GS + GR) / (J * (J + 1)) - GR;
116 return (GS + GR) * (pow2(cos(phi)) / J - pow2(sin(phi)) / (J + 1)) +
117 2 * GLE * cos(2 * phi) / (2 * J + 1) - GR;
118 return (GS + GR) * (pow2(sin(phi)) / J - pow2(cos(phi)) / (J + 1)) -
119 2 * GLE * cos(2 * phi) / (2 * J + 1) - GR;
127 if (k.isUndefined() or j.
isUndefined() or j == 0)
return 0;
128 return gperp + (gperp + gpara) * (pow2(k) / (j * (j + 1)));
133 if (qid.Isotopologue() ==
"O2-66") {
134 if (qid.val.has(QuantumNumberType::J,
135 QuantumNumberType::N,
136 QuantumNumberType::v1)) {
137 if (qid.val[QuantumNumberType::v1].low() == 0 and
138 qid.val[QuantumNumberType::v1].upp() == 0) {
139 constexpr Numeric GS = 2.002084;
140 constexpr Numeric GLE = 2.77e-3;
141 constexpr Numeric GR = -1.16e-4;
142 constexpr Numeric B = 43100.44276e6;
143 constexpr Numeric D = 145.1271e3;
145 constexpr Numeric lB = 59501.3438e6;
146 constexpr Numeric lD = 58.3680e3;
147 constexpr Numeric lH = 290.8e-3;
148 constexpr Numeric gB = -252.58634e6;
149 constexpr Numeric gD = -243.42;
150 constexpr Numeric gH = -1.46e-3;
152 auto JU = qid.val[QuantumNumberType::J].upp();
153 auto NU = qid.val[QuantumNumberType::N].upp();
155 JU, NU, GS, GR, GLE, B, D, H, gB, gD, gH, lB, lD, lH);
156 auto JL = qid.val[QuantumNumberType::J].low();
157 auto NL = qid.val[QuantumNumberType::N].low();
159 JL, NL, GS, GR, GLE, B, D, H, gB, gD, gH, lB, lD, lH);
163 }
else if (qid.Isotopologue() ==
"O2-68") {
164 if (qid.val.has(QuantumNumberType::J,
165 QuantumNumberType::N,
166 QuantumNumberType::v1)) {
167 if (qid.val[QuantumNumberType::v1].low() == 0 and
168 qid.val[QuantumNumberType::v1].upp() == 0) {
169 constexpr Numeric GS = 2.002025;
170 constexpr Numeric GLE = 2.813e-3;
171 constexpr Numeric GR = -1.26e-4;
172 constexpr Numeric B = 40707.38657e6;
173 constexpr Numeric D = 129.4142e3;
175 constexpr Numeric lB = 59499.0375e6;
176 constexpr Numeric lD = 54.9777e3;
177 constexpr Numeric lH = 272.1e-3;
178 constexpr Numeric gB = -238.51530e6;
179 constexpr Numeric gD = -217.77;
180 constexpr Numeric gH = -1.305e-3;
182 auto JU = qid.val[QuantumNumberType::J].upp();
183 auto NU = qid.val[QuantumNumberType::N].upp();
185 JU, NU, GS, GR, GLE, B, D, H, gB, gD, gH, lB, lD, lH);
186 auto JL = qid.val[QuantumNumberType::J].low();
187 auto NL = qid.val[QuantumNumberType::N].low();
189 JL, NL, GS, GR, GLE, B, D, H, gB, gD, gH, lB, lD, lH);
193 }
else if (qid.Isotopologue() ==
"CO-26") {
198 return {gperp, gperp};
199 }
else if (qid.Isotopologue() ==
"OCS-622") {
206 if (qid.val.has(QuantumNumberType::J, QuantumNumberType::Ka)) {
207 auto JU = qid.val[QuantumNumberType::J].upp();
208 auto KU = qid.val[QuantumNumberType::Ka].upp();
209 auto JL = qid.val[QuantumNumberType::J].low();
210 auto KL = qid.val[QuantumNumberType::Ka].low();
215 }
else if (qid.Isotopologue() ==
"OCS-624") {
223 if (qid.val.has(QuantumNumberType::J, QuantumNumberType::Ka)) {
224 auto JU = qid.val[QuantumNumberType::J].upp();
225 auto KU = qid.val[QuantumNumberType::Ka].upp();
226 auto JL = qid.val[QuantumNumberType::J].low();
227 auto KL = qid.val[QuantumNumberType::Ka].low();
232 }
else if (qid.Isotopologue() ==
"CO2-626") {
240 if (qid.val.has(QuantumNumberType::J, QuantumNumberType::Ka)) {
241 auto JU = qid.val[QuantumNumberType::J].upp();
242 auto KU = qid.val[QuantumNumberType::Ka].upp();
243 auto JL = qid.val[QuantumNumberType::J].low();
244 auto KL = qid.val[QuantumNumberType::Ka].low();
262 return Eigen::Vector3d(
v,
u,
w).normalized();
268 return Eigen::Vector3d(cos(
a) * sin(z), sin(
a) * sin(z), cos(z)).normalized();
274 return Eigen::Vector3d(cos(
a) * cos(z), sin(
a) * cos(z), -sin(z)).normalized();
282 output.
H = std::hypot(
u,
v,
w);
292 output.
dH_dv = nH[0];
293 output.
dH_du = nH[1];
294 output.
dH_dw = nH[2];
297 const Numeric cos_theta = n.dot(nH);
299 output.
theta = std::acos(cos_theta);
300 if (sin_theta not_eq 0) {
301 const Eigen::Vector3d dtheta =
302 (nH * cos_theta - n) / (output.
H * sin_theta);
313 const Eigen::Vector3d inplane = nH - nH.dot(n) * n;
314 const Numeric y = ev.cross(inplane).dot(n);
315 const Numeric x = ev.dot(inplane);
316 output.
eta = std::atan2(y, x);
317 if (x not_eq 0 or y not_eq 0) {
318 const Eigen::Vector3d deta =
341 auto ml =
Ml(Ju, Jl, type, n);
342 auto mu =
Mu(Ju, Jl, type, n);
369 const Numeric ST = std::sin(theta), CT = std::cos(theta), ST2 = ST * ST,
370 CT2 = CT * CT, ST2C2E = ST2 * std::cos(2 * eta),
371 ST2S2E = ST2 * std::sin(2 * eta);
375 1 + CT2, ST2C2E, ST2S2E, 2 * CT, 4 * CT, 2 * ST2S2E, -2 * ST2C2E);
379 1 + CT2, ST2C2E, ST2S2E, -2 * CT, -4 * CT, 2 * ST2S2E, -2 * ST2C2E);
385 const Numeric ST = std::sin(theta), CT = std::cos(theta),
386 C2E = std::cos(2 * eta), S2E = std::sin(2 * eta), dST = CT,
387 dST2 = 2 * ST * dST, dCT = -ST, dST2C2E = dST2 * C2E,
388 dST2S2E = dST2 * S2E, dCT2 = 2 * CT * dCT;
392 dCT2, dST2C2E, dST2S2E, 2 * dCT, 4 * dCT, 2 * dST2S2E, -2 * dST2C2E);
394 dST2, -dST2C2E, -dST2S2E, 0, 0, -2 * dST2S2E, 2 * dST2C2E);
396 dCT2, dST2C2E, dST2S2E, -2 * dCT, -4 * dCT, 2 * dST2S2E, -2 * dST2C2E);
402 const Numeric ST = std::sin(theta), ST2 = ST * ST, C2E = std::cos(2 * eta),
403 S2E = std::sin(2 * eta), dST2C2E = -2 * ST2 * S2E,
404 dST2S2E = 2 * ST2 * C2E;
410 0, -dST2C2E, -dST2S2E, 0, 0, -2 * dST2S2E, 2 * dST2C2E);
416#pragma GCC diagnostic push
417#pragma GCC diagnostic ignored "-Wreturn-type"
431#pragma GCC diagnostic pop
440 ARTS_ASSERT(do_phase ? pm.NumberOfNeededVectors() == 7
441 : pm.NumberOfNeededVectors() == 4)
466 ARTS_ASSERT(do_phase ? pm.NumberOfNeededVectors() == 7
467 : pm.NumberOfNeededVectors() == 4)
477 (dt * dpolvec_dtheta_real + de * dpolvec_deta_real);
479 (dt * dpolvec_dtheta_imag + de * dpolvec_deta_imag);
The ComplexVectorView class.
A list of many quantum numbers. Should always remain sorted.
Numeric Strength(Rational Ju, Rational Jl, Polarization type, Index n) const ARTS_NOEXCEPT
Gives the strength of one subline of a given polarization.
bool empty() const noexcept
Returns true if the Model represents no Zeeman effect.
constexpr Model(SplittingData gs={NAN, NAN}) noexcept
Default copy/init of Model from its only private variable.
Binary output file stream class.
Binary output file stream class.
Input manipulator class for doubles to enable nan and inf parsing.
Helper macros for debugging.
#define ARTS_ASSERT(condition,...)
void abs(Sparse &A, const Sparse &B)
Absolute value of sparse matrix elements.
NUMERIC Numeric
The type to use for all floating point numbers.
INDEX Index
The type to use for all integer numbers and indices.
constexpr Numeric mass_ratio_electrons_per_proton
Mass ratio of electrons to protons [-] From: https://physics.nist.gov/cgi-bin/cuu/Value?...
constexpr auto pow3(auto x) noexcept
power of three
constexpr auto pow2(auto x) noexcept
power of two
bool vamdcCheck(const ValueList &l, VAMDC type) ARTS_NOEXCEPT
Implements Zeeman modeling.
std::ostream & operator<<(std::ostream &os, const Model &m)
constexpr Index dM(Polarization type) noexcept
Gives the change of M given a polarization type.
constexpr Numeric SimpleGCaseB(Rational N, Rational J, Rational Lambda, Rational S, Numeric GS, Numeric GL) noexcept
Computes the Zeeman splitting coefficient.
const PolarizationVector & SelectPolarization(const AllPolarizationVectors &data, Polarization type) noexcept
Selects the polarization vector depending on polarization type.
constexpr Derived FromPreDerived(Numeric H, Numeric theta, Numeric eta) noexcept
Sets Derived from predefined Derived parameters.
constexpr Numeric SimpleGCaseA(Rational Omega, Rational J, Rational Lambda, Rational Sigma, Numeric GS, Numeric GL) noexcept
Computes the Zeeman splitting coefficient.
constexpr Numeric PolarizationFactor(Polarization type) noexcept
The renormalization factor of a polarization type.
Derived FromGrids(Numeric u, Numeric v, Numeric w, Numeric z, Numeric a) noexcept
Computes the derived plane from ARTS grids.
AllPolarizationVectors AllPolarization_deta(Numeric theta, Numeric eta) noexcept
The derivative of AllPolarization wrt eta.
AllPolarizationVectors AllPolarization_dtheta(Numeric theta, const Numeric eta) noexcept
The derivative of AllPolarization wrt theta.
Polarization
Zeeman polarization selection.
Model GetAdvancedModel(const QuantumIdentifier &qid) ARTS_NOEXCEPT
Returns an advanced Zeeman model.
void dsum(PropagationMatrix &pm, const ComplexVectorView &abs, const ComplexVectorView &dabs, const PolarizationVector &polvec, const PolarizationVector &dpolvec_dtheta, const PolarizationVector &dpolvec_deta, const Numeric dH, const Numeric dt, const Numeric de, const bool do_phase) ARTS_NOEXCEPT
Sums the Zeeman components derivatives into a propagation matrix.
void sum(PropagationMatrix &pm, const ComplexVectorView &abs, const PolarizationVector &polvec, const bool do_phase) ARTS_NOEXCEPT
Sums the Zeeman components into a propagation matrix.
std::istream & operator>>(std::istream &is, Model &m)
Model GetSimpleModel(const QuantumIdentifier &qid) ARTS_NOEXCEPT
Returns a simple Zeeman model.
constexpr Rational Ml(Rational Ju, Rational Jl, Polarization type, Index n) noexcept
Gives the lower state M value at an index.
AllPolarizationVectors AllPolarization(Numeric theta, Numeric eta) noexcept
Computes the polarization of each polarization type.
constexpr Rational Mu(Rational Ju, Rational Jl, Polarization type, Index n) noexcept
Gives the upper state M value at an index.
auto row_vec(matpack::vector auto &&x)
Map the input to a non-owning const-correct Eigen Map representing a column vector.
auto col_vec(matpack::vector auto &&x)
Map the input to a non-owning const-correct Eigen Map representing a column vector.
auto mat(matpack::matrix auto &&x)
Map the input to a non-owning const-correct Eigen Map representing a row matrix.
Numeric sqrt(const Rational r)
Square root.
Numeric get_lande_spin_constant(const Species::Species species) noexcept
Get the Lande spin constant.
Numeric get_lande_lambda_constant() noexcept
Get the Lande Lambda constant.
Some molecular constants.
A logical struct for global quantum numbers with species identifiers.
Implements rational numbers to work with other ARTS types.
constexpr bool isUndefined() const noexcept
Is the object not defined.
PolarizationVector for each Polarization.
Contains derived values useful for Zeeman calculations.
Polarization vector for Zeeman Propagation Matrix.
Main storage for Zeeman splitting coefficients.
Numeric wigner3j(const Rational j1, const Rational j2, const Rational j3, const Rational m1, const Rational m2, const Rational m3)
Wigner 3J symbol.
Wigner symbol interactions.
Eigen::Vector3d los_xyz_by_za_local(Numeric z, Numeric a)
Numeric case_b_g_coefficient_o2(Rational J, Rational N, Numeric GS, Numeric GR, Numeric GLE, Numeric B, Numeric D, Numeric H, Numeric gB, Numeric gD, Numeric gH, Numeric lB, Numeric lD, Numeric lH)
Zeeman::SplittingData SimpleG(const Quantum::Number::ValueList &qns, const Numeric &GS, const Numeric &GL) noexcept
constexpr Numeric closed_shell_trilinear(Rational k, Rational j, Numeric gperp, Numeric gpara)
Eigen::Vector3d ev_xyz_by_za_local(Numeric z, Numeric a)
Eigen::Vector3d los_xyz_by_uvw_local(Numeric u, Numeric v, Numeric w)
Headers and class definition of Zeeman modeling.