Miscellaneous

The function trace_over_density_matrix(rho_vectorized) allows you to compute the trace over a vectorized density matrix:

ScalarType danceq::internal::Operator::trace_over_density_matrix(const Vector<ScalarType> &rho) const

Computes the trace over this operator times a (vectorized) density matrix.

Calling this function is only possible if this Operator is of OperatorType Hamiltonian. The vectorized* density matrix needs to have the squared dimension of this operator dimension. Let \(O_{ij}\) be the matrix elements of this operator; the expectation value with respect to the density matrix \(\rho_{ij}\) is

\[\langle O\rangle_\rho = \text{Tr} \left( O\rho \right) =\sum_k \sum_l O_{kl}\rho_{lk} \,.\]

The function is compatible with MPI, and openMP. It further exploits the sparsity of the \(O\).

Parameters:

rho – vectorized density matrix

Returns:

expectation value

ScalarType danceq::internal::Operator::trace_over_density_matrix(const Vec &rho) const

Computes the trace over this operator times a (vectorized) density matrix in Petsc Vec format.

This function is only available if Petsc has been included. It is equaivelnt to trace_over_density_matrix(rho).

Parameters:

rho – vectorized density matrix as Vec

Returns:

expectation value

std::vector<std::string> danceq::internal::Operator::get_available_operators_list(void) const

Returns available local operators.

This are the keys of available_operators.

Returns:

list of operators

int32_t danceq::internal::Operator::info(void) const

Prints all information of the class.

Prints various information such as dimension, the available_operators, and all input terms from add_operator(…).

Returns:

error_code

uint64_t danceq::internal::Operator::get_dim(void) const

Returns dimension.

Returns:

dimension

bool danceq::internal::Operator::is_hermitian(void) const

Checks if the operator is hermitian (or symmetric if ScalarType is real).

\[M_{i,j} = \text{conj}\left(M_{j,i}\right) \, ,\,\forall i,j\]

Returns:

true if matrix is hermitian otherwise false

bool danceq::internal::Operator::is_diagonal(void) const

Checks if the matrix is diagonal.

\[M_{i,j} = 0 \, ,\,\forall i\neq j\]

Returns:

true if matrix is diagonal otherwise false

std::map<std::string, danceq::internal::SparseMatrix<ScalarType>> danceq::internal::Operator::get_available_operators(void) const

Returns the available operators.

Returns available_operators that act on a single site. The key value of the dictionary refers to its name, e.g., S+.

Returns:

available_operators