ARTS 2.5.4 (git: 31ce4f0e)
quantum_term_symbol.cc
Go to the documentation of this file.
2
3#include "debug.h"
4
5namespace Quantum::Helpers {
6namespace detail {
7constexpr std::string_view select_molecular_lambda(Index lambda) {
8 switch (lambda) {
9 case 0:
10 return R"(\Sigma)";
11 case 1:
12 return R"(\Gamma)";
13 case 2:
14 return R"(\Delta)";
15 case 3:
16 return R"(\Phi)";
17 }
18 ARTS_USER_ERROR("Cannot translate lambda ", lambda, " to symbolic value");
19}
20} // namespace detail
21
23 std::string upp, low;
24
25 if (qid.val.has(QuantumNumberType::ElecStateLabel)) {
26 upp += qid.val[QuantumNumberType::ElecStateLabel].str_upp();
27 low += qid.val[QuantumNumberType::ElecStateLabel].str_low();
28 }
29
30 if (qid.val.has(QuantumNumberType::S)) {
31 upp += var_string("$^{", 2 * qid.val[QuantumNumberType::S].upp() + 1, "}$");
32 low += var_string("$^{", 2 * qid.val[QuantumNumberType::S].low() + 1, "}$");
33 } else {
34 upp += "$^{?}$";
35 low += "$^{?}$";
36 }
37
38 if (qid.val.has(QuantumNumberType::Lambda)) {
39 upp += var_string("${",
41 qid.val[QuantumNumberType::Lambda].upp().toIndex()),
42 "}$");
43 low += var_string("${",
45 qid.val[QuantumNumberType::Lambda].low().toIndex()),
46 "}$");
47 } else {
48 upp += "$?$";
49 low += "$?$";
50 }
51
52 const bool vibInv = qid.val.has(QuantumNumberType::vibInv);
53 const bool Omega = qid.val.has(QuantumNumberType::Omega);
54 if (Omega) {
55 upp += var_string("$_{", qid.val[QuantumNumberType::Omega].upp());
56 low += var_string("$_{", qid.val[QuantumNumberType::Omega].low());
57
58 if (not vibInv) {
59 upp += "}$";
60 low += "}$";
61 }
62 }
63
64 if (vibInv) {
65 if (not Omega) {
66 upp +=
67 var_string("$_{", qid.val[QuantumNumberType::vibInv].str_upp(), "}$");
68 low +=
69 var_string("$_{", qid.val[QuantumNumberType::vibInv].str_low(), "}$");
70 } else {
71 upp +=
72 var_string(",", qid.val[QuantumNumberType::vibInv].str_upp(), "}$");
73 low +=
74 var_string(",", qid.val[QuantumNumberType::vibInv].str_low(), "}$");
75 }
76 }
77
78 if (qid.val.has(QuantumNumberType::parity)) {
79 upp +=
80 var_string("$^{", qid.val[QuantumNumberType::parity].str_upp(), "}$");
81 low +=
82 var_string("$^{", qid.val[QuantumNumberType::parity].str_low(), "}$");
83 }
84
85
86 if (qid.val.has(QuantumNumberType::v)) {
87 upp +=
88 var_string("$\\left(\\nu=", qid.val[QuantumNumberType::v].upp(), "\\right)$");
89 low +=
90 var_string("$\\left(\\nu=", qid.val[QuantumNumberType::v].low(), "\\right)$");
91 }
92
93 return var_string(low, R"($ \leftarrow $)", upp);
94}
95} // namespace Quantum::Helpers
bool has(Types... ts) const ARTS_NOEXCEPT
Returns whether all the Types are part of the list, the types must be sorted.
Helper macros for debugging.
#define ARTS_USER_ERROR(...)
Definition: debug.h:150
std::string var_string(Args &&... args)
Definition: debug.h:36
INDEX Index
The type to use for all integer numbers and indices.
Definition: matpack.h:39
constexpr std::string_view select_molecular_lambda(Index lambda)
std::string molecular_term_symbol(const QuantumIdentifier &qid)
Returns the Molecular Term in LaTeX formatting of a QuantumIdentifier.
A logical struct for global quantum numbers with species identifiers.
#define v