TRIQS/TRIQS 4.0.0
Researching Interacting Quantum Systems
Loading...
Searching...
No Matches
Atomic problem diagonalization

Detailed Description

Exact diagonalization of atomic (local) Hamiltonians and their atomic Green's function.

The Atomic problem diagonalization module performs exact diagonalization of a many-body Hamiltonian \( \hat H \) acting on the Fock space of a finite set of fermionic single-particle states. The Hilbert space is split into invariant subspaces of \( \hat H \), each of which is diagonalized independently:

\[ H_B = U_B \, \mathrm{diag}(E_B) \, U^{\dagger}_B \; , \]

where \( B \) indexes the subspaces, \( H_B \) is the Hamiltonian restricted to the subspace, \( U_B \) is the unitary matrix mapping the Fock basis of the subspace to the eigenbasis of the Hamiltonian, and \( E_B \) is the vector of eigenvalues. By convention the global ground-state energy is subtracted at construction, so that the smallest eigenvalue across all subspaces is zero.

The invariant subspaces are built either by an auto-partition procedure, by an explicit list of quantum-number operators, or by a particle-number window, and each block is then diagonalized with the QR algorithm.

Notation used throughout the API:

  • \( B,\, B' \) : subspace index (parameter sp_index),
  • \( \dim(B) \) : dimension of subspace \( B \), returned by triqs::atom_diag::atom_diag::get_subspace_dim,
  • \( E_{B,i} \) : the \( i \)-th eigenvalue inside subspace \( B \),
  • \( N \) : dimension of the full Hilbert space.

Atomic Green's function.

Derived from a solved diagonalization problem, the atomic Green's function is built in the Lehmann (spectral) representation,

\[ G_{ab}(z) = \frac{1}{Z} \sum_{B, B'} \sum_{i=0}^{\dim(B)-1} \sum_{j=0}^{\dim(B')-1} \Bigl( e^{-\beta E_{B,i}} + \eta\, e^{-\beta E_{B',j}} \Bigr) \frac{\langle B, i\,|\, \hat c_a \,|\, B', j\rangle \, \langle B', j\,|\, \hat c_b^\dagger \,|\, B, i\rangle} {z + E_{B,i} - E_{B',j}} \; , \]

where \( \eta = +1 \) for fermionic and \( \eta = -1 \) for bosonic statistics, \( Z \) is the partition function, \( B, B' \) are subspace indices, and \( i, j \) are eigenstate indices inside the corresponding subspaces with \( 0 \le i < \dim(B) \) and \( 0 \le j < \dim(B') \). The orbital indices \( a, b \) run over one Green's-function block and are mapped to fundamental-operator linear indices through the fundamental operator set. The only non-zero contributions come from \( (B, B') \) pairs that are connected by the application of a creation/annihilation operator, i.e. for which the corresponding matrix block is non-zero.

The poles

\[ p = E_{B',j} - E_{B,i} \]

and the residues

\[ r_p = \bigl(e^{-\beta E_{B,i}} + \eta\, e^{-\beta E_{B',j}}\bigr) \langle B, i\,|\, \hat c_a \,|\, B', j\rangle \langle B', j\,|\, \hat c_b^\dagger \,|\, B, i\rangle / Z \]

are first stored in the Lehmann data structure, then evaluated on the requested target mesh (imaginary time, Matsubara, Legendre, or real frequency).

The solver itself is exposed through triqs::atom_diag::atom_diag (with real- and complex-valued specializations); a set of free functions builds thermodynamic averages, quantum-number tables and the atomic Green's function on different meshes from a solved instance.

Classes

class  triqs::atom_diag::atom_diag< Complex >
 Lightweight exact diagonalization solver for finite fermionic Hamiltonians. More...

Typedefs

using triqs::atom_diag::excluded_states_t = std::vector<std::pair<int, int>>
 List of excluded eigenstates.
template<bool Complex>
using triqs::atom_diag::gf_lehmann_t = std::vector<matrix<gf_scalar_lehmann_t<Complex>>>
 Lehmann representation of a block matrix-valued Green's function.
template<bool Complex>
using triqs::atom_diag::gf_scalar_lehmann_t = std::vector<std::pair<double, typename atom_diag<Complex>::scalar_t>>
 Lehmann representation of a single matrix element of the Green's function.
using triqs::atom_diag::indices_t = fundamental_operator_set::indices_t
 Index type used by the fundamental operator set associated with the diagonalization problem.
using triqs::atom_diag::quantum_number_t = double
 Type used to store quantum-number values. Quantum-number operators are Hermitian, so their eigenvalues are real.

Functions

template<bool Complex>
atom_diag< Complex >::full_hilbert_space_state_t triqs::atom_diag::act (typename atom_diag< Complex >::many_body_op_t const &op, typename atom_diag< Complex >::full_hilbert_space_state_t const &st, atom_diag< Complex > const &atom)
 Act with a many-body operator on a state vector, \( |\psi'\rangle = \hat O\, |\psi\rangle \).
template<bool Complex>
atom_diag< Complex >::block_matrix_t triqs::atom_diag::atomic_density_matrix (atom_diag< Complex > const &atom, double beta)
 Compute the atomic density matrix at inverse temperature \( \beta \).
template<bool Complex>
block_gf< imfreqtriqs::atom_diag::atomic_g_iw (atom_diag< Complex > const &atom, double beta, gf_struct_t const &gf_struct, int n_iw, excluded_states_t const &excluded_states={})
 Build the atomic Matsubara Green's function directly from a solved diagonalization problem.
template<bool Complex>
block_gf< imfreqtriqs::atom_diag::atomic_g_iw (gf_lehmann_t< Complex > const &lehmann, gf_struct_t const &gf_struct, imfreq const &mesh)
 Build the atomic Matsubara Green's function from a precomputed Lehmann representation.
template<bool Complex>
block_gf< legendretriqs::atom_diag::atomic_g_l (atom_diag< Complex > const &atom, double beta, gf_struct_t const &gf_struct, int n_l, excluded_states_t const &excluded_states={})
 Build the atomic Green's function in the Legendre basis directly from a solved diagonalization problem.
template<bool Complex>
block_gf< legendretriqs::atom_diag::atomic_g_l (gf_lehmann_t< Complex > const &lehmann, gf_struct_t const &gf_struct, legendre const &mesh)
 Build the atomic Green's function in the Legendre basis from a precomputed Lehmann representation.
template<bool Complex>
gf_lehmann_t< Complex > triqs::atom_diag::atomic_g_lehmann (atom_diag< Complex > const &atom, double beta, gf_struct_t const &gf_struct, excluded_states_t excluded_states={})
 Build the Lehmann representation of the atomic Green's function.
template<bool Complex>
block_gf< imtimetriqs::atom_diag::atomic_g_tau (atom_diag< Complex > const &atom, double beta, gf_struct_t const &gf_struct, int n_tau, excluded_states_t const &excluded_states={})
 Build the atomic imaginary-time Green's function directly from a solved diagonalization problem.
template<bool Complex>
block_gf< imtimetriqs::atom_diag::atomic_g_tau (gf_lehmann_t< Complex > const &lehmann, gf_struct_t const &gf_struct, imtime const &mesh)
 Build the atomic imaginary-time Green's function from a precomputed Lehmann representation.
template<bool Complex>
block_gf< refreqtriqs::atom_diag::atomic_g_w (atom_diag< Complex > const &atom, double beta, gf_struct_t const &gf_struct, std::pair< double, double > const &energy_window, int n_w, double broadening=0, excluded_states_t const &excluded_states={})
 Build the atomic retarded Green's function on a real-frequency mesh directly from a solved diagonalization problem.
template<bool Complex>
block_gf< refreqtriqs::atom_diag::atomic_g_w (gf_lehmann_t< Complex > const &lehmann, gf_struct_t const &gf_struct, refreq const &mesh, double broadening=0)
 Build the atomic retarded Green's function on a real-frequency mesh from a precomputed Lehmann representation.
template<bool Complex>
double triqs::atom_diag::partition_function (atom_diag< Complex > const &atom, double beta)
 Compute the atomic partition function at inverse temperature \( \beta \).
template<bool Complex>
std::vector< std::vector< quantum_number_t > > triqs::atom_diag::quantum_number_eigenvalues (typename atom_diag< Complex >::many_body_op_t const &op, atom_diag< Complex > const &atom)
 Tabulate the eigenvalues \( q_{B,i} = \langle B,i\,|\,\hat Q\,|\,B,i\rangle \) of a quantum-number operator \( \hat Q \) over all eigenstates of the Hamiltonian.
template<bool Complex>
std::vector< std::vector< quantum_number_t > > triqs::atom_diag::quantum_number_eigenvalues_checked (typename atom_diag< Complex >::many_body_op_t const &op, atom_diag< Complex > const &atom)
 Tabulate the eigenvalues \( q_{B,i} \) of a quantum-number operator \( \hat Q \), also checking that the operator is diagonal in the eigenbasis.
template<bool Complex>
atom_diag< Complex >::scalar_t triqs::atom_diag::trace_rho_op (typename atom_diag< Complex >::block_matrix_t const &density_matrix, typename atom_diag< Complex >::many_body_op_t const &op, atom_diag< Complex > const &atom)
 Compute the trace of a many-body operator weighted by a block-diagonal density matrix.

Typedef Documentation

◆ excluded_states_t

using triqs::atom_diag::excluded_states_t = std::vector<std::pair<int, int>>

#include <triqs/atom_diag/gf.hpp>

List of excluded eigenstates.

Given as \( (B, i) \) pairs (subspace index \( B \) and eigenstate index \( i \) inside the subspace, with \( 0 \le i < \dim(B) \)). Excluded states do not contribute to the Lehmann sum.

Definition at line 74 of file gf.hpp.

◆ gf_lehmann_t

template<bool Complex>
using triqs::atom_diag::gf_lehmann_t = std::vector<matrix<gf_scalar_lehmann_t<Complex>>>

#include <triqs/atom_diag/gf.hpp>

Lehmann representation of a block matrix-valued Green's function.

Outer list indexed by Green's-function block (per gf_struct), inner matrix indexed by orbital pair (a, b) inside the block; each matrix entry is the Lehmann representation of \( G_{ab}(z) \) for the corresponding orbital pair.

Definition at line 66 of file gf.hpp.

◆ gf_scalar_lehmann_t

template<bool Complex>
using triqs::atom_diag::gf_scalar_lehmann_t = std::vector<std::pair<double, typename atom_diag<Complex>::scalar_t>>

#include <triqs/atom_diag/gf.hpp>

Lehmann representation of a single matrix element of the Green's function.

A list of pole and residue pairs with pole

\[ p = E_{B',j} - E_{B,i} \]

and residue

\[ r_ p = \bigl(e^{-\beta E_{B,i}} + \eta\, e^{-\beta E_{B',j}}\bigr) \langle B, i\,|\, \hat c_a \,|\, B', j\rangle \langle B', j\,|\, \hat c_b^\dagger \,|\, B, i\rangle / Z \]

.

Definition at line 57 of file gf.hpp.

Function Documentation

◆ act()

template<bool Complex>
atom_diag< Complex >::full_hilbert_space_state_t triqs::atom_diag::act ( typename atom_diag< Complex >::many_body_op_t const & op,
typename atom_diag< Complex >::full_hilbert_space_state_t const & st,
atom_diag< Complex > const & atom )

#include <triqs/atom_diag/functions.hpp>

Act with a many-body operator on a state vector, \( |\psi'\rangle = \hat O\, |\psi\rangle \).

Both the input and the output state are vectors in the full Hilbert space expressed in the eigenbasis of the Hamiltonian. The operator is converted internally into its block-matrix representation in the eigenbasis before being applied to the state. Block-wise, for every source subspace \( B \) with target subspace \( B' \),

\[ \psi'_{B'} \mathrel{+}= O_{B' \leftarrow B}\, \psi_{B}. \]

Template Parameters
ComplexSpecialization of the diagonalization problem (real or complex Hamiltonian).
Parameters
opMany-body operator to apply.
stInput state vector in the full Hilbert space, expressed in the eigenbasis of the Hamiltonian.
atomSolved diagonalization problem providing the eigenbasis.
Returns
Output state vector in the full Hilbert space, expressed in the eigenbasis of the Hamiltonian.

◆ atomic_density_matrix()

template<bool Complex>
atom_diag< Complex >::block_matrix_t triqs::atom_diag::atomic_density_matrix ( atom_diag< Complex > const & atom,
double beta )

#include <triqs/atom_diag/functions.hpp>

Compute the atomic density matrix at inverse temperature \( \beta \).

Returns the Gibbs density matrix \( \hat\rho = e^{-\beta \hat H} / Z \) as a block-diagonal matrix, with one diagonal block per invariant subspace \( B \). The density matrix is expressed in the eigenbasis, hence each block is itself diagonal,

\[ \rho_B = \mathrm{diag}\!\Bigl( e^{-\beta E_{B,i}} / Z \Bigr)_{i=0}^{\dim(B)-1}. \]

Template Parameters
ComplexSpecialization of the diagonalization problem (real or complex Hamiltonian).
Parameters
atomSolved diagonalization problem.
betaInverse temperature \( \beta > 0 \).
Returns
Gibbs density matrix of the system, as a list of diagonal blocks indexed by subspace index \( B \).

Definition at line 51 of file functions.cpp.

◆ atomic_g_iw() [1/2]

template<bool Complex>
block_gf< imfreq > triqs::atom_diag::atomic_g_iw ( atom_diag< Complex > const & atom,
double beta,
gf_struct_t const & gf_struct,
int n_iw,
excluded_states_t const & excluded_states = {} )

#include <triqs/atom_diag/gf.hpp>

Build the atomic Matsubara Green's function directly from a solved diagonalization problem.

Internally builds the Lehmann representation and evaluates

\[ G(i\omega) = \sum_p \frac{r_p}{i\omega - p} \]

on the requested mesh.

Template Parameters
ComplexSpecialization of the diagonalization problem (real or complex Hamiltonian).
Parameters
atomSolved diagonalization problem.
betaInverse temperature \( \beta > 0 \).
gf_structBlock structure of the Green's function: block name -> list of inner indices.
n_iwNumber of positive Matsubara frequencies.
excluded_statesEigenstates to exclude from the Lehmann sum, as \( (B, i) \) pairs.
Returns
Atomic Green's function \( G_{ab}(i\omega) \).

Definition at line 225 of file gf.cpp.

◆ atomic_g_iw() [2/2]

template<bool Complex>
block_gf< imfreq > triqs::atom_diag::atomic_g_iw ( gf_lehmann_t< Complex > const & lehmann,
gf_struct_t const & gf_struct,
imfreq const & mesh )

#include <triqs/atom_diag/gf.hpp>

Build the atomic Matsubara Green's function from a precomputed Lehmann representation.

For each \( (p, r_p) \) in the Lehmann representation, the evaluator is

\[ G(i\omega) = \sum_p \frac{r_p}{i\omega - p}. \]

Template Parameters
ComplexType of the Lehmann residues (real or complex).
Parameters
lehmannLehmann representation of the Green's function.
gf_structBlock structure of the Green's function: block name -> list of inner indices.
meshMatsubara mesh used to evaluate the Green's function.
Returns
Atomic Green's function \( G_{ab}(i\omega) \).

◆ atomic_g_l() [1/2]

template<bool Complex>
block_gf< legendre > triqs::atom_diag::atomic_g_l ( atom_diag< Complex > const & atom,
double beta,
gf_struct_t const & gf_struct,
int n_l,
excluded_states_t const & excluded_states = {} )

#include <triqs/atom_diag/gf.hpp>

Build the atomic Green's function in the Legendre basis directly from a solved diagonalization problem.

Internally builds the Lehmann representation and evaluates the corresponding Legendre coefficients

\[ G_\ell = \sqrt{2\ell + 1}\, \int_0^\beta d\tau\, P_\ell(2\tau/\beta - 1)\, G(\tau) \;. \]

Template Parameters
ComplexSpecialization of the diagonalization problem (real or complex Hamiltonian).
Parameters
atomSolved diagonalization problem.
betaInverse temperature \( \beta > 0 \).
gf_structBlock structure of the Green's function: block name -> list of inner indices.
n_lNumber of Legendre coefficients to compute.
excluded_statesEigenstates to exclude from the Lehmann sum, as \( (B, i) \) pairs.
Returns
Atomic Green's function \( G_{ab}(\ell) \).

Definition at line 268 of file gf.cpp.

◆ atomic_g_l() [2/2]

template<bool Complex>
block_gf< legendre > triqs::atom_diag::atomic_g_l ( gf_lehmann_t< Complex > const & lehmann,
gf_struct_t const & gf_struct,
legendre const & mesh )

#include <triqs/atom_diag/gf.hpp>

Build the atomic Green's function in the Legendre basis from a precomputed Lehmann representation.

The Legendre coefficients are obtained from the imaginary-time form by the standard projection

\[ G_\ell = \sqrt{2\ell + 1}\, \int_0^\beta d\tau\, P_\ell(2\tau/\beta - 1)\, G(\tau) \;. \]

Template Parameters
ComplexType of the Lehmann residues (real or complex).
Parameters
lehmannLehmann representation of the Green's function.
gf_structBlock structure of the Green's function: block name -> list of inner indices.
meshLegendre mesh used to evaluate the Green's function.
Returns
Atomic Green's function \( G_{ab}(\ell) \).

◆ atomic_g_lehmann()

template<bool Complex>
gf_lehmann_t< Complex > triqs::atom_diag::atomic_g_lehmann ( atom_diag< Complex > const & atom,
double beta,
gf_struct_t const & gf_struct,
excluded_states_t excluded_states = {} )

#include <triqs/atom_diag/gf.hpp>

Build the Lehmann representation of the atomic Green's function.

Iterates over every pair of eigenstates \( (B, i) \), \( (B', j) \) of the Hamiltonian (subject to the non-zero connection constraint) and collects all non-vanishing pole - residue pairs \( (p, r_p) \). The resulting structure can then be evaluated on any of the supported target meshes via the corresponding builders.

Template Parameters
ComplexSpecialization of the diagonalization problem (real or complex Hamiltonian).
Parameters
atomSolved diagonalization problem.
betaInverse temperature \( \beta > 0 \).
gf_structBlock structure of the Green's function: block name -> list of inner indices.
excluded_statesEigenstates to exclude from the Lehmann sum, as \( (B, i) \) pairs.
Returns
Atomic Green's function in the Lehmann representation.

Definition at line 108 of file gf.cpp.

◆ atomic_g_tau() [1/2]

template<bool Complex>
block_gf< imtime > triqs::atom_diag::atomic_g_tau ( atom_diag< Complex > const & atom,
double beta,
gf_struct_t const & gf_struct,
int n_tau,
excluded_states_t const & excluded_states = {} )

#include <triqs/atom_diag/gf.hpp>

Build the atomic imaginary-time Green's function directly from a solved diagonalization problem.

Internally builds the Lehmann representation and evaluates it on the requested mesh,

\[ G(\tau) = \sum_p r_p \, \frac{-e^{-\tau p}}{1 + e^{-\beta p}}, \quad \tau \in [0, \beta]. \]

Template Parameters
ComplexSpecialization of the diagonalization problem (real or complex Hamiltonian).
Parameters
atomSolved diagonalization problem.
betaInverse temperature \( \beta > 0 \).
gf_structBlock structure of the Green's function: block name -> list of inner indices.
n_tauNumber of imaginary-time points.
excluded_statesEigenstates to exclude from the Lehmann sum, as \( (B, i) \) pairs.
Returns
Atomic Green's function \( G_{ab}(\tau) \).

Definition at line 188 of file gf.cpp.

◆ atomic_g_tau() [2/2]

template<bool Complex>
block_gf< imtime > triqs::atom_diag::atomic_g_tau ( gf_lehmann_t< Complex > const & lehmann,
gf_struct_t const & gf_struct,
imtime const & mesh )

#include <triqs/atom_diag/gf.hpp>

Build the atomic imaginary-time Green's function from a precomputed Lehmann representation.

For each \( (p, r_p) \) in the Lehmann representation, the fermionic imaginary-time evaluator is

\[ G(\tau) = \sum_p r_p \, \frac{-e^{-\tau p}}{1 + e^{-\beta p}}, \quad \tau \in [0, \beta]. \]

Template Parameters
ComplexType of the Lehmann residues (real or complex).
Parameters
lehmannLehmann representation of the Green's function.
gf_structBlock structure of the Green's function: block name -> list of inner indices.
meshImaginary-time mesh used to evaluate the Green's function.
Returns
Atomic Green's function \( G_{ab}(\tau) \).

◆ atomic_g_w() [1/2]

template<bool Complex>
block_gf< refreq > triqs::atom_diag::atomic_g_w ( atom_diag< Complex > const & atom,
double beta,
gf_struct_t const & gf_struct,
std::pair< double, double > const & energy_window,
int n_w,
double broadening = 0,
excluded_states_t const & excluded_states = {} )

#include <triqs/atom_diag/gf.hpp>

Build the atomic retarded Green's function on a real-frequency mesh directly from a solved diagonalization problem.

Internally builds the Lehmann representation, constructs a real-frequency mesh from the requested energy window and number of frequency points, and evaluates

\[ G(\omega) = \sum_p \frac{r_p}{\omega + i\eta - p} \; , \]

with the broadening \( \eta \).

Template Parameters
ComplexSpecialization of the diagonalization problem (real or complex Hamiltonian).
Parameters
atomSolved diagonalization problem.
betaInverse temperature \( \beta > 0 \).
gf_structBlock structure of the Green's function: block name -> list of inner indices.
energy_windowEnergy window \( (\omega_{\text{min}}, \omega_{\text{max}}) \) of the real-frequency mesh.
n_wNumber of frequency points.
broadeningLorentzian broadening \( \eta \) of the spectrum (small positive imaginary-frequency shift).
excluded_statesEigenstates to exclude from the Lehmann sum, as \( (B, i) \) pairs.
Returns
Atomic Green's function \( G_{ab}(\omega) \).

Definition at line 305 of file gf.cpp.

◆ atomic_g_w() [2/2]

template<bool Complex>
block_gf< refreq > triqs::atom_diag::atomic_g_w ( gf_lehmann_t< Complex > const & lehmann,
gf_struct_t const & gf_struct,
refreq const & mesh,
double broadening = 0 )

#include <triqs/atom_diag/gf.hpp>

Build the atomic retarded Green's function on a real-frequency mesh from a precomputed Lehmann representation.

For each \( (p, r_p) \) in the Lehmann representation, the retarded evaluator is

\[ G(\omega) = \sum_p \frac{r_p}{\omega + i\eta - p} \; , \]

with the broadening \( \eta \).

Template Parameters
ComplexType of the Lehmann residues (real or complex).
Parameters
lehmannLehmann representation of the Green's function.
gf_structBlock structure of the Green's function: block name -> list of inner indices.
meshReal-frequency mesh used to evaluate the Green's function.
broadeningLorentzian broadening \( \eta \) of the spectrum (small positive imaginary-frequency shift).
Returns
Atomic Green's function \( G_{ab}(\omega) \).

◆ partition_function()

template<bool Complex>
double triqs::atom_diag::partition_function ( atom_diag< Complex > const & atom,
double beta )

#include <triqs/atom_diag/functions.hpp>

Compute the atomic partition function at inverse temperature \( \beta \).

Sums the Boltzmann weights of all eigenstates of the Hamiltonian,

\[ Z = \sum_{B} \sum_{i=0}^{\dim(B)-1} e^{-\beta E_{B,i}}, \]

where the eigenvalues \( E_{B,i} \) are taken with respect to the ground-state energy as zero.

Template Parameters
ComplexSpecialization of the diagonalization problem (real or complex Hamiltonian).
Parameters
atomSolved diagonalization problem.
betaInverse temperature \( \beta > 0 \).
Returns
Value of the partition function \( Z \).

Definition at line 42 of file functions.cpp.

◆ quantum_number_eigenvalues()

template<bool Complex>
std::vector< std::vector< quantum_number_t > > triqs::atom_diag::quantum_number_eigenvalues ( typename atom_diag< Complex >::many_body_op_t const & op,
atom_diag< Complex > const & atom )

#include <triqs/atom_diag/functions.hpp>

Tabulate the eigenvalues \( q_{B,i} = \langle B,i\,|\,\hat Q\,|\,B,i\rangle \) of a quantum-number operator \( \hat Q \) over all eigenstates of the Hamiltonian.

Assumes that \( \hat Q \) is a quantum number, i.e. that it commutes with \( \hat H \) and is therefore block-diagonal in the eigenbasis with diagonal blocks. The diagonal entries are returned, grouped by invariant subspace \( B \). Use quantum_number_eigenvalues_checked for a variant that explicitly verifies the block-diagonal property.

Template Parameters
ComplexSpecialization of the diagonalization problem (real or complex Hamiltonian).
Parameters
opObservable operator; expected to be a quantum number (otherwise an exception is raised).
atomSolved diagonalization problem.
Returns
Eigenvalues \( q_{B,i} \) grouped by invariant subspace \( B \).

◆ quantum_number_eigenvalues_checked()

template<bool Complex>
std::vector< std::vector< quantum_number_t > > triqs::atom_diag::quantum_number_eigenvalues_checked ( typename atom_diag< Complex >::many_body_op_t const & op,
atom_diag< Complex > const & atom )

#include <triqs/atom_diag/functions.hpp>

Tabulate the eigenvalues \( q_{B,i} \) of a quantum-number operator \( \hat Q \), also checking that the operator is diagonal in the eigenbasis.

Same as quantum_number_eigenvalues, but also verifies that the supplied operator is diagonal in the eigenbasis of the Hamiltonian. If it is not, an exception is raised. Useful when constructing a quantum number from scratch and one wants to confirm that it really is a conserved quantity of atom.

Template Parameters
ComplexSpecialization of the diagonalization problem (real or complex Hamiltonian).
Parameters
opObservable operator; expected to be a quantum number (otherwise an exception is raised).
atomSolved diagonalization problem.
Returns
Eigenvalues \( q_{B,i} \) grouped by invariant subspace \( B \).

◆ trace_rho_op()

template<bool Complex>
atom_diag< Complex >::scalar_t triqs::atom_diag::trace_rho_op ( typename atom_diag< Complex >::block_matrix_t const & density_matrix,
typename atom_diag< Complex >::many_body_op_t const & op,
atom_diag< Complex > const & atom )

#include <triqs/atom_diag/functions.hpp>

Compute the trace of a many-body operator weighted by a block-diagonal density matrix.

Evaluates

\[ \mathrm{Tr}\,(\hat\rho\, \hat O) = \sum_{B} \mathrm{Tr}\,(\rho_B\, O_{BB}), \]

where \( \hat\rho \) is provided as a list of diagonal blocks (one per invariant subspace of atom) and only the diagonal blocks \( O_{BB} \) of \( \hat O \) contribute. Useful for computing expectation values of arbitrary observables once a density matrix has been built.

Template Parameters
ComplexSpecialization of the diagonalization problem (real or complex Hamiltonian).
Parameters
density_matrixDensity matrix as a list of diagonal blocks, indexed by subspace index \( B \).
opOperator to be averaged.
atomSolved diagonalization problem.
Returns
Expectation value of \( \hat O \) under the given density matrix.

Definition at line 70 of file functions.cpp.