|
TRIQS/TRIQS 4.0.0
Researching Interacting Quantum Systems
|
#include <triqs/hilbert_space/space_partition.hpp>
Automatic partitioning of a Hilbert (Fock) space into invariant subspaces of a Hermitian operator.
Given a Hamiltonian \( \hat{H} \) acting on a Hilbert (Fock) space \( \mathcal{F} \) (see triqs::hilbert_space::hilbert_space) with basis \( B_{\mathcal{F}} = \{ \lvert f \rangle \}_{f = 0}^{\dim( \mathcal{F}) - 1} \), the class builds the finest partition of \( \mathcal{F} \) into invariant subspaces \(\{ \mathcal{F}^{(k)} \} \) such that
\[ \hat{H} \, \mathcal{F}^{(k)} \subseteq \mathcal{F}^{(k)} \quad \forall k, \qquad \mathcal{F} = \bigoplus_k \mathcal{F}^{(k)}. \]
Each invariant subspace \( \mathcal{F}^{(k)} \) is represented as the set of Fock state indices \( f \) whose basis states \( \lvert f \rangle \) belong to it, and the partition is encoded internally as a disjoint-set (union-find) data structure over \( \{ 0, \dots, \dim(\mathcal{F}) - 1 \} \).
The partition is built in two phases:
The algorithm is described in detail in Computer Physics Communications 200, March 2016, 274-284 (section 4.2).
| S | Many-body state type. |
| OP | Imperative operator type. |
Definition at line 78 of file space_partition.hpp.
Public Types | |
| using | amplitude_t = typename state_t::value_type |
| Amplitude type of the many-body states. | |
| using | block_mapping_t = std::set<std::pair<idx_t, idx_t>> |
| Set of subspace-to-subspace connections, stored as (from-subspace, to-subspace) index pairs. | |
| using | idx_t = uint32_t |
| Index type for basis Fock states \( \lvert f \rangle \) and for invariant subspaces \( \mathcal{F}^{(k)} \). | |
| using | matrix_element_map_t = std::map<std::pair<idx_t, idx_t>, amplitude_t> |
| Non-vanishing matrix elements of an operator \( \hat{O} \) in the Fock basis. | |
| using | operator_t = OP |
| Imperative operator type. | |
| using | state_t = S |
| Many-body state type. | |
Public Member Functions | |
| space_partition (space_partition const &)=default | |
| Default copy constructor. | |
| space_partition (state_t const &psi, operator_t const &H, bool store_matrix_elements=true, operator_t const &delta=operator_t()) | |
| Construct a space partition by running Phase I of the automatic partition algorithm. | |
| block_mapping_t | find_mappings (operator_t const &op, bool diagonal_only=false) |
| Find all subspace-to-subspace connections generated by a given operator. | |
| matrix_element_map_t const & | get_matrix_elements () const |
| Get the stored non-vanishing matrix elements of the Hamiltonian. | |
| idx_t | lookup_basis_state (idx_t f) |
| Look up the invariant subspace containing a given basis Fock state. | |
| auto | merge_subspaces (operator_t const &cd, operator_t const &c, bool store_matrix_elements=true) |
| Run Phase II of the automatic partition algorithm. | |
| idx_t | n_subspaces () const |
| Get the number of invariant subspaces in the current partition. | |
Friends | |
| template<typename F> | |
| void | foreach (space_partition &sp, F f) |
| Apply a callable object to every basis Fock state in the partitioned Hilbert (Fock) space. | |
| using triqs::hilbert_space::space_partition< S, OP >::matrix_element_map_t = std::map<std::pair<idx_t, idx_t>, amplitude_t> |
Non-vanishing matrix elements of an operator \( \hat{O} \) in the Fock basis.
Stored as a map \( (i, j) \mapsto \langle f_j \lvert \hat{O} \rvert f_i \rangle \), where \( i \) and \( j \) are the indices of the initial and final basis Fock states \( \lvert f_i \rangle \) and \(\lvert f_j \rangle \).
Definition at line 102 of file space_partition.hpp.
|
inline |
Construct a space partition by running Phase I of the automatic partition algorithm.
Partitions the Hilbert (Fock) space \( \mathcal{F} \) associated with \( | \psi \rangle \) into invariant subspaces \( \{ \mathcal{F}^{(k)} \} \) of the Hamiltonian \( \hat{H} \).
The constructor iterates over every basis Fock state \( \lvert f \rangle \in B_{\mathcal{F}} \), evaluates \(\hat{H} \lvert f \rangle \), and for every \( \lvert f' \rangle \) that appears with non-vanishing amplitude \( \langle f' \lvert \hat{H} \rvert f \rangle \neq 0 \) merges the subspace currently containing \( \lvert f \rangle \) with the one containing \( \lvert f' \rangle \) in a disjoint-set data structure.
If \( \hat{\Delta} \) is non-empty, it is applied in the same loop so that the resulting partition is also invariant under \( \hat{\Delta} \). The typical use case is a hybridization operator that must respect the same block structure as \( \hat{H} \).
| psi | Sample many-body state \( | \psi \rangle \) defining the Hilbert (Fock) space \( \mathcal{F} \) to partition. |
| H | Hamiltonian \( \hat{H} \) as a triqs::hilbert_space::imperative_operator. |
| store_matrix_elements | If true, store all non-vanishing matrix elements \( \langle f' \lvert \hat{H} \rvert f \rangle \) encountered during the traversal (can be retrieved via get_matrix_elements()). |
| delta | Optional additional operator \( \hat{\Delta} \) whose action must be respected by the partition. |
Definition at line 129 of file space_partition.hpp.
|
inline |
Find all subspace-to-subspace connections generated by a given operator.
For every basis Fock state \( \lvert f \rangle \in B_{\mathcal{F}} \), computes \( \hat{O} \lvert f \rangle \) and records the index pair \( (k, k') \) of the invariant subspaces \( \mathcal{F}^{(k)} \ni \lvert f \rangle \) and \( \mathcal{F}^{(k')} \ni \lvert f' \rangle \) for every \( \lvert f' \rangle \) that appears with non-vanishing amplitude.
| op | Imperative operator \( \hat{O} \) to analyze. |
| diagonal_only | If true, only retain self-connections \( \mathcal{F}^{(k)} \to \mathcal{F}^{(k)} \). |
Definition at line 321 of file space_partition.hpp.
|
inline |
Get the stored non-vanishing matrix elements of the Hamiltonian.
Only populated if Phase I was constructed with store_matrix_elements = true. Otherwise the returned map is empty.
Definition at line 306 of file space_partition.hpp.
|
inline |
Look up the invariant subspace containing a given basis Fock state.
| f | Basis fock state \( \lvert f \rangle \). |
Definition at line 295 of file space_partition.hpp.
|
inline |
Run Phase II of the automatic partition algorithm.
Merges invariant subspaces produced by Phase I until a given operator \( \hat{c}^\dagger \) and its Hermitian conjugate \( \hat{c} \) generate at most one-to-one connections between the resulting subspaces \( \{ \mathcal{F}^{(k)} \} \).
The implementation builds, for every initial basis Fock state \( \lvert f \rangle \in B_{\mathcal{F}} \), the subspace-level connections induced by \( \hat{c}^\dagger \lvert f \rangle \) and \( \hat{c} \lvert f \rangle \), and then performs a breadth-first traversal of the resulting bipartite graph: starting from a pair of subspaces \( (\mathcal{F}^{(\mathrm{lower})}, \mathcal{F}^{(\mathrm{upper})}) \) such that \( \hat{c}^\dagger \mathcal{F}^{(\mathrm{lower})} \cap \mathcal{F}^{(\mathrm{upper})} \neq \{ 0 \} \), all subspaces reachable by an even-length alternating product \( (\hat{c} \hat{c}^\dagger)^n \) from \( \mathcal{F}^{(\mathrm{lower})} \) are merged into \( \mathcal{F}^{(\mathrm{lower})} \), and all subspaces reachable by \( (\hat{c}^\dagger \hat{c})^n \) from \( \mathcal{F}^{(\mathrm{upper})} \) are merged into \( \mathcal{F}^{(\mathrm{upper})} \). The procedure repeats until no \( \hat{c}^\dagger \)-connection is left untreated.
| cd | Operator \( \hat{c}^\dagger \) (typically a creation operator). |
| c | Hermitian conjugate \( \hat{c} \) of \( \hat{c}^\dagger \) (typically an annihilation operator). |
| store_matrix_elements | If true, the non-vanishing matrix elements of \( \hat{c}^\dagger \) and \(\hat{c} \) are collected during the traversal and returned. |
Definition at line 195 of file space_partition.hpp.
|
inline |
Get the number of invariant subspaces in the current partition.
Definition at line 271 of file space_partition.hpp.
|
friend |
Apply a callable object to every basis Fock state in the partitioned Hilbert (Fock) space.
For each basis Fock state index \( f \in \{ 0, \dots, \dim(\mathcal{F}) - 1 \} \) the callable is invoked with two arguments: \( f \) itself, and the index \( k \) of the invariant subspace \(\mathcal{F}^{(k)} \) containing \( \lvert f \rangle \).
| F | Callable type. |
| sp | Space partition to iterate over. |
| f | Callable object. |
Definition at line 284 of file space_partition.hpp.