|
TRIQS/TRIQS 4.0.0
Researching Interacting Quantum Systems
|
#include <triqs/atom_diag/atom_diag.hpp>
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
Two specializations are provided, one for real-valued and one for complex-valued Hamiltonians.
| Complex | Allow 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_t > | 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 \). | |
| 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"). | |
| 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).
| h | Many-body Hamiltonian \( \hat H \) to be diagonalized. |
| fops | Fundamental operator set; must at least contain every fundamental operator appearing in \( \hat H \). |
| 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.
| h | Many-body Hamiltonian \( \hat H \) to be diagonalized. |
| fops | Fundamental operator set; must at least contain every fundamental operator appearing in \( \hat H \). |
| hyb | Additional 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. |
| 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.
| h | Many-body Hamiltonian \( \hat H \) to be diagonalized. |
| fops | Fundamental operator set; must at least contain every fundamental operator appearing in \( \hat H \). |
| n_min | Minimum total particle number to keep. |
| n_max | Maximum total particle number to keep. |
| 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.
| h | Many-body Hamiltonian \( \hat H \) to be diagonalized. |
| fops | Fundamental operator set; must at least contain every fundamental operator appearing in \( \hat H \). |
| qn_vector | List of quantum-number operators. |
|
inline |
Initializer-list overload of atom_diag(many_body_op_t const &, fundamental_operator_set const &, std::vector<many_body_op_t> const &).
| h | Many-body Hamiltonian \( \hat H \) to be diagonalized. |
| fops | Fundamental operator set; must at least contain every fundamental operator appearing in \( \hat H \). |
| init_lst | Braced list of quantum-number operators. |
Definition at line 295 of file atom_diag.hpp.
|
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.
| op_linear_index | Linear index \( i \) of the annihilation operator. |
| sp_index | Source subspace index \( B \). |
Definition at line 462 of file atom_diag.hpp.
|
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).
| op_linear_index | Linear index \( i \) of the annihilation operator. |
| sp_index | Source subspace index \( B \). |
Definition at line 492 of file atom_diag.hpp.
|
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.
| op_linear_index | Linear index \( i \) of the creation operator. |
| sp_index | Source subspace index \( B \). |
Definition at line 479 of file atom_diag.hpp.
|
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).
| op_linear_index | Linear index \( i \) of the creation operator. |
| sp_index | Source subspace index \( B \). |
Definition at line 505 of file atom_diag.hpp.
|
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. \]
| sp_index | Subspace index \( B \). |
| i | Eigenstate index inside subspace \( B \), with \( 0 \le i < \dim(B) \). |
Definition at line 391 of file atom_diag.hpp.
|
inline |
Get the eigenvalue \( E_{B,i} \) of the Hamiltonian.
| sp_index | Subspace index \( B \). |
| i | Eigenstate index inside subspace \( B \), with \( 0 \le i < \dim(B) \). |
Definition at line 414 of file atom_diag.hpp.
| std::vector< std::vector< double > > triqs::atom_diag::atom_diag< Complex >::get_energies | ( | ) | const |
Get all eigenvalues \( E_{B,i} \) grouped by invariant subspace.
|
inline |
Get the Fock states of every invariant subspace.
Definition at line 352 of file atom_diag.hpp.
|
inline |
Get the Fock states spanning invariant subspace \( B \).
| sp_index | Subspace index \( B \). |
Definition at line 344 of file atom_diag.hpp.
| 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).
| op_vec | Monomial (ordered product of fundamental creation/annihilation operators). |
| B | Source subspace index. |
Definition at line 116 of file atom_diag.cpp.
| 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.
| op | Many-body operator. |
|
inline |
Get the values of all quantum-number operators, grouped by invariant subspace.
Definition at line 430 of file atom_diag.hpp.
|
inline |
Get the dimension \( \dim(B) \) of invariant subspace \( B \).
| sp_index | Subspace index \( B \). |
Definition at line 325 of file atom_diag.hpp.
|
inline |
Get the dimensions \( \dim(B) \) of all invariant subspaces.
Definition at line 332 of file atom_diag.hpp.
|
inline |
Get the unitary matrices \( U_B \) for every invariant subspace.
Definition at line 372 of file atom_diag.hpp.
|
inline |
Get the unitary matrix \( U_B \) mapping the Fock basis of subspace \( B \) to its eigenbasis.
| sp_index | Subspace index \( B \). |
Definition at line 365 of file atom_diag.hpp.
|
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 \).
Definition at line 445 of file atom_diag.hpp.
|
inline |
Get the range of full-Hilbert-space indices corresponding to subspace \( B \).
| sp_index | Subspace index \( B \). |
Definition at line 400 of file atom_diag.hpp.