Class qOperator#
Defined in File qOperator.hpp
Class Documentation#
-
class qOperator#
Represents a quantum operator in a block-diagonal form.
This class provides methods to manipulate and display quantum operators used in the NRG calculations.
Public Functions
-
qOperator() = default#
-
inline auto getMap()#
Get the internal Storage object of the
qmatrix
- Returns:
std::map<std::array<size_t, 2>, qmatrix<>>
-
inline void set(const qmatrix<double> &opr, size_t i, size_t j)#
Set the
qOperator
for thei
th andj
th symmetry basis.- Parameters:
opr – : Matrix object
i – :
i
th symmetry blockj – :
j
th symmetry block
-
inline std::optional<qmatrix<double>*> get(size_t i, size_t j)#
This function returns the
qmatrix
pointer for the sub-blocki
andj
. If the sub-block is not found, it returns an emptystd::optional
.- Parameters:
i – The index of the block to be returned.
j – The index of the block to be returned.
- Returns:
std::optional<qmatrix>
-
inline void unitaryTransform(qOperator &U)#
This function unitary transform the
qOperator
by theU
matrix. TheU
matrix is a block-diagonal matrix ofqmatrix
type. TheqOperator
is transformed as \f U^\dagger \cdot qOperator \cdot U \f- Parameters:
U – The unitary matrix to transform the
qOperator
. Usually we get this matrix after diagonalization of the Hamiltonian.
-
inline void clear()#
Clears the storage for the operator.
This method removes all stored matrix elements and resets the operator.
Friends
-
inline friend std::ostream &operator<<(std::ostream &out, const qOperator &val)#
Overloads the stream insertion operator for
qOperator
.Allows the use of
std::cout << qOperator
or any otherostream
object.- Parameters:
out – The output stream.
val – The
qOperator
to print.
- Returns:
The modified output stream.
-
qOperator() = default#