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
qOperatorfor theith andjth symmetry basis.- Parameters:
opr – : Matrix object
i – :
ith symmetry blockj – :
jth symmetry block
-
inline std::optional<qmatrix<double>*> get(size_t i, size_t j)#
This function returns the
qmatrixpointer for the sub-blockiandj. 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
qOperatorby theUmatrix. TheUmatrix is a block-diagonal matrix ofqmatrixtype. TheqOperatoris 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 << qOperatoror any otherostreamobject.- Parameters:
out – The output stream.
val – The
qOperatorto print.
- Returns:
The modified output stream.
-
qOperator() = default#