ARTS  2.4.0(git:4fb77825)
QuantumIdentifier Class Reference

Class to identify and match lines by their quantum numbers. More...

#include <quantum.h>

Public Types

enum  QType : Index { TRANSITION, ENERGY_LEVEL, ALL, NONE }
 Ways to identify quantum numbers. More...
 

Public Member Functions

constexpr QuantumIdentifier () noexcept
 Initialize with no matches. More...
 
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. More...
 
constexpr QuantumIdentifier (const Index spec, const Index isot, const QuantumNumbers &upper, const QuantumNumbers &lower) noexcept
 Initialize with transition identifier type. More...
 
 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. More...
 
constexpr QuantumIdentifier (const Index spec, const Index isot, const QuantumNumbers &qnr) noexcept
 Initialize with energy level identifier type. More...
 
 QuantumIdentifier (String x)
 Construct a new Quantum Identifier object from text. More...
 
void Species (Index sp)
 Set the Species. More...
 
void Isotopologue (Index iso)
 Set the Isotopologue. More...
 
void SetTransition (const QuantumNumbers &upper, const QuantumNumbers &lower)
 Set to transition type identifier. More...
 
void SetEnergyLevel (const QuantumNumbers &q)
 Set tp energy level identifier. More...
 
void SetAll ()
 Set to All identifier. More...
 
void SetNone ()
 Set to NONE identifier. More...
 
void SetTransition ()
 Set key to transition type. More...
 
void SetFromString (String str)
 Set from a String object. More...
 
void SetFromStringForCO2Band (String upper, String lower, String iso)
 Set CO2 transition from String objects. More...
 
constexpr QType Type () const
 
void Type (QType x)
 Set Type. More...
 
String TypeStr () const
 
String SpeciesName () const
 Return the Species by name. More...
 
constexpr Index Species () const
 Return the Species by index. More...
 
IndexSpecies ()
 Return the Species by index reference. More...
 
constexpr Index Isotopologue () const
 Return the Isotopologue by index. More...
 
IndexIsotopologue ()
 Return the Isotopologue by index reference. More...
 
const std::array< QuantumNumbers, 2 > & QuantumMatch () const
 Return the quantum numbers array const reference. More...
 
std::array< QuantumNumbers, 2 > & QuantumMatch ()
 Return the quantum numbers array reference. More...
 
constexpr QuantumIdentifier UpperQuantumId () const noexcept
 Return a quantum identifer as if it wants to match to upper energy level. More...
 
constexpr QuantumIdentifier LowerQuantumId () const noexcept
 Return a quantum identifer as if it wants to match to lower energy level. More...
 
const QuantumNumbersUpperQuantumNumbers () const noexcept
 Return the upper quantum numbers by const reference. More...
 
const QuantumNumbersLowerQuantumNumbers () const noexcept
 Return the lower quantum numbers by const reference. More...
 
constexpr Rational UpperQuantumNumber (QuantumNumberType X) const noexcept
 Return a upper quantum number by copy. More...
 
constexpr Rational LowerQuantumNumber (QuantumNumberType X) const noexcept
 Return a lower quantum number by copy. More...
 
RationalUpperQuantumNumber (QuantumNumberType X) noexcept
 Return a upper quantum number by copy. More...
 
RationalLowerQuantumNumber (QuantumNumberType X) noexcept
 Return a lower quantum number by copy. More...
 
const QuantumNumbersEnergyLevelQuantumNumbers () const noexcept
 Return the energy level quantum numbers by const reference. More...
 
constexpr Rational EnergyLevelQuantumNumber (QuantumNumberType X) const noexcept
 Return a energy level quantum number by copy. More...
 
QuantumNumbersUpperQuantumNumbers ()
 Return the upper quantum numbers by reference. More...
 
QuantumNumbersLowerQuantumNumbers ()
 Return the lower quantum numbers by reference. More...
 
QuantumNumbersEnergyLevelQuantumNumbers ()
 Return the energy level quantum numbers by reference. More...
 
bool In (const QuantumIdentifier &other) const
 Return if this is in other. More...
 
bool InLower (const QuantumIdentifier &other) const
 Return if this is in other's lower energy state. More...
 
bool InUpper (const QuantumIdentifier &other) const
 Return if this is in other's upper energy state. More...
 
bool any_quantumnumbers () const
 Check if there are any quantum numbers defined. More...
 
bool IsEnergyLevelType () const
 Check if *this is a energy level type of identifier. More...
 

Static Public Member Functions

static bool validIndexForType (Index x) noexcept
 Checks if input is a valid Type. More...
 
static QType string2Type (const String &str) noexcept
 

Static Public Attributes

static constexpr Index TRANSITION_UPPER_INDEX = 0
 Upper level index. More...
 
static constexpr Index TRANSITION_LOWER_INDEX = 1
 Lower level index. More...
 
static constexpr Index ENERGY_LEVEL_INDEX = 0
 Energy level index. More...
 

Private Attributes

QType mqtype
 
Index mspecies
 
Index miso
 
std::array< QuantumNumbers, 2 > mqm
 

Detailed Description

Class to identify and match lines by their quantum numbers.

Describes a transition, an energy level, all numbers or none as matchable. Useful to match to line energy levels and to identify lines themselves.

For transitions, the QI contains upper and lower quantum numbers. For energy levels, it only holds one set of quantum numbers which are then matched against the upper and lower qns of the lines. For all and none no quantum numbers are considered

File format: Transition: SPECIES_NAME-ISOTOPE TR UP QUANTUMNUMBERS LO QUANTUMNUMBERS Energy level: SPECIES_NAME-ISOTOPE EN QUANTUMNUMBERS All lines: SPECIES_NAME-ISOTOPE ALL No lines: SPECIES_NAME-ISOTOPE NONE

Example written out: H2O-161 TR UP J 0/1 v1 2/3 LO J 1/1 v2 1/2 H2O-161 EN J 0/1 v1 2/3 H2O-161 ALL H2O-161 NONE

Definition at line 390 of file quantum.h.

Member Enumeration Documentation

◆ QType

Ways to identify quantum numbers.

Enumerator
TRANSITION 
ENERGY_LEVEL 
ALL 
NONE 

Definition at line 393 of file quantum.h.

Constructor & Destructor Documentation

◆ QuantumIdentifier() [1/6]

constexpr QuantumIdentifier::QuantumIdentifier ( )
inlineconstexprnoexcept

Initialize with no matches.

Definition at line 396 of file quantum.h.

Referenced by LowerQuantumId(), and UpperQuantumId().

◆ QuantumIdentifier() [2/6]

constexpr QuantumIdentifier::QuantumIdentifier ( const QuantumIdentifier::QType qt,
const Index  species,
const Index  iso 
)
inlineconstexprnoexcept

Initialize with no quantum numbers defined but known species and matching type.

Parameters
[in]qtWay to identify quantum numbers
[in]speciesSpecies index-mapped
[in]isoIsotopologue index-mapped

Definition at line 405 of file quantum.h.

◆ QuantumIdentifier() [3/6]

constexpr QuantumIdentifier::QuantumIdentifier ( const Index  spec,
const Index  isot,
const QuantumNumbers upper,
const QuantumNumbers lower 
)
inlineconstexprnoexcept

Initialize with transition identifier type.

Parameters
[in]speciesSpecies index-mapped
[in]isoIsotopologue index-mapped
[in]upperUpper state quantum numbers
[in]lowerLower state quantum numbers

Definition at line 417 of file quantum.h.

◆ QuantumIdentifier() [4/6]

QuantumIdentifier::QuantumIdentifier ( const Index  spec,
const Index  isot,
const std::vector< QuantumNumberType > &  keys,
const std::vector< Rational > &  upper,
const std::vector< Rational > &  lower 
)
inline

Initialize with transition identifier type.

Parameters
[in]speciesSpecies index-mapped
[in]isoIsotopologue index-mapped
[in]idsList of quantum number keys
[in]upperUpper state quantum numbers
[in]lowerLower state quantum numbers

Definition at line 434 of file quantum.h.

References mqm, TRANSITION_LOWER_INDEX, and TRANSITION_UPPER_INDEX.

◆ QuantumIdentifier() [5/6]

constexpr QuantumIdentifier::QuantumIdentifier ( const Index  spec,
const Index  isot,
const QuantumNumbers qnr 
)
inlineconstexprnoexcept

Initialize with energy level identifier type.

Parameters
[in]speciesSpecies index-mapped
[in]isoIsotopologue index-mapped
[in]qnrQuantum numbers

Definition at line 454 of file quantum.h.

◆ QuantumIdentifier() [6/6]

QuantumIdentifier::QuantumIdentifier ( String  x)
inlineexplicit

Construct a new Quantum Identifier object from text.

Parameters
[in]xText

Definition at line 466 of file quantum.h.

References SetFromString(), and ARTS::Var::x().

Member Function Documentation

◆ any_quantumnumbers()

bool QuantumIdentifier::any_quantumnumbers ( ) const

Check if there are any quantum numbers defined.

Definition at line 392 of file quantum.cc.

References ALL, ENERGY_LEVEL, J, mqm, mqtype, NONE, and TRANSITION.

◆ EnergyLevelQuantumNumber()

constexpr Rational QuantumIdentifier::EnergyLevelQuantumNumber ( QuantumNumberType  X) const
inlineconstexprnoexcept

Return a energy level quantum number by copy.

Definition at line 622 of file quantum.h.

References ENERGY_LEVEL_INDEX, and mqm.

◆ EnergyLevelQuantumNumbers() [1/2]

QuantumNumbers& QuantumIdentifier::EnergyLevelQuantumNumbers ( )
inline

Return the energy level quantum numbers by reference.

Definition at line 637 of file quantum.h.

References ENERGY_LEVEL_INDEX, and mqm.

◆ EnergyLevelQuantumNumbers() [2/2]

const QuantumNumbers& QuantumIdentifier::EnergyLevelQuantumNumbers ( ) const
inlinenoexcept

Return the energy level quantum numbers by const reference.

Definition at line 617 of file quantum.h.

References ENERGY_LEVEL_INDEX, and mqm.

Referenced by abs_linesKeepBands().

◆ In()

bool QuantumIdentifier::In ( const QuantumIdentifier other) const

Return if this is in other.

All quantum numbers defined in *this must be the same as the quantum numbers in other for a call to In() to return true. The numbers in other must not all be defined in *this.

Parameters
[in]otherAnother quantum identifier
Returns
true If the above description holds
false Otherwise

Definition at line 117 of file quantum.cc.

References ALL, ENERGY_LEVEL_INDEX, J, miso, mqm, mqtype, mspecies, NONE, TRANSITION, TRANSITION_LOWER_INDEX, and TRANSITION_UPPER_INDEX.

Referenced by abs_linesRemoveBand(), abs_linesSetCutoffForMatch(), abs_linesSetLinemixingLimitForMatch(), abs_linesSetLineShapeTypeForMatch(), abs_linesSetMirroringForMatch(), abs_linesSetNormalizationForMatch(), abs_linesSetPopulationForMatch(), and abs_linesSetT0ForMatch().

◆ InLower()

bool QuantumIdentifier::InLower ( const QuantumIdentifier other) const

Return if this is in other's lower energy state.

All quantum numbers defined in *this must be the same as the quantum numbers in other for a call to In() to return true. The numbers in other must not all be defined in *this.

Parameters
[in]otherAnother quantum identifier
Returns
true If the above description holds
false Otherwise

Definition at line 86 of file quantum.cc.

References ALL, ENERGY_LEVEL, ENERGY_LEVEL_INDEX, J, miso, mqm, mqtype, mspecies, NONE, TRANSITION, and TRANSITION_LOWER_INDEX.

◆ InUpper()

bool QuantumIdentifier::InUpper ( const QuantumIdentifier other) const

Return if this is in other's upper energy state.

All quantum numbers defined in *this must be the same as the quantum numbers in other for a call to In() to return true. The numbers in other must not all be defined in *this.

Parameters
[in]otherAnother quantum identifier
Returns
true If the above description holds
false Otherwise

Definition at line 55 of file quantum.cc.

References ALL, ENERGY_LEVEL, ENERGY_LEVEL_INDEX, J, miso, mqm, mqtype, mspecies, NONE, TRANSITION, and TRANSITION_UPPER_INDEX.

◆ IsEnergyLevelType()

bool QuantumIdentifier::IsEnergyLevelType ( ) const
inline

Check if *this is a energy level type of identifier.

Definition at line 684 of file quantum.h.

References ENERGY_LEVEL, and mqtype.

◆ Isotopologue() [1/3]

Index& QuantumIdentifier::Isotopologue ( )
inline

Return the Isotopologue by index reference.

Definition at line 568 of file quantum.h.

References miso.

◆ Isotopologue() [2/3]

constexpr Index QuantumIdentifier::Isotopologue ( ) const
inlineconstexpr

Return the Isotopologue by index.

Definition at line 565 of file quantum.h.

References miso.

Referenced by SetFromString().

◆ Isotopologue() [3/3]

void QuantumIdentifier::Isotopologue ( Index  iso)
inline

◆ LowerQuantumId()

constexpr QuantumIdentifier QuantumIdentifier::LowerQuantumId ( ) const
inlineconstexprnoexcept

Return a quantum identifer as if it wants to match to lower energy level.

Definition at line 582 of file quantum.h.

References miso, mqm, mspecies, QuantumIdentifier(), and TRANSITION_LOWER_INDEX.

◆ LowerQuantumNumber() [1/2]

constexpr Rational QuantumIdentifier::LowerQuantumNumber ( QuantumNumberType  X) const
inlineconstexprnoexcept

◆ LowerQuantumNumber() [2/2]

Rational& QuantumIdentifier::LowerQuantumNumber ( QuantumNumberType  X)
inlinenoexcept

Return a lower quantum number by copy.

Definition at line 612 of file quantum.h.

References mqm, and TRANSITION_LOWER_INDEX.

◆ LowerQuantumNumbers() [1/2]

QuantumNumbers& QuantumIdentifier::LowerQuantumNumbers ( )
inline

Return the lower quantum numbers by reference.

Definition at line 632 of file quantum.h.

References mqm, and TRANSITION_LOWER_INDEX.

◆ LowerQuantumNumbers() [2/2]

const QuantumNumbers& QuantumIdentifier::LowerQuantumNumbers ( ) const
inlinenoexcept

◆ QuantumMatch() [1/2]

std::array<QuantumNumbers, 2>& QuantumIdentifier::QuantumMatch ( )
inline

Return the quantum numbers array reference.

Definition at line 574 of file quantum.h.

References mqm.

◆ QuantumMatch() [2/2]

const std::array<QuantumNumbers, 2>& QuantumIdentifier::QuantumMatch ( ) const
inline

Return the quantum numbers array const reference.

Definition at line 571 of file quantum.h.

References mqm.

Referenced by operator<<(), operator==(), and SetFromString().

◆ SetAll()

void QuantumIdentifier::SetAll ( )
inline

Set to All identifier.

Definition at line 503 of file quantum.h.

References ALL, and mqtype.

Referenced by jacobianAddAbsSpecies().

◆ SetEnergyLevel()

void QuantumIdentifier::SetEnergyLevel ( const QuantumNumbers q)

Set tp energy level identifier.

Parameters
[in]qQuantum numbers

Definition at line 236 of file quantum.cc.

References ENERGY_LEVEL, ENERGY_LEVEL_INDEX, mqm, mqtype, and q.

◆ SetFromString()

void QuantumIdentifier::SetFromString ( String  str)

◆ SetFromStringForCO2Band()

void QuantumIdentifier::SetFromStringForCO2Band ( String  upper,
String  lower,
String  iso 
)

Set CO2 transition from String objects.

Parameters
[in]upperUpper state quantum numbers
[in]lowerLower state quantum numbers
[in]isoIsotopologue by string

Definition at line 341 of file quantum.cc.

References iso(), my_basic_string< charT >::nelem(), and SetFromString().

◆ SetNone()

void QuantumIdentifier::SetNone ( )
inline

Set to NONE identifier.

Definition at line 506 of file quantum.h.

References mqtype, and NONE.

◆ SetTransition() [1/2]

void QuantumIdentifier::SetTransition ( )
inline

Set key to transition type.

Definition at line 509 of file quantum.h.

References mqtype, and TRANSITION.

◆ SetTransition() [2/2]

void QuantumIdentifier::SetTransition ( const QuantumNumbers upper,
const QuantumNumbers lower 
)

Set to transition type identifier.

Parameters
[in]upperUpper state quantum numbers
[in]lowerLower state quantum numbers

Definition at line 229 of file quantum.cc.

References mqm, mqtype, TRANSITION, TRANSITION_LOWER_INDEX, and TRANSITION_UPPER_INDEX.

Referenced by abs_linesKeepBands(), QuantumParserHITRAN2004::Parse(), and Absorption::Lines::truncate_global_quantum_numbers().

◆ Species() [1/3]

Index& QuantumIdentifier::Species ( )
inline

Return the Species by index reference.

Definition at line 562 of file quantum.h.

References mspecies.

◆ Species() [2/3]

constexpr Index QuantumIdentifier::Species ( ) const
inlineconstexpr

Return the Species by index.

Definition at line 559 of file quantum.h.

References mspecies.

Referenced by SetFromString().

◆ Species() [3/3]

◆ SpeciesName()

String QuantumIdentifier::SpeciesName ( ) const

Return the Species by name.

Definition at line 225 of file quantum.cc.

References mspecies, and species_name_from_species_index().

◆ string2Type()

static QType QuantumIdentifier::string2Type ( const String str)
inlinestaticnoexcept
Returns
QType if string is a Type or -1 if not

Definition at line 538 of file quantum.h.

References ALL, ENERGY_LEVEL, NONE, and TRANSITION.

◆ Type() [1/2]

constexpr QType QuantumIdentifier::Type ( ) const
inlineconstexpr

◆ Type() [2/2]

void QuantumIdentifier::Type ( QType  x)
inline

Set Type.

Definition at line 529 of file quantum.h.

References mqtype, and ARTS::Var::x().

◆ TypeStr()

String QuantumIdentifier::TypeStr ( ) const
Returns
QType as String

Definition at line 203 of file quantum.cc.

References ALL, ENERGY_LEVEL, mqtype, NONE, and TRANSITION.

◆ UpperQuantumId()

constexpr QuantumIdentifier QuantumIdentifier::UpperQuantumId ( ) const
inlineconstexprnoexcept

Return a quantum identifer as if it wants to match to upper energy level.

Definition at line 577 of file quantum.h.

References miso, mqm, mspecies, QuantumIdentifier(), and TRANSITION_UPPER_INDEX.

◆ UpperQuantumNumber() [1/2]

constexpr Rational QuantumIdentifier::UpperQuantumNumber ( QuantumNumberType  X) const
inlineconstexprnoexcept

◆ UpperQuantumNumber() [2/2]

Rational& QuantumIdentifier::UpperQuantumNumber ( QuantumNumberType  X)
inlinenoexcept

Return a upper quantum number by copy.

Definition at line 607 of file quantum.h.

References mqm, and TRANSITION_UPPER_INDEX.

◆ UpperQuantumNumbers() [1/2]

QuantumNumbers& QuantumIdentifier::UpperQuantumNumbers ( )
inline

Return the upper quantum numbers by reference.

Definition at line 627 of file quantum.h.

References mqm, and TRANSITION_UPPER_INDEX.

◆ UpperQuantumNumbers() [2/2]

const QuantumNumbers& QuantumIdentifier::UpperQuantumNumbers ( ) const
inlinenoexcept

◆ validIndexForType()

static bool QuantumIdentifier::validIndexForType ( Index  x)
inlinestaticnoexcept

Checks if input is a valid Type.

Definition at line 532 of file quantum.h.

References ALL, ENERGY_LEVEL, NONE, stdarrayify(), TRANSITION, ARTS::Var::x(), and ARTS::Var::y().

Member Data Documentation

◆ ENERGY_LEVEL_INDEX

constexpr Index QuantumIdentifier::ENERGY_LEVEL_INDEX = 0
staticconstexpr

Energy level index.

Definition at line 475 of file quantum.h.

Referenced by EnergyLevelQuantumNumber(), EnergyLevelQuantumNumbers(), In(), InLower(), InUpper(), operator<<(), operator==(), and SetEnergyLevel().

◆ miso

Index QuantumIdentifier::miso
private

Definition at line 689 of file quantum.h.

Referenced by In(), InLower(), InUpper(), Isotopologue(), LowerQuantumId(), and UpperQuantumId().

◆ mqm

◆ mqtype

QType QuantumIdentifier::mqtype
private

◆ mspecies

Index QuantumIdentifier::mspecies
private

Definition at line 688 of file quantum.h.

Referenced by In(), InLower(), InUpper(), LowerQuantumId(), Species(), SpeciesName(), and UpperQuantumId().

◆ TRANSITION_LOWER_INDEX

constexpr Index QuantumIdentifier::TRANSITION_LOWER_INDEX = 1
staticconstexpr

◆ TRANSITION_UPPER_INDEX

constexpr Index QuantumIdentifier::TRANSITION_UPPER_INDEX = 0
staticconstexpr

The documentation for this class was generated from the following files: