ARTS  2.3.1285(git:92a29ea9-dirty)
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 ( )
inlinenoexcept

Initialize with no matches.

Definition at line 396 of file quantum.h.

◆ QuantumIdentifier() [2/6]

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

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 
)
inlinenoexcept

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 i.

◆ QuantumIdentifier() [5/6]

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

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.

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, FINAL_ENTRY, NONE, and TRANSITION.

◆ EnergyLevelQuantumNumber()

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

Return a energy level quantum number by copy.

Definition at line 622 of file quantum.h.

◆ EnergyLevelQuantumNumbers() [1/2]

const QuantumNumbers& QuantumIdentifier::EnergyLevelQuantumNumbers ( ) const
inlinenoexcept

Return the energy level quantum numbers by const reference.

Definition at line 617 of file quantum.h.

Referenced by abs_linesKeepBands().

◆ EnergyLevelQuantumNumbers() [2/2]

QuantumNumbers& QuantumIdentifier::EnergyLevelQuantumNumbers ( )
inline

Return the energy level quantum numbers by reference.

Definition at line 637 of file quantum.h.

◆ 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, FINAL_ENTRY, i, miso, mqm, mqtype, mspecies, NONE, and TRANSITION.

Referenced by abs_linesChangeBaseParameterForMatchingLines(), abs_linesChangeLineShapeModelParameterForMatchingLines(), abs_linesRemoveBand(), abs_linesSetBaseParameterForMatchingLines(), abs_linesSetCutoffForMatch(), abs_linesSetLinemixingLimitForMatch(), abs_linesSetLineShapeModelParameterForMatchingLines(), abs_linesSetLineShapeTypeForMatch(), abs_linesSetMirroringForMatch(), abs_linesSetNormalizationForMatch(), abs_linesSetPopulationForMatch(), abs_linesSetT0ForMatch(), and nlteSetByQuantumIdentifiers().

◆ 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, FINAL_ENTRY, miso, mqm, mqtype, mspecies, NONE, and TRANSITION.

◆ 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, FINAL_ENTRY, miso, mqm, mqtype, mspecies, NONE, and TRANSITION.

◆ IsEnergyLevelType()

bool QuantumIdentifier::IsEnergyLevelType ( ) const
inline

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

Definition at line 684 of file quantum.h.

◆ Isotopologue() [1/3]

◆ Isotopologue() [2/3]

constexpr Index QuantumIdentifier::Isotopologue ( ) const
inline

Return the Isotopologue by index.

Definition at line 565 of file quantum.h.

◆ Isotopologue() [3/3]

Index& QuantumIdentifier::Isotopologue ( )
inline

Return the Isotopologue by index reference.

Definition at line 568 of file quantum.h.

◆ LowerQuantumId()

constexpr QuantumIdentifier QuantumIdentifier::LowerQuantumId ( ) const
inlinenoexcept

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

Definition at line 582 of file quantum.h.

Referenced by nlteSetByQuantumIdentifiers().

◆ LowerQuantumNumber() [1/2]

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

◆ LowerQuantumNumber() [2/2]

Rational& QuantumIdentifier::LowerQuantumNumber ( QuantumNumberType  X)
inlinenoexcept

Return a lower quantum number by copy.

Definition at line 612 of file quantum.h.

◆ LowerQuantumNumbers() [1/2]

◆ LowerQuantumNumbers() [2/2]

QuantumNumbers& QuantumIdentifier::LowerQuantumNumbers ( )
inline

Return the lower quantum numbers by reference.

Definition at line 632 of file quantum.h.

◆ QuantumMatch() [1/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.

Referenced by line_match_level(), line_match_line(), operator<<(), and operator==().

◆ QuantumMatch() [2/2]

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

Return the quantum numbers array reference.

Definition at line 574 of file quantum.h.

◆ SetAll()

void QuantumIdentifier::SetAll ( )
inline

Set to All identifier.

Definition at line 503 of file quantum.h.

References ALL.

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, 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 my_basic_string< charT >::nelem().

◆ SetNone()

void QuantumIdentifier::SetNone ( )
inline

Set to NONE identifier.

Definition at line 506 of file quantum.h.

References NONE.

◆ SetTransition() [1/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 TRANSITION.

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

◆ SetTransition() [2/2]

void QuantumIdentifier::SetTransition ( )
inline

Set key to transition type.

Definition at line 509 of file quantum.h.

References iso(), and TRANSITION.

◆ Species() [1/3]

◆ Species() [2/3]

constexpr Index QuantumIdentifier::Species ( ) const
inline

Return the Species by index.

Definition at line 559 of file quantum.h.

◆ Species() [3/3]

Index& QuantumIdentifier::Species ( )
inline

Return the Species by index reference.

Definition at line 562 of file quantum.h.

◆ SpeciesName()

String QuantumIdentifier::SpeciesName ( ) const

Return the Species by name.

Definition at line 225 of file quantum.cc.

References 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
inline

◆ Type() [2/2]

void QuantumIdentifier::Type ( QType  x)
inline

Set Type.

Definition at line 529 of file quantum.h.

◆ TypeStr()

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

Definition at line 203 of file quantum.cc.

References ALL, ENERGY_LEVEL, NONE, and TRANSITION.

◆ UpperQuantumId()

constexpr QuantumIdentifier QuantumIdentifier::UpperQuantumId ( ) const
inlinenoexcept

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

Definition at line 577 of file quantum.h.

Referenced by nlteSetByQuantumIdentifiers().

◆ UpperQuantumNumber() [1/2]

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

◆ UpperQuantumNumber() [2/2]

Rational& QuantumIdentifier::UpperQuantumNumber ( QuantumNumberType  X)
inlinenoexcept

Return a upper quantum number by copy.

Definition at line 607 of file quantum.h.

◆ UpperQuantumNumbers() [1/2]

◆ UpperQuantumNumbers() [2/2]

QuantumNumbers& QuantumIdentifier::UpperQuantumNumbers ( )
inline

Return the upper quantum numbers by reference.

Definition at line 627 of file quantum.h.

◆ validIndexForType()

static bool QuantumIdentifier::validIndexForType ( Index  x)
inlinestaticnoexcept

Checks if input is a valid Type.

Definition at line 532 of file quantum.h.

References stdarrayify().

Member Data Documentation

◆ ENERGY_LEVEL_INDEX

constexpr Index QuantumIdentifier::ENERGY_LEVEL_INDEX = 0
static

Energy level index.

Definition at line 475 of file quantum.h.

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

◆ miso

Index QuantumIdentifier::miso
private

Definition at line 689 of file quantum.h.

Referenced by In(), InLower(), and InUpper().

◆ mqm

std::array<QuantumNumbers, 2> QuantumIdentifier::mqm
private

Definition at line 690 of file quantum.h.

Referenced by In(), InLower(), and InUpper().

◆ mqtype

QType QuantumIdentifier::mqtype
private

Definition at line 687 of file quantum.h.

Referenced by In(), InLower(), and InUpper().

◆ mspecies

Index QuantumIdentifier::mspecies
private

Definition at line 688 of file quantum.h.

Referenced by In(), InLower(), and InUpper().

◆ TRANSITION_LOWER_INDEX

constexpr Index QuantumIdentifier::TRANSITION_LOWER_INDEX = 1
static

Lower level index.

Definition at line 472 of file quantum.h.

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

◆ TRANSITION_UPPER_INDEX

constexpr Index QuantumIdentifier::TRANSITION_UPPER_INDEX = 0
static

Upper level index.

Definition at line 469 of file quantum.h.

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


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