QuantumNumbers.hpp
251 PetscInt istart_ = 0;
254 PetscInt iend_ = 0;
260 PetscInt blockidx_ = 0;
263 PetscInt locidx_ = 0;
338 ierr = QN.OpBlockToGlobalRange(blockidx_, BlockShift, GlobIdxStart, GlobIdxEnd, flg); CHKERRQ(ierr);
PetscInt Offsets(const PetscInt &idx) const
Returns the offsets for the quantum number block with a specified index.
Definition: QuantumNumbers.hpp:117
Contains information on quantum numbers and associated index ranges.
Definition: QuantumNumbers.hpp:30
PetscInt Steps() const
Gets the number of steps incremented from the starting index.
Definition: QuantumNumbers.hpp:319
QuantumNumbersIterator(const QuantumNumbers &QN_in, const PetscInt &GlobIdxStart, const PetscInt &GlobIdxEnd)
Initialize an iterator through a range of indices.
Definition: QuantumNumbers.hpp:279
const QuantumNumbers & QN
Reference to the Quantum Numbers object on which this iterator is based on.
Definition: QuantumNumbers.hpp:248
PetscInt OpBlockToGlobalRangeStart(const PetscInt &BlockIdx, const PetscInt &BlockShift, PetscBool &flg) const
Maps the shifted quantum number block index to the global index start in the range [start...
Definition: QuantumNumbers.hpp:169
const std::vector< PetscReal > & ListRef() const
Returns the list of quantum numbers as a const reference.
Definition: QuantumNumbers.hpp:93
bool Loop() const
Determines whether the end of the range has not yet been reached.
Definition: QuantumNumbers.hpp:316
MPI_Comm MPIComm() const
Gets the communicator associated to the block.
Definition: QuantumNumbers.hpp:76
PetscInt IdxEnd() const
Gets the first quantum number block index.
Definition: QuantumNumbers.hpp:310
std::vector< PetscInt > qn_offset
Offset for each quantum number block.
Definition: QuantumNumbers.hpp:45
PetscErrorCode QNToGlobalRange(const PetscReal &QNValue, PetscInt &GlobIdxStart, PetscInt &GlobIdxEnd) const
Maps the quantum number value to the global indices [start,end)
Definition: QuantumNumbers.cpp:99
std::vector< PetscReal > List() const
Returns the list of quantum numbers.
Definition: QuantumNumbers.hpp:86
PetscInt Sizes(const PetscInt &idx) const
Returns the number of basis states in each quantum number block.
Definition: QuantumNumbers.hpp:134
PetscInt IdxStart() const
Gets the first quantum number block index.
Definition: QuantumNumbers.hpp:307
PetscErrorCode BlockIdxToGlobalIdx(const PetscInt &BlockIdx, const PetscInt &LocIdx, PetscInt &GlobIdx) const
Maps the block index of a basis state to its global index.
Definition: QuantumNumbers.cpp:175
PetscErrorCode OpBlockToGlobalRange(const PetscInt &BlockShift, PetscInt &GlobIdxStart, PetscInt &GlobIdxEnd, PetscBool &flg) const
Interfaced function OpBlockToGlobalRange from the Quantum Numbers class with current block index as i...
Definition: QuantumNumbers.hpp:330
std::vector< PetscInt > Sizes() const
Returns the number of basis states in each quantum number block.
Definition: QuantumNumbers.hpp:127
std::vector< PetscInt > Offsets() const
Returns the offsets for each quantum number block.
Definition: QuantumNumbers.hpp:110
Iterates over a range of basis indices with information on each of its quantum number.
Definition: QuantumNumbers.hpp:243
PetscInt BlockIdx() const
Gets the current quantum number block index.
Definition: QuantumNumbers.hpp:304
PetscErrorCode BlockIdxToGlobalRange(const PetscInt &BlockIdx, PetscInt &GlobIdxStart, PetscInt &GlobIdxEnd) const
Maps the quantum number block index to the global indices [start,end)
Definition: QuantumNumbers.cpp:53
std::vector< PetscInt > qn_size
Number of states in each quantum number block.
Definition: QuantumNumbers.hpp:48
PetscErrorCode OpBlockToGlobalRange(const PetscInt &BlockIdx, const PetscInt &BlockShift, PetscInt &GlobIdxStart, PetscInt &GlobIdxEnd, PetscBool &flg) const
Maps the shifted quantum number block index to the global indices [start,end).
Definition: QuantumNumbers.cpp:72
PetscInt LocIdx() const
Gets the current local index in the quantum number block.
Definition: QuantumNumbers.hpp:313
PetscErrorCode PrintQNs()
Prints out the full list of quantum numbers contained in the root process.
Definition: QuantumNumbers.hpp:222
PetscInt NumSectors() const
Returns the number of quantum number sectors.
Definition: QuantumNumbers.hpp:79
PetscErrorCode GlobalIdxToBlockIdx(const PetscInt &GlobIdx, PetscInt &BlockIdx) const
Maps the global index of a basis state to its block index.
Definition: QuantumNumbers.cpp:122
PetscErrorCode GlobalIdxToQN(const PetscInt &GlobIdx, PetscReal &QNValue) const
Maps the global index of a basis state to its quantum number.
Definition: QuantumNumbers.cpp:158
PetscErrorCode Initialize(const MPI_Comm &mpi_comm_in, const std::vector< PetscReal > &qn_list_in, const std::vector< PetscInt > &qn_size_in)
Initializes the quantum number object.
Definition: QuantumNumbers.cpp:9
PetscReal List(const PetscInt &idx) const
Returns the quantum number associated to the given index.
Definition: QuantumNumbers.hpp:100
QuantumNumbersIterator(const QuantumNumbers &QN_in)
Initialize an iterator through all quantum numbers.
Definition: QuantumNumbers.hpp:271
PetscErrorCode CheckInitialized() const
Checks whether quantum number object was properly initialized.
Definition: QuantumNumbers.hpp:67