ARTS  2.4.0(git:4fb77825)
quantum.h
Go to the documentation of this file.
1 /* Copyright (C) 2013
2  Oliver Lemke <olemke@core-dump.info>
3 
4  This program is free software; you can redistribute it and/or modify it
5  under the terms of the GNU General Public License as published by the
6  Free Software Foundation; either version 2, or (at your option) any
7  later version.
8 
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License
15  along with this program; if not, write to the Free Software
16  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
17  USA. */
18 
27 #ifndef quantum_h
28 #define quantum_h
29 
30 #include <array>
31 #include <iostream>
32 #include <map>
33 #include <numeric>
34 #include <stdexcept>
35 #include "array.h"
36 #include "interpolation.h"
37 #include "matpack.h"
38 #include "mystring.h"
39 #include "rational.h"
40 
48 enum class QuantumNumberType : Index {
49  J = 0, // Total angular momentum
50  dJ, // Delta total angular momentum
51  M, // Projection of J along magnetic field
52  N, // J minus spin
53  dN, // Delta J minus spin
54  S, // Spin angular momentum (from electrons) NOTE: S_global for HITRAN S
55  tau,
56  n,
57  F, // J + nuclear spin
58  Ka, //(This is a projection of J along one axis)
59  Kc, //(This is a projection of J along another axis)
60  Omega, // This is an absolute projection of J and S
61  i, //(Is related to Omega)
62  Lambda, // This is Sigma or Pi or Lambda states (as seen in literature)
63  alpha, // Alpha from HITRAN
64  Sym, // Symmetry expression
65  parity, // parity value (+/-)
66  kronigParity, // ???
67  v1, // Vibrational mode 1
68  v2, // Vibrational mode 2
69  v3, // Vibrational mode 3
70  v4, // Vibrational mode 4
71  v5, // Vibrational mode 5
72  v6, // Vibrational mode 6
73  v7,
74  v8,
75  v9,
76  v10,
77  v11,
78  v12,
79  l1, // The absolute sum of l_j for v_j
80  l2, // Vibrational angular momentum associated with v2
81  l3,
82  l4,
83  l5,
84  l6,
85  l7,
86  l8,
87  l9,
88  l10,
89  l11,
90  l12,
91  pm, // Symmetry type for l=0
92  r, // Rank of the level within a set of the same vibrational symmetry
93  S_global, // Symmetry of the level
94  ElectronState, // Electronic state
95  n_global, // Torosional quanta
96  C, // Another symmetry expression
97  Hund, // Flag for Hund case type. This flag lets Zeeman know what to expect
98  FINAL_ENTRY // We need this to determine the number of elements in this enum
99 };
100 
102  #define INPUT_QUANTUM(ID) \
103  if (s == #ID) return QuantumNumberType::ID
104  INPUT_QUANTUM(J);
105  else INPUT_QUANTUM(dJ);
106  else INPUT_QUANTUM(M);
107  else INPUT_QUANTUM(N);
108  else INPUT_QUANTUM(dN);
109  else INPUT_QUANTUM(tau);
110  else INPUT_QUANTUM(n);
111  else INPUT_QUANTUM(S);
112  else INPUT_QUANTUM(F);
113  else if (s.find("F#") < s.length()) return QuantumNumberType::F; // HITRAN has many names for F
114  else if (s == "K") return QuantumNumberType::Ka; // HITRAN name
115  else INPUT_QUANTUM(Ka);
116  else INPUT_QUANTUM(Kc);
117  else INPUT_QUANTUM(Omega);
118  else INPUT_QUANTUM(i);
119  else INPUT_QUANTUM(Lambda);
120  else INPUT_QUANTUM(alpha);
121  else INPUT_QUANTUM(Sym);
122  else INPUT_QUANTUM(parity);
123  else INPUT_QUANTUM(kronigParity);
124  else if (s == "v") return QuantumNumberType::v1; // HITRAN name
125  else INPUT_QUANTUM(v1);
126  else INPUT_QUANTUM(v2);
127  else INPUT_QUANTUM(v3);
128  else INPUT_QUANTUM(v4);
129  else INPUT_QUANTUM(v5);
130  else INPUT_QUANTUM(v6);
131  else INPUT_QUANTUM(v7);
132  else INPUT_QUANTUM(v8);
133  else INPUT_QUANTUM(v9);
134  else INPUT_QUANTUM(v10);
135  else INPUT_QUANTUM(v11);
136  else INPUT_QUANTUM(v12);
137  else if (s == "l") return QuantumNumberType::l1; // HITRAN name
138  else INPUT_QUANTUM(l1);
139  else INPUT_QUANTUM(l2);
140  else INPUT_QUANTUM(l3);
141  else INPUT_QUANTUM(l4);
142  else INPUT_QUANTUM(l5);
143  else INPUT_QUANTUM(l6);
144  else INPUT_QUANTUM(l7);
145  else INPUT_QUANTUM(l8);
146  else INPUT_QUANTUM(l9);
147  else INPUT_QUANTUM(l10);
148  else INPUT_QUANTUM(l11);
149  else INPUT_QUANTUM(l12);
150  else INPUT_QUANTUM(pm);
151  else INPUT_QUANTUM(r);
152  else INPUT_QUANTUM(S_global);
153  else INPUT_QUANTUM(ElectronState);
154  else if (s == "ElecStateLabel") return QuantumNumberType::ElectronState; // HITRAN name
155  else INPUT_QUANTUM(n_global);
156  else INPUT_QUANTUM(C);
157  else INPUT_QUANTUM(Hund);
158  else return QuantumNumberType::FINAL_ENTRY;
159  #undef INPUT_QUANTUM
160 }
161 
163  #define INPUT_QUANTUM(ID) \
164  if (s == QuantumNumberType::ID) return #ID
165  INPUT_QUANTUM(J);
166  else INPUT_QUANTUM(dJ);
167  else INPUT_QUANTUM(M);
168  else INPUT_QUANTUM(N);
169  else INPUT_QUANTUM(dN);
170  else INPUT_QUANTUM(tau);
171  else INPUT_QUANTUM(n);
172  else INPUT_QUANTUM(S);
173  else INPUT_QUANTUM(F);
174  else INPUT_QUANTUM(Ka);
175  else INPUT_QUANTUM(Kc);
176  else INPUT_QUANTUM(Omega);
177  else INPUT_QUANTUM(i);
178  else INPUT_QUANTUM(Lambda);
179  else INPUT_QUANTUM(alpha);
180  else INPUT_QUANTUM(Sym);
181  else INPUT_QUANTUM(parity);
182  else INPUT_QUANTUM(kronigParity);
183  else INPUT_QUANTUM(v1);
184  else INPUT_QUANTUM(v2);
185  else INPUT_QUANTUM(v3);
186  else INPUT_QUANTUM(v4);
187  else INPUT_QUANTUM(v5);
188  else INPUT_QUANTUM(v6);
189  else INPUT_QUANTUM(v7);
190  else INPUT_QUANTUM(v8);
191  else INPUT_QUANTUM(v9);
192  else INPUT_QUANTUM(v10);
193  else INPUT_QUANTUM(v11);
194  else INPUT_QUANTUM(v12);
195  else INPUT_QUANTUM(l1);
196  else INPUT_QUANTUM(l2);
197  else INPUT_QUANTUM(l3);
198  else INPUT_QUANTUM(l4);
199  else INPUT_QUANTUM(l5);
200  else INPUT_QUANTUM(l6);
201  else INPUT_QUANTUM(l7);
202  else INPUT_QUANTUM(l8);
203  else INPUT_QUANTUM(l9);
204  else INPUT_QUANTUM(l10);
205  else INPUT_QUANTUM(l11);
206  else INPUT_QUANTUM(l12);
207  else INPUT_QUANTUM(pm);
208  else INPUT_QUANTUM(r);
209  else INPUT_QUANTUM(S_global);
210  else INPUT_QUANTUM(ElectronState);
211  else INPUT_QUANTUM(n_global);
212  else INPUT_QUANTUM(C);
213  else INPUT_QUANTUM(Hund);
214  throw std::runtime_error("Bad quantum number type");
215  #undef INPUT_QUANTUM
216 }
217 
219 enum class Hund : Index { CaseA = int('a'), CaseB = int('b') };
220 
223  public:
224  typedef std::array<Rational, Index(QuantumNumberType::FINAL_ENTRY)>
226 
228  constexpr QuantumNumbers() noexcept
245  RATIONAL_UNDEFINED}) {}
246 
247  // Temporary initialization until there is a more reliable way to setup
248  // a full initialization for all quantum numbers but only choose a few
249  // select ones based on the problem at hand
250  constexpr QuantumNumbers(Rational J, Rational N, Rational v) noexcept
267  RATIONAL_UNDEFINED}) {}
268 
274  constexpr Rational operator[](const Index qn) const noexcept {
275  return mqnumbers[qn];
276  }
277 
283  constexpr Rational operator[](const QuantumNumberType qn) const noexcept {
284  return mqnumbers[Index(qn)];
285  }
286 
292  Rational& operator[](const Index qn) noexcept {
293  return mqnumbers[qn];
294  }
295 
301  Rational& operator[](const QuantumNumberType qn) noexcept {
302  return mqnumbers[Index(qn)];
303  }
304 
310  void Set(Index qn, Rational r) {
312  mqnumbers[qn] = r;
313  }
314 
321  assert(qn != QuantumNumberType::FINAL_ENTRY);
322  mqnumbers[Index(qn)] = r;
323  }
324 
330  void Set(String qn, Rational r) {
332  }
333 
338  const QuantumContainer& GetNumbers() const { return mqnumbers; }
339 
344  Index nNumbers() const {
345  return std::accumulate(
346  mqnumbers.cbegin(), mqnumbers.cend(), 0, [](Index i, Rational r) {
347  return r.isUndefined() ? i : i + 1;
348  });
349  }
350 
359  bool Compare(const QuantumNumbers& qn) const;
360 
361  private:
363 };
364 
366 
391  public:
393  typedef enum : Index { TRANSITION, ENERGY_LEVEL, ALL, NONE } QType;
394 
396  constexpr QuantumIdentifier() noexcept
397  : mqtype(QuantumIdentifier::NONE), mspecies(-1), miso(-1) {}
398 
406  const Index species,
407  const Index iso) noexcept
408  : mqtype(qt), mspecies(species), miso(iso) {}
409 
417  constexpr QuantumIdentifier(const Index spec,
418  const Index isot,
419  const QuantumNumbers& upper,
420  const QuantumNumbers& lower) noexcept
422  mspecies(spec),
423  miso(isot),
424  mqm({upper, lower}) {}
425 
435  const Index isot,
436  const std::vector<QuantumNumberType>& keys,
437  const std::vector<Rational>& upper,
438  const std::vector<Rational>& lower)
440  mspecies(spec),
441  miso(isot) {
442  for(size_t i=0; i<keys.size(); i++) {
443  mqm[TRANSITION_UPPER_INDEX][keys[i]] = upper[i];
444  mqm[TRANSITION_LOWER_INDEX][keys[i]] = lower[i];
445  }
446  }
447 
454  constexpr QuantumIdentifier(const Index spec,
455  const Index isot,
456  const QuantumNumbers& qnr) noexcept
458  mspecies(spec),
459  miso(isot),
460  mqm({qnr}) {}
461 
467 
469  static constexpr Index TRANSITION_UPPER_INDEX = 0;
470 
472  static constexpr Index TRANSITION_LOWER_INDEX = 1;
473 
475  static constexpr Index ENERGY_LEVEL_INDEX = 0;
476 
481  void Species(Index sp) { mspecies = sp; }
482 
488 
494  void SetTransition(const QuantumNumbers& upper, const QuantumNumbers& lower);
495 
500  void SetEnergyLevel(const QuantumNumbers& q);
501 
504 
507 
510 
515  void SetFromString(String str);
516 
523  void SetFromStringForCO2Band(String upper, String lower, String iso);
524 
526  constexpr QType Type() const { return mqtype; }
527 
529  void Type(QType x) { mqtype = x; }
530 
532  static bool validIndexForType(Index x) noexcept {
533  constexpr auto keys = stdarrayify(Index(TRANSITION), ENERGY_LEVEL, ALL, NONE);
534  return std::any_of(keys.cbegin(), keys.cend(), [x](auto y){return x == y;});
535  }
536 
538  static QType string2Type(const String& str) noexcept {
539  if (std::string("ENERGY_LEVEL") == str) {
541  } else if (std::string("TRANSITION") == str) {
543  } else if (std::string("ALL") == str) {
544  return QuantumIdentifier::ALL;
545  } else if (std::string("NONE") == str) {
547  } else {
548  return QType(-1);
549  }
550  }
551 
553  String TypeStr() const;
554 
556  String SpeciesName() const;
557 
559  constexpr Index Species() const { return mspecies; }
560 
562  Index& Species() { return mspecies; }
563 
565  constexpr Index Isotopologue() const { return miso; }
566 
568  Index& Isotopologue() { return miso; }
569 
571  const std::array<QuantumNumbers, 2>& QuantumMatch() const { return mqm; }
572 
574  std::array<QuantumNumbers, 2>& QuantumMatch() { return mqm; }
575 
577  constexpr QuantumIdentifier UpperQuantumId() const noexcept {
579  };
580 
582  constexpr QuantumIdentifier LowerQuantumId() const noexcept {
584  };
585 
587  const QuantumNumbers& UpperQuantumNumbers() const noexcept {
588  return mqm[TRANSITION_UPPER_INDEX];
589  };
590 
592  const QuantumNumbers& LowerQuantumNumbers() const noexcept {
593  return mqm[TRANSITION_LOWER_INDEX];
594  };
595 
597  constexpr Rational UpperQuantumNumber(QuantumNumberType X) const noexcept {
598  return mqm[TRANSITION_UPPER_INDEX][X];
599  };
600 
602  constexpr Rational LowerQuantumNumber(QuantumNumberType X) const noexcept {
603  return mqm[TRANSITION_LOWER_INDEX][X];
604  };
605 
608  return mqm[TRANSITION_UPPER_INDEX][X];
609  };
610 
613  return mqm[TRANSITION_LOWER_INDEX][X];
614  };
615 
617  const QuantumNumbers& EnergyLevelQuantumNumbers() const noexcept {
618  return mqm[ENERGY_LEVEL_INDEX];
619  }
620 
623  return mqm[ENERGY_LEVEL_INDEX][X];
624  };
625 
628  return mqm[TRANSITION_UPPER_INDEX];
629  };
630 
633  return mqm[TRANSITION_LOWER_INDEX];
634  };
635 
638  return mqm[ENERGY_LEVEL_INDEX];
639  }
640 
652  bool In(const QuantumIdentifier& other) const;
653 
665  bool InLower(const QuantumIdentifier& other) const;
666 
678  bool InUpper(const QuantumIdentifier& other) const;
679 
681  bool any_quantumnumbers() const;
682 
684  bool IsEnergyLevelType() const { return mqtype == ENERGY_LEVEL; }
685 
686  private:
690  std::array<QuantumNumbers, 2> mqm;
691 };
692 
702 inline bool operator==(const QuantumIdentifier& a, const QuantumIdentifier& b) {
703  if (!(a.Isotopologue() == b.Isotopologue() && a.Species() == b.Species() &&
704  a.Type() == b.Type()))
705  return false;
706 
708  return a.QuantumMatch()[a.ENERGY_LEVEL_INDEX].Compare(
710  else if (a.Type() == QuantumIdentifier::TRANSITION)
711  return a.QuantumMatch()[a.TRANSITION_LOWER_INDEX].Compare(
713  a.QuantumMatch()[a.TRANSITION_UPPER_INDEX].Compare(
715  else if (a.Type() == QuantumIdentifier::ALL)
716  return true;
717  else if (a.Type() == QuantumIdentifier::NONE)
718  return false;
719  else
720  throw std::runtime_error("Programmer error --- added type is missing");
721 }
722 
732 inline bool operator!=(const QuantumIdentifier& a, const QuantumIdentifier& b) {
733  return not operator==(a, b);
734 }
735 
743 inline bool operator==(const QuantumNumbers& a, const QuantumNumbers& b) {
744  return a.Compare(b) and b.Compare(a);
745 }
746 
748 
756 
762 
764 std::istream& operator>>(std::istream& is, QuantumNumbers& qn);
765 
767 std::ostream& operator<<(std::ostream& os, const QuantumNumbers& qn);
768 
770 std::ostream& operator<<(std::ostream& os, const QuantumIdentifier& qi);
771 
772 std::ostream& operator<<(std::ostream& os, QuantumNumberType t);
773 
782 void update_id(QuantumIdentifier& qid, const std::vector<std::array<String, 2> >& upper_list, const std::vector<std::array<String, 2> >& lower_list);
783 
784 #endif
RATIONAL_UNDEFINED
#define RATIONAL_UNDEFINED
Definition: rational.h:361
QuantumNumberType::N
@ N
QuantumIdentifier::Isotopologue
void Isotopologue(Index iso)
Set the Isotopologue.
Definition: quantum.h:487
QuantumIdentifier::ENERGY_LEVEL
@ ENERGY_LEVEL
Definition: quantum.h:393
QuantumNumbers
Container class for Quantum Numbers.
Definition: quantum.h:222
matpack.h
QuantumIdentifier
Class to identify and match lines by their quantum numbers.
Definition: quantum.h:390
QuantumNumbers::operator[]
Rational & operator[](const QuantumNumberType qn) noexcept
Access operator.
Definition: quantum.h:301
QuantumNumbers::GetNumbers
const QuantumContainer & GetNumbers() const
Get the numbers.
Definition: quantum.h:338
rational.h
Contains the rational class definition.
QuantumIdentifier::UpperQuantumId
constexpr QuantumIdentifier UpperQuantumId() const noexcept
Return a quantum identifer as if it wants to match to upper energy level.
Definition: quantum.h:577
iso
void iso(Array< IsotopologueRecord >::iterator &ii, String name, const ArrayOfNumeric &coeff, const ArrayOfNumeric &temp_range, const Index &coefftype)
Initialize isotopologue and move iterator to next one.
Definition: partition_function_data.cc:1732
QuantumNumberType::F
@ F
QuantumIdentifier::Isotopologue
constexpr Index Isotopologue() const
Return the Isotopologue by index.
Definition: quantum.h:565
QuantumNumberType::r
@ r
QuantumIdentifier::Species
constexpr Index Species() const
Return the Species by index.
Definition: quantum.h:559
QuantumIdentifier::any_quantumnumbers
bool any_quantumnumbers() const
Check if there are any quantum numbers defined.
Definition: quantum.cc:392
QuantumIdentifier::Type
void Type(QType x)
Set Type.
Definition: quantum.h:529
interpolation.h
Header file for interpolation.cc.
INPUT_QUANTUM
#define INPUT_QUANTUM(ID)
QuantumIdentifier::InLower
bool InLower(const QuantumIdentifier &other) const
Return if this is in other's lower energy state.
Definition: quantum.cc:86
QuantumIdentifier::EnergyLevelQuantumNumber
constexpr Rational EnergyLevelQuantumNumber(QuantumNumberType X) const noexcept
Return a energy level quantum number by copy.
Definition: quantum.h:622
QuantumNumberType
QuantumNumberType
Enum for Quantum Numbers used for indexing.
Definition: quantum.h:48
QuantumIdentifier::validIndexForType
static bool validIndexForType(Index x) noexcept
Checks if input is a valid Type.
Definition: quantum.h:532
operator==
bool operator==(const QuantumIdentifier &a, const QuantumIdentifier &b)
Is everything the same between the identifiers.
Definition: quantum.h:702
operator!=
bool operator!=(const QuantumIdentifier &a, const QuantumIdentifier &b)
Is anything different between the identifiers.
Definition: quantum.h:732
QuantumIdentifier::InUpper
bool InUpper(const QuantumIdentifier &other) const
Return if this is in other's upper energy state.
Definition: quantum.cc:55
ARTS::Var::y
Vector y(Workspace &ws) noexcept
Definition: autoarts.h:7401
QuantumIdentifier::TypeStr
String TypeStr() const
Definition: quantum.cc:203
QuantumNumberType::v2
@ v2
QuantumNumbers::QuantumNumbers
constexpr QuantumNumbers(Rational J, Rational N, Rational v) noexcept
Definition: quantum.h:250
IsValidQuantumNumberName
bool IsValidQuantumNumberName(String name)
Check for valid quantum number name.
Definition: quantum.cc:164
string2quantumnumbertype
QuantumNumberType string2quantumnumbertype(const String &s)
Definition: quantum.h:101
QuantumNumberType::v1
@ v1
ThrowIfQuantumNumberNameInvalid
void ThrowIfQuantumNumberNameInvalid(String name)
Check for valid quantum number name and throws if it is invalid.
Definition: quantum.cc:168
QuantumIdentifier::LowerQuantumNumber
Rational & LowerQuantumNumber(QuantumNumberType X) noexcept
Return a lower quantum number by copy.
Definition: quantum.h:612
array.h
This file contains the definition of Array.
stdarrayify
constexpr std::array< T, 1+sizeof...(Ts)> stdarrayify(const T &first, const Ts &... the_rest)
Make a std::array of a list of variables (must be 1-long at least)
Definition: array.h:374
QuantumIdentifier::ALL
@ ALL
Definition: quantum.h:393
QuantumNumbers::QuantumNumbers
constexpr QuantumNumbers() noexcept
Initializer with undefined values.
Definition: quantum.h:228
QuantumIdentifier::TRANSITION_LOWER_INDEX
static constexpr Index TRANSITION_LOWER_INDEX
Lower level index.
Definition: quantum.h:472
QuantumIdentifier::SetEnergyLevel
void SetEnergyLevel(const QuantumNumbers &q)
Set tp energy level identifier.
Definition: quantum.cc:236
QuantumIdentifier::QuantumIdentifier
QuantumIdentifier(const Index spec, const Index isot, const std::vector< QuantumNumberType > &keys, const std::vector< Rational > &upper, const std::vector< Rational > &lower)
Initialize with transition identifier type.
Definition: quantum.h:434
QuantumIdentifier::SetFromString
void SetFromString(String str)
Set from a String object.
Definition: quantum.cc:241
Array
This can be used to make arrays out of anything.
Definition: array.h:108
QuantumIdentifier::NONE
@ NONE
Definition: quantum.h:393
update_id
void update_id(QuantumIdentifier &qid, const std::vector< std::array< String, 2 > > &upper_list, const std::vector< std::array< String, 2 > > &lower_list)
Updates the quantum identifier based on a lists of strings.
Definition: quantum.cc:435
QuantumIdentifier::SpeciesName
String SpeciesName() const
Return the Species by name.
Definition: quantum.cc:225
QuantumIdentifier::TRANSITION_UPPER_INDEX
static constexpr Index TRANSITION_UPPER_INDEX
Upper level index.
Definition: quantum.h:469
QuantumIdentifier::QuantumIdentifier
constexpr QuantumIdentifier(const QuantumIdentifier::QType &qt, const Index species, const Index iso) noexcept
Initialize with no quantum numbers defined but known species and matching type.
Definition: quantum.h:405
QuantumIdentifier::Species
void Species(Index sp)
Set the Species.
Definition: quantum.h:481
QuantumIdentifier::QuantumIdentifier
constexpr QuantumIdentifier(const Index spec, const Index isot, const QuantumNumbers &upper, const QuantumNumbers &lower) noexcept
Initialize with transition identifier type.
Definition: quantum.h:417
Hund::CaseA
@ CaseA
my_basic_string< char >
QuantumIdentifier::Isotopologue
Index & Isotopologue()
Return the Isotopologue by index reference.
Definition: quantum.h:568
QuantumIdentifier::SetNone
void SetNone()
Set to NONE identifier.
Definition: quantum.h:506
QuantumIdentifier::UpperQuantumNumbers
QuantumNumbers & UpperQuantumNumbers()
Return the upper quantum numbers by reference.
Definition: quantum.h:627
quantumnumbertype2string
String quantumnumbertype2string(QuantumNumberType s)
Definition: quantum.h:162
QuantumIdentifier::mqm
std::array< QuantumNumbers, 2 > mqm
Definition: quantum.h:690
QuantumIdentifier::LowerQuantumNumber
constexpr Rational LowerQuantumNumber(QuantumNumberType X) const noexcept
Return a lower quantum number by copy.
Definition: quantum.h:602
Hund
Hund
Enum for Hund cases.
Definition: quantum.h:219
ARTS::Group::Rational
Rational Rational
Definition: autoarts.h:96
QuantumIdentifier::ENERGY_LEVEL_INDEX
static constexpr Index ENERGY_LEVEL_INDEX
Energy level index.
Definition: quantum.h:475
QuantumNumbers::Set
void Set(QuantumNumberType qn, Rational r)
Set quantum number at position.
Definition: quantum.h:320
QuantumIdentifier::LowerQuantumId
constexpr QuantumIdentifier LowerQuantumId() const noexcept
Return a quantum identifer as if it wants to match to lower energy level.
Definition: quantum.h:582
QuantumIdentifier::SetFromStringForCO2Band
void SetFromStringForCO2Band(String upper, String lower, String iso)
Set CO2 transition from String objects.
Definition: quantum.cc:341
QuantumNumbers::nNumbers
Index nNumbers() const
The number of defined quantum numbers.
Definition: quantum.h:344
QuantumIdentifier::TRANSITION
@ TRANSITION
Definition: quantum.h:393
QuantumIdentifier::mqtype
QType mqtype
Definition: quantum.h:687
operator<<
std::ostream & operator<<(std::ostream &os, const QuantumNumbers &qn)
Output operator.
Definition: quantum.cc:187
QuantumIdentifier::Type
constexpr QType Type() const
Definition: quantum.h:526
QuantumIdentifier::mspecies
Index mspecies
Definition: quantum.h:688
operator>>
std::istream & operator>>(std::istream &is, QuantumNumbers &qn)
Input operator.
Definition: quantum.cc:176
QuantumIdentifier::SetTransition
void SetTransition()
Set key to transition type.
Definition: quantum.h:509
QuantumIdentifier::LowerQuantumNumbers
const QuantumNumbers & LowerQuantumNumbers() const noexcept
Return the lower quantum numbers by const reference.
Definition: quantum.h:592
QuantumNumbers::Set
void Set(String qn, Rational r)
Set quantum number at position.
Definition: quantum.h:330
N
#define N
Definition: rng.cc:164
QuantumNumbers::QuantumContainer
std::array< Rational, Index(QuantumNumberType::FINAL_ENTRY)> QuantumContainer
Definition: quantum.h:225
q
#define q
Definition: legacy_continua.cc:21712
QuantumIdentifier::QType
QType
Ways to identify quantum numbers.
Definition: quantum.h:393
QuantumNumbers::operator[]
Rational & operator[](const Index qn) noexcept
Access operator.
Definition: quantum.h:292
QuantumIdentifier::UpperQuantumNumber
constexpr Rational UpperQuantumNumber(QuantumNumberType X) const noexcept
Return a upper quantum number by copy.
Definition: quantum.h:597
QuantumIdentifier::string2Type
static QType string2Type(const String &str) noexcept
Definition: quantum.h:538
QuantumNumbers::mqnumbers
QuantumContainer mqnumbers
Definition: quantum.h:362
ArrayOfQuantumIdentifier
Array< QuantumIdentifier > ArrayOfQuantumIdentifier
Definition: quantum.h:747
QuantumIdentifier::miso
Index miso
Definition: quantum.h:689
QuantumIdentifier::QuantumIdentifier
QuantumIdentifier(String x)
Construct a new Quantum Identifier object from text.
Definition: quantum.h:466
QuantumIdentifier::QuantumIdentifier
constexpr QuantumIdentifier(const Index spec, const Index isot, const QuantumNumbers &qnr) noexcept
Initialize with energy level identifier type.
Definition: quantum.h:454
QuantumIdentifier::IsEnergyLevelType
bool IsEnergyLevelType() const
Check if *this is a energy level type of identifier.
Definition: quantum.h:684
QuantumIdentifier::EnergyLevelQuantumNumbers
QuantumNumbers & EnergyLevelQuantumNumbers()
Return the energy level quantum numbers by reference.
Definition: quantum.h:637
QuantumNumberType::n
@ n
QuantumNumbers::Compare
bool Compare(const QuantumNumbers &qn) const
Compare Quantum Numbers Ignores any undefined numbers in the comparison.
Definition: quantum.cc:33
QuantumIdentifier::Species
Index & Species()
Return the Species by index reference.
Definition: quantum.h:562
QuantumNumberType::dN
@ dN
ArrayOfQuantumNumbers
Array< QuantumNumbers > ArrayOfQuantumNumbers
Definition: quantum.h:365
QuantumIdentifier::UpperQuantumNumber
Rational & UpperQuantumNumber(QuantumNumberType X) noexcept
Return a upper quantum number by copy.
Definition: quantum.h:607
ARTS::Var::x
Vector x(Workspace &ws) noexcept
Definition: autoarts.h:7346
Index
INDEX Index
The type to use for all integer numbers and indices.
Definition: matpack.h:39
QuantumIdentifier::EnergyLevelQuantumNumbers
const QuantumNumbers & EnergyLevelQuantumNumbers() const noexcept
Return the energy level quantum numbers by const reference.
Definition: quantum.h:617
QuantumIdentifier::QuantumIdentifier
constexpr QuantumIdentifier() noexcept
Initialize with no matches.
Definition: quantum.h:396
QuantumIdentifier::QuantumMatch
const std::array< QuantumNumbers, 2 > & QuantumMatch() const
Return the quantum numbers array const reference.
Definition: quantum.h:571
QuantumNumberType::i
@ i
M
#define M
Definition: rng.cc:165
QuantumIdentifier::In
bool In(const QuantumIdentifier &other) const
Return if this is in other.
Definition: quantum.cc:117
QuantumIdentifier::LowerQuantumNumbers
QuantumNumbers & LowerQuantumNumbers()
Return the lower quantum numbers by reference.
Definition: quantum.h:632
QuantumNumbers::Set
void Set(Index qn, Rational r)
Set quantum number at position.
Definition: quantum.h:310
QuantumNumbers::operator[]
constexpr Rational operator[](const Index qn) const noexcept
Access operator.
Definition: quantum.h:274
Rational
Implements rational numbers to work with other ARTS types.
Definition: rational.h:54
mystring.h
This file contains the definition of String, the ARTS string class.
QuantumIdentifier::UpperQuantumNumbers
const QuantumNumbers & UpperQuantumNumbers() const noexcept
Return the upper quantum numbers by const reference.
Definition: quantum.h:587
QuantumIdentifier::SetAll
void SetAll()
Set to All identifier.
Definition: quantum.h:503
QuantumNumbers::operator[]
constexpr Rational operator[](const QuantumNumberType qn) const noexcept
Access operator.
Definition: quantum.h:283
QuantumIdentifier::QuantumMatch
std::array< QuantumNumbers, 2 > & QuantumMatch()
Return the quantum numbers array reference.
Definition: quantum.h:574
QuantumNumberType::J
@ J