Subspace of a fermionic Hilbert (Fock) space.
A subspace \( \mathcal{F}^{(m)} \subseteq \mathcal{F} \) of a triqs::hilbert_space::hilbert_space \(\mathcal{F} \) is defined by an ordered subset of occupation number basis states \( B_{\mathcal{F}^{(m)} } = \{
\lvert f_0 \rangle, \dots, \lvert f_{M-1} \rangle \} \subseteq B_{\mathcal{F}} \) such that \(\dim(\mathcal{F}^{(m)}) = M \leq \dim(\mathcal{F}) \).
The order of the Fock states on \( B_{\mathcal{F}^{(m)}} \) is defined as \( \lvert f_i \rangle < \lvert f_j
\rangle \) if \( i < j \). This is not necessarily the same order as on \( B_{\mathcal{F}} \), where \(\lvert f_i \rangle < \lvert f_j \rangle \) if \( f_i < f_j \).
For fast lookup, we store
- \( B_{\mathcal{F}^{(m)}} \), the ordered set of basis states in the subspace, as well as
- a map from the Fock state \( \lvert f_i \rangle \) to the corresponding index \( i \in \{ 0, 1, \dots, M-1
\} \) within the ordered set of the subspace.
The subspace index \( m \) is used to distinguish between different subspaces of the same Hilbert (Fock) space.
Definition at line 193 of file hilbert_space.hpp.
|
| | sub_hilbert_space (int m=-1) |
| | Construct an empty subspace with a given index \( m \).
|
| void | add_fock_state (fock_state_t f) |
| | Add a Fock state \( \lvert f \rangle \) to the subspace and increase its dimension by one.
|
|
auto const & | get_all_fock_states () const |
| | Get \( B_{\mathcal{F}^{(m)}} \), the ordered set of all Fock states in the subspace.
|
| auto | get_fock_state (int i) const |
| | Get the Fock state \( \lvert f_i \rangle \in \mathcal{F}^{(m)} \) for a given index \( i \).
|
|
auto | get_index () const |
| | Get the subspace index \( m \).
|
| auto | get_state_index (fock_state_t f) const |
| | Get the index \( i \) of a given Fock state \( \lvert f_i \rangle \) within this subspace.
|
| bool | has_state (fock_state_t f) const |
| | Check if a given Fock state \( \lvert f \rangle \) belongs to this subspace.
|
|
bool | operator== (sub_hilbert_space const &hs) const |
| | Equal-to operator compares the subspace index \( m \) and the ordered set \( B_{\mathcal{F}^{(m)}} \).
|
| void | set_index (int m) |
| | Set the subspace index \( m \) of this subspace \( \mathcal{F}^{(m)} \).
|
|
auto | size () const |
| | Get the dimension \( M = \dim(\mathcal{F}^{(m)}) \) of the subspace.
|