TRIQS/TRIQS 4.0.0
Researching Interacting Quantum Systems
Loading...
Searching...
No Matches
triqs::atom_diag::atom_diag< Complex >

#include <triqs/atom_diag/atom_diag.hpp>

Detailed Description

template<bool Complex>
class triqs::atom_diag::atom_diag< Complex >

Lightweight exact diagonalization solver for finite fermionic Hamiltonians.

Perform 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.

After construction the solver exposes

  • the eigenvalues \( E_B \) and unitary matrix \( U_B \) of every invariant subspace \( B \),
  • the matrix blocks of every fundamental creation/annihilation operator \( \hat c_i, \hat c^\dagger_i \) in the eigenbasis, where \( i \) is the linear index of the operator in the fundamental operator set,
  • the subspace-to-subspace connections induced by every fundamental creation/annihilation operator, i.e. the index of the subspace that each operator maps a given subspace to (or \( -1 \) if it annihilates it),
  • convenience routines that turn a generic many-body operator into a block-matrix representation in the eigenbasis.

Two specializations are provided, one for real-valued and one for complex-valued Hamiltonians.

Template Parameters
ComplexAllow the Hamiltonian to be complex-valued.

Definition at line 91 of file atom_diag.hpp.

Classes

struct  eigensystem_t
 Eigensystem of a single invariant subspace of the Hamiltonian \( H_B \). More...
struct  op_block_mat_t
 Block-matrix representation of an operator \( \hat{O} \) that respects the block structure of the Hamiltonian. More...

Public Types

using block_matrix_t = std::vector<matrix_t>
 Block-diagonal matrix type, one dense block per invariant subspace.
using fops_data_t = triqs::hilbert_space::fundamental_operator_set::data_t
 Data type of a fundamental operator set.
using full_hilbert_space_state_t = vector<scalar_t>
 State vector type of the full Hilbert space.
using many_body_op_t = triqs::operators::many_body_operator_generic<scalar_t>
 Many-body operator type compatible with scalar_t.
using matrix_t = matrix<scalar_t>
 Dense matrix type with scalar entries of type scalar_t.
using scalar_t = std::conditional_t<Complex, std::complex<double>, double>
 Scalar type of the matrix elements: double or std::complex<double>.

Public Member Functions

 atom_diag ()=default
 Default constructor leaves the solver in an uninitialized state.
 atom_diag (many_body_op_t const &h, fundamental_operator_set const &fops)
 Reduce a Hamiltonian to a block-diagonal form using auto-partitioning, then diagonalize the blocks.
 atom_diag (many_body_op_t const &h, fundamental_operator_set const &fops, int n_min, int n_max)
 Diagonalize a Hamiltonian restricted to a particle-number window.
 atom_diag (many_body_op_t const &h, fundamental_operator_set const &fops, many_body_op_t const &hyb)
 Reduce a Hamiltonian to a block-diagonal form using auto-partitioning refined by a hybridization term.
 atom_diag (many_body_op_t const &h, fundamental_operator_set const &fops, std::initializer_list< many_body_op_t > const &init_lst)
 Initializer-list overload of atom_diag(many_body_op_t const &, fundamental_operator_set const &, std::vector<many_body_op_t> const &).
 atom_diag (many_body_op_t const &h, fundamental_operator_set const &fops, std::vector< many_body_op_t > const &qn_vector)
 Reduce a Hamiltonian to a block-diagonal form using user-supplied quantum numbers, then diagonalize the blocks.
long c_connection (int op_linear_index, int sp_index) const
 Get the target subspace \( B' \) of the annihilation operator \( \hat c_i \) acting on subspace \( B \).
matrix_t const & c_matrix (int op_linear_index, int sp_index) const
 Get the matrix block of the annihilation operator \( \hat c_i \) acting on subspace \( B \).
long cdag_connection (int op_linear_index, int sp_index) const
 Get the target subspace \( B' \) of the creation operator \( \hat c^\dagger_i \) acting on subspace \( B \).
matrix_t const & cdag_matrix (int op_linear_index, int sp_index) const
 Get the matrix block of the creation operator \( \hat c^\dagger_i \) acting on subspace \( B \).
int flatten_subspace_index (int sp_index, int i) const
 Map a subspace-local pair \( (B, i) \) to its linear index in the full Hilbert space.
std::vector< eigensystem_t > const & get_eigensystems () const
 Get the eigensystems of all invariant subspaces.
double get_eigenvalue (int sp_index, int i) const
 Get the eigenvalue \( E_{B,i} \) of the Hamiltonian.
std::vector< std::vector< double > > get_energies () const
 Get all eigenvalues \( E_{B,i} \) grouped by invariant subspace.
std::vector< std::vector< fock_state_t > > get_fock_states () const
 Get the Fock states of every invariant subspace.
std::vector< fock_state_t > const & get_fock_states (int sp_index) const
 Get the Fock states spanning invariant subspace \( B \).
fundamental_operator_set const & get_fops () const
 Get the fundamental operator set used at construction.
fops_data_t const & get_fops_as_data () const
 Get the data of the fundamental operator set used at construction.
class hilbert_space const & get_full_hilbert_space () const
 Get the full Hilbert space over which the diagonalization problem is defined.
int get_full_hilbert_space_dim () const
 Get the dimension of the full Hilbert space.
double get_gs_energy () const
 Get the ground-state energy, i.e. the minimum eigenvalue across all invariant subspaces.
many_body_op_t const & get_h_atomic () const
 Get the Hamiltonian used at construction, with its native scalar type.
operators::many_body_operator get_h_atomic_as_mbop () const
 Get the Hamiltonian used at construction as a generic many-body operator.
std::pair< int, matrix_tget_matrix_element_of_monomial (operators::monomial_t const &op_vec, int B) const
 Get the matrix representation of a monomial operator restricted to source subspace \( B \).
op_block_mat_t get_op_mat (many_body_op_t const &op) const
 Get the block-matrix representation of a generic many-body operator.
std::vector< std::vector< quantum_number_t > > const & get_quantum_numbers () const
 Get the values of all quantum-number operators, grouped by invariant subspace.
int get_subspace_dim (int sp_index) const
 Get the dimension \( \dim(B) \) of invariant subspace \( B \).
std::vector< int > get_subspace_dims () const
 Get the dimensions \( \dim(B) \) of all invariant subspaces.
std::vector< matrix< scalar_t > > get_unitary_matrices () const
 Get the unitary matrices \( U_B \) for every invariant subspace.
matrix< scalar_t > const & get_unitary_matrix (int sp_index) const
 Get the unitary matrix \( U_B \) mapping the Fock basis of subspace \( B \) to its eigenbasis.
full_hilbert_space_state_t const & get_vacuum_state () const
 Get the vacuum state as a vector in the full Hilbert space.
long get_vacuum_subspace_index () const
 Get the index of the invariant subspace containing the vacuum state.
range index_range_of_subspace (int sp_index) const
 Get the range of full-Hilbert-space indices corresponding to subspace \( B \).
int n_subspaces () const
 Get the number of invariant subspaces produced by the chosen partitioning scheme.
bool operator== (atom_diag const &rhs) const =default
 Default equal-to operator compares all data members.

Static Public Member Functions

static std::string hdf5_format ()
 Get the HDF5 format tag ("AtomDiagReal" or "AtomDiagComplex").

Constructor & Destructor Documentation

◆ atom_diag() [1/5]

template<bool Complex>
triqs::atom_diag::atom_diag< Complex >::atom_diag ( many_body_op_t const & h,
fundamental_operator_set const & fops )

Reduce a Hamiltonian to a block-diagonal form using auto-partitioning, then diagonalize the blocks.

Uses the auto-partition procedure to detect the invariant subspaces of the Hamiltonian, and the QR algorithm to diagonalize each block. The invariant subspaces are chosen such that every fundamental creation and annihilation operator from the provided fundamental operator set maps each subspace to a single subspace (or annihilates it).

Parameters
hMany-body Hamiltonian \( \hat H \) to be diagonalized.
fopsFundamental operator set; must at least contain every fundamental operator appearing in \( \hat H \).

◆ atom_diag() [2/5]

template<bool Complex>
triqs::atom_diag::atom_diag< Complex >::atom_diag ( many_body_op_t const & h,
fundamental_operator_set const & fops,
many_body_op_t const & hyb )

Reduce a Hamiltonian to a block-diagonal form using auto-partitioning refined by a hybridization term.

Behaves like the two-argument auto-partition constructor, but the partition is required to remain invariant under the additional many-body operator \( \hat V \) as well. This is useful when the Hamiltonian on its own would yield invariant subspaces that mix when an extra (e.g. hybridization) operator acts, leading to matrix blocks that are coarser than what \( \hat H \) alone would suggest.

Parameters
hMany-body Hamiltonian \( \hat H \) to be diagonalized.
fopsFundamental operator set; must at least contain every fundamental operator appearing in \( \hat H \).
hybAdditional many-body operator \( \hat V \) that the auto-partition must respect; every fundamental operator appearing in \( \hat V \) must also belong to the fundamental operator set.

◆ atom_diag() [3/5]

template<bool Complex>
triqs::atom_diag::atom_diag< Complex >::atom_diag ( many_body_op_t const & h,
fundamental_operator_set const & fops,
int n_min,
int n_max )

Diagonalize a Hamiltonian restricted to a particle-number window.

Builds the invariant subspaces by total particle number and keeps only those whose number of particles lies in the inclusive window \( [n_{\text{min}}, n_{\text{max}}] \). The blocks are then diagonalized with the QR algorithm. Convenient when only a few sectors of fixed occupation are physically relevant.

Parameters
hMany-body Hamiltonian \( \hat H \) to be diagonalized.
fopsFundamental operator set; must at least contain every fundamental operator appearing in \( \hat H \).
n_minMinimum total particle number to keep.
n_maxMaximum total particle number to keep.

◆ atom_diag() [4/5]

template<bool Complex>
triqs::atom_diag::atom_diag< Complex >::atom_diag ( many_body_op_t const & h,
fundamental_operator_set const & fops,
std::vector< many_body_op_t > const & qn_vector )

Reduce a Hamiltonian to a block-diagonal form using user-supplied quantum numbers, then diagonalize the blocks.

Partitions the Hilbert space into common eigenspaces of the provided quantum-number operators. The quantum numbers must be chosen such that every fundamental creation and annihilation operator from the provided fundamental operator set maps each common eigenspace to a single common eigenspace (or annihilates it). Each block of the Hamiltonian is then diagonalized with the QR algorithm.

Parameters
hMany-body Hamiltonian \( \hat H \) to be diagonalized.
fopsFundamental operator set; must at least contain every fundamental operator appearing in \( \hat H \).
qn_vectorList of quantum-number operators.

◆ atom_diag() [5/5]

template<bool Complex>
triqs::atom_diag::atom_diag< Complex >::atom_diag ( many_body_op_t const & h,
fundamental_operator_set const & fops,
std::initializer_list< many_body_op_t > const & init_lst )
inline

Initializer-list overload of atom_diag(many_body_op_t const &, fundamental_operator_set const &, std::vector<many_body_op_t> const &).

Parameters
hMany-body Hamiltonian \( \hat H \) to be diagonalized.
fopsFundamental operator set; must at least contain every fundamental operator appearing in \( \hat H \).
init_lstBraced list of quantum-number operators.

Definition at line 295 of file atom_diag.hpp.

Member Function Documentation

◆ c_connection()

template<bool Complex>
long triqs::atom_diag::atom_diag< Complex >::c_connection ( int op_linear_index,
int sp_index ) const
inline

Get the target subspace \( B' \) of the annihilation operator \( \hat c_i \) acting on subspace \( B \).

\[ \hat c_i\, S_B \subseteq S_{B'} \; , \]

with \( B' = -1 \) if \( \hat c_i \) annihilates \( B \). The operator \( \hat c_i \) is identified by its linear index \( i \) in the fundamental operator set provided at construction.

Parameters
op_linear_indexLinear index \( i \) of the annihilation operator.
sp_indexSource subspace index \( B \).
Returns
Target subspace index \( B' \), or \( -1 \) if the operator annihilates the source subspace.

Definition at line 462 of file atom_diag.hpp.

◆ c_matrix()

template<bool Complex>
matrix_t const & triqs::atom_diag::atom_diag< Complex >::c_matrix ( int op_linear_index,
int sp_index ) const
inline

Get the matrix block of the annihilation operator \( \hat c_i \) acting on subspace \( B \).

The returned matrix is the representation of \( \hat c_i \) in the eigenbasis of \( \hat H \), i.e. \( \bigl[\hat c_i\bigr]_{B' \leftarrow B} \), with shape \( \dim(B') \times \dim(B) \) (not necessarily square).

Parameters
op_linear_indexLinear index \( i \) of the annihilation operator.
sp_indexSource subspace index \( B \).
Returns
Matrix block of the annihilation operator from subspace \( B \) to subspace \( B' \).

Definition at line 492 of file atom_diag.hpp.

◆ cdag_connection()

template<bool Complex>
long triqs::atom_diag::atom_diag< Complex >::cdag_connection ( int op_linear_index,
int sp_index ) const
inline

Get the target subspace \( B' \) of the creation operator \( \hat c^\dagger_i \) acting on subspace \( B \).

\[ \hat c^\dagger_i\, S_B \subseteq S_{B'} \; , \]

with \( B' = -1 \) if \( \hat c^\dagger_i \) annihilates \( B \). The operator \( \hat c^\dagger_i \) is identified by its linear index \( i \) in the fundamental operator set provided at construction.

Parameters
op_linear_indexLinear index \( i \) of the creation operator.
sp_indexSource subspace index \( B \).
Returns
Target subspace index \( B' \), or \( -1 \) if the operator annihilates the source subspace.

Definition at line 479 of file atom_diag.hpp.

◆ cdag_matrix()

template<bool Complex>
matrix_t const & triqs::atom_diag::atom_diag< Complex >::cdag_matrix ( int op_linear_index,
int sp_index ) const
inline

Get the matrix block of the creation operator \( \hat c^\dagger_i \) acting on subspace \( B \).

The returned matrix is the representation of \( \hat c^\dagger_i \) in the eigenbasis of \( \hat H \), i.e. \( \bigl[\hat c^\dagger_i\bigr]_{B' \leftarrow B} \), with shape \( \dim(B') \times \dim(B) \) (not necessarily square).

Parameters
op_linear_indexLinear index \( i \) of the creation operator.
sp_indexSource subspace index \( B \).
Returns
Matrix block of the creation operator from subspace \( B \) to subspace \( B' \).

Definition at line 505 of file atom_diag.hpp.

◆ flatten_subspace_index()

template<bool Complex>
int triqs::atom_diag::atom_diag< Complex >::flatten_subspace_index ( int sp_index,
int i ) const
inline

Map a subspace-local pair \( (B, i) \) to its linear index in the full Hilbert space.

The full-Hilbert-space eigenstate index is

\[ d(B, i) = \mathtt{first\_eigenstate\_of\_subspace}[B] + i, \quad 0 \le i < \dim(B), \quad 0 \le d < N. \]

Parameters
sp_indexSubspace index \( B \).
iEigenstate index inside subspace \( B \), with \( 0 \le i < \dim(B) \).
Returns
Linear eigenstate index \( d(B, i) \) in the eigenbasis of the full Hilbert space.

Definition at line 391 of file atom_diag.hpp.

◆ get_eigenvalue()

template<bool Complex>
double triqs::atom_diag::atom_diag< Complex >::get_eigenvalue ( int sp_index,
int i ) const
inline

Get the eigenvalue \( E_{B,i} \) of the Hamiltonian.

Parameters
sp_indexSubspace index \( B \).
iEigenstate index inside subspace \( B \), with \( 0 \le i < \dim(B) \).
Returns
Eigenvalue \( E_{B,i} \), with the global ground-state energy subtracted.

Definition at line 414 of file atom_diag.hpp.

◆ get_energies()

template<bool Complex>
std::vector< std::vector< double > > triqs::atom_diag::atom_diag< Complex >::get_energies ( ) const

Get all eigenvalues \( E_{B,i} \) grouped by invariant subspace.

Returns
Outer list indexed by subspace index \( B \), inner list of length \( \dim(B) \) giving the eigenvalues \( E_{B,i} \) sorted in ascending order.

◆ get_fock_states() [1/2]

template<bool Complex>
std::vector< std::vector< fock_state_t > > triqs::atom_diag::atom_diag< Complex >::get_fock_states ( ) const
inline

Get the Fock states of every invariant subspace.

Returns
Outer list indexed by subspace index \( B \), inner list of length \( \dim(B) \) giving the Fock states (encoded as 64-bit integers) spanning that subspace.

Definition at line 352 of file atom_diag.hpp.

◆ get_fock_states() [2/2]

template<bool Complex>
std::vector< fock_state_t > const & triqs::atom_diag::atom_diag< Complex >::get_fock_states ( int sp_index) const
inline

Get the Fock states spanning invariant subspace \( B \).

Parameters
sp_indexSubspace index \( B \).
Returns
List of \( \dim(B) \) Fock states (encoded as 64-bit integers) spanning subspace \( B \).

Definition at line 344 of file atom_diag.hpp.

◆ get_matrix_element_of_monomial()

template<bool Complex>
auto triqs::atom_diag::atom_diag< Complex >::get_matrix_element_of_monomial ( operators::monomial_t const & op_vec,
int B ) const

Get the matrix representation of a monomial operator restricted to source subspace \( B \).

For a monomial

\[ \hat m = \hat c^{(\dagger)}_{i_k} \cdots \hat c^{(\dagger)}_{i_1}, \]

the action on subspace \( B \) lands in a single target subspace \( B' \) (or annihilates \( B \)): \( \hat m\, S_B \subseteq S_{B'} \). The returned matrix is the corresponding block in the eigenbasis of \( \hat H \) with shape \( \dim(B') \times \dim(B) \) (not necessarily square).

Parameters
op_vecMonomial (ordered product of fundamental creation/annihilation operators).
BSource subspace index.
Returns
Pair \( (B',\, \mathrm{matrix}) \), where the matrix gives the action of the monomial from subspace \( B \) to subspace \( B' \). \( B' = -1 \) if the monomial annihilates \( B \).

Definition at line 116 of file atom_diag.cpp.

◆ get_op_mat()

template<bool Complex>
op_block_mat_t triqs::atom_diag::atom_diag< Complex >::get_op_mat ( many_body_op_t const & op) const

Get the block-matrix representation of a generic many-body operator.

Decomposes the operator into monomials and assembles the resulting matrix blocks in the eigenbasis. Throws if the operator does not respect the block structure used by the diagonalization, i.e. if it maps some subspace to a superposition of subspaces.

Parameters
opMany-body operator.
Returns
Block-matrix representation of the operator in the eigenbasis.

◆ get_quantum_numbers()

template<bool Complex>
std::vector< std::vector< quantum_number_t > > const & triqs::atom_diag::atom_diag< Complex >::get_quantum_numbers ( ) const
inline

Get the values of all quantum-number operators, grouped by invariant subspace.

Returns
Outer list indexed by subspace index \( B \), inner list giving the value of each quantum-number operator on subspace \( B \).

Definition at line 430 of file atom_diag.hpp.

◆ get_subspace_dim()

template<bool Complex>
int triqs::atom_diag::atom_diag< Complex >::get_subspace_dim ( int sp_index) const
inline

Get the dimension \( \dim(B) \) of invariant subspace \( B \).

Parameters
sp_indexSubspace index \( B \).
Returns
Number of eigenstates in subspace \( B \).

Definition at line 325 of file atom_diag.hpp.

◆ get_subspace_dims()

template<bool Complex>
std::vector< int > triqs::atom_diag::atom_diag< Complex >::get_subspace_dims ( ) const
inline

Get the dimensions \( \dim(B) \) of all invariant subspaces.

Returns
List of subspace dimensions, indexed by subspace index \( B \).

Definition at line 332 of file atom_diag.hpp.

◆ get_unitary_matrices()

template<bool Complex>
std::vector< matrix< scalar_t > > triqs::atom_diag::atom_diag< Complex >::get_unitary_matrices ( ) const
inline

Get the unitary matrices \( U_B \) for every invariant subspace.

Returns
List of unitary matrices, indexed by subspace index \( B \).

Definition at line 372 of file atom_diag.hpp.

◆ get_unitary_matrix()

template<bool Complex>
matrix< scalar_t > const & triqs::atom_diag::atom_diag< Complex >::get_unitary_matrix ( int sp_index) const
inline

Get the unitary matrix \( U_B \) mapping the Fock basis of subspace \( B \) to its eigenbasis.

Parameters
sp_indexSubspace index \( B \).
Returns
Unitary matrix \( U_B \) such that \( H_B = U_B\, \mathrm{diag}(E_B)\, U_B^\dagger \) within the subspace.

Definition at line 365 of file atom_diag.hpp.

◆ get_vacuum_state()

template<bool Complex>
full_hilbert_space_state_t const & triqs::atom_diag::atom_diag< Complex >::get_vacuum_state ( ) const
inline

Get the vacuum state as a vector in the full Hilbert space.

The returned vector is expressed in the eigenbasis of the Hamiltonian \( \hat H \).

Returns
Vacuum state vector.

Definition at line 445 of file atom_diag.hpp.

◆ index_range_of_subspace()

template<bool Complex>
range triqs::atom_diag::atom_diag< Complex >::index_range_of_subspace ( int sp_index) const
inline

Get the range of full-Hilbert-space indices corresponding to subspace \( B \).

Parameters
sp_indexSubspace index \( B \).
Returns
Half-open range \( [d(B, 0),\, d(B, 0) + \dim(B)) \) of full-Hilbert-space eigenstate indices belonging to subspace \( B \).

Definition at line 400 of file atom_diag.hpp.


The documentation for this class was generated from the following files: