Template Struct model_instance

Inheritance Relationships

Base Type

Struct Documentation

template<typename HilbertField>
struct model_instance : public model_instance_base

template class for an instance of a model

a model_instance is of type <Complex> if one of the Hermitian operators in the model is complex, or if the symmetry group has complex representations. Either of these results in a complex Hilbert space. Otherwise it is of type <double> Note that some of the Hermitian operators could be of type <double> even if the Hilbert space is complex.

Public Functions

model_instance(size_t _label, shared_ptr<model> _the_model, const map<string, double> _value, const string &_sectors)

constructor

Hamiltonian<HilbertField> *create_hamiltonian(shared_ptr<model> the_model, const map<string, double> &value, sector s)

Create Hamiltonian in the right format.

void build_cf(state<HilbertField> &Omega, bool spin_down)
void build_qmatrix(state<HilbertField> &Omega, bool spin_down)

Constructs the Q_matrix (Lehmann representation) from the band Lanczos method, or full diagonalization if the dimension is small enough.

Parameters:
  • Omega – state on which the GF is built

  • spin_down – true if we are building the spin down component of the GF

void build_mcf(state<HilbertField> &Omega, bool spin_down)

Constructs the matrix continued fraction (MCF) representation of the Green function from the block Lanczos method.

Mimics build_qmatrix() but uses blockLanczos() instead of the band Lanczos (build_Q_matrix). The result is stored as a pair of matrix_continued_fraction objects (one electron, one hole) per irrep block, held in an mcf_set.

Weight matrix W

Before calling blockLanczos (which orthonormalises the starting block internally), the upper-triangular QR factor W is extracted from the phi block via modified Gram-Schmidt. This captures the norms of the starting vectors, exactly as norm/sqrt(norm) does in the scalar build_cf. The factor sqrt(Omega.weight) is folded into W so that the spectral weight is correct across degenerate ground states.

Conventions

The electron MCF is stored without modification. mcf_set::Green_function transposes its output before adding to G.block[r] to match the cconjugate convention of build_qmatrix (see mcf_set.hpp for the derivation).

Parameters:
  • Omega – State on which the GF is built.

  • spin_down – True when building the spin-down component (up-down mixing).

void build_mcf_from_qmatrix(state<HilbertField> &Omega, bool spin_down)

Constructs the MCF representation of the Green function from the Q_matrix Lehmann representation, using block Lanczos on the diagonal Hamiltonian H = diag(Q.e).

Calls build_qmatrix() to obtain the combined (electron + hole) Q_matrix per irrep block, then converts each block via Q_matrix_to_mcf() and stores the result in mcf_set::combined[r]. The mcf_set replaces the Q_matrix_set in Omega.gf (or Omega.gf_down).

This path is used when GF_method = ‘L’ and combine_mcf = true. It preserves the Lehmann accuracy of build_qmatrix while producing a combined MCF output compatible with get_combined_mcf().

Parameters:
  • Omega – State on which the GF is built.

  • spin_down – True when building the spin-down component (up-down mixing).

void clear_states()

erases all the state vectors in the density matrix

void compute_weights()

Computes the Boltzmann weights of the different states once they are all known.

void insert_state(shared_ptr<state<HilbertField>> S)

inserts a state in the list of low-energy states

void set_hopping_matrix(bool spin_down)

Calculates the matrices tc, tb and tcb.

virtual void merge_states() override

Merging states belonging to the same sector in order to streamline the combined q-matrix representations Useless in the continued fraction representation is used Useful only at finite temperature when full diagonalization is used.

string GS_string() const
void build_bases_and_HS_operators(const sector &GS_sector, bool spin_down)
double fidelity(model_instance<HilbertField> &label)
virtual pair<double, string> low_energy_states() override

Computes the low-energy states.

virtual pair<double, double> cluster_averages(shared_ptr<Hermitian_operator> h) override

returns the GS average of a Hermitian operator op

virtual void Green_function_solve() override

computes the representation of the Green function

virtual pair<double, string> one_body_solve() override

Constructs a ground state and Green function for the one-body problem only Useful when the number of sites exceeds the limit of ED, for studying impurity problems.

virtual matrix<Complex> Green_function(const Complex &z, bool spin_down, bool blocks) override

Evaluates the Green function matrix g (column-order format) at complex frequency z.

virtual void Green_function_average() override

Evaluates the Green function average G (column-order format)

virtual matrix<Complex> self_energy(const Complex &z, bool spin_down) override

Evaluates the self energy matrix g (column-order format) at complex frequency z.

virtual matrix<Complex> hopping_matrix(bool spin_down) override
virtual matrix<Complex> hopping_matrix_full(bool spin_down, bool diag) override
virtual vector<tuple<int, int, double>> interactions() override
virtual matrix<Complex> hybridization_function(Complex w, bool spin_down) override

Computes the hybridization matrix Gamma Gamma is \(-G'^{-1}-\Sigma-t'+\omega\).

It is a projection onto the cluster sites only (bath excluded).

virtual vector<Complex> susceptibility(shared_ptr<Hermitian_operator> h, const vector<Complex> &w) override

Computes the susceptibility of the operator h w : array of complex frequencies.

virtual vector<pair<double, double>> susceptibility_poles(shared_ptr<Hermitian_operator> h) override

Computes the susceptibility of the operator h in the form of a Lehmann representation returns an array of poles and residues.

virtual void Green_function_density() override

Evaluates the density from the Green function average.

virtual void print(ostream &fout) override

prints the instance details on a file

virtual void write_hdf5(H5::Group &grp) override

Writes the model instance (parameters + all states) to an HDF5 group.

Layout: attribute “GS_energy” : double attribute “GS_sectors” : string attribute “GF_format” : string (“bl” | “cf” | “mcf”) attribute “mixing” : int attribute “complex_HS” : int for each (key, val) in value: attribute “param/<key>” : double, stored in sub-group “params” sub-groups “state_0”, “state_1”, … for each state in the density matrix

virtual void read_hdf5(H5::Group &grp) override

Reads the model instance from an HDF5 group (written by write_hdf5).

virtual double tr_sigma_inf() override
pair<vector<double>, vector<complex<double>>> qmatrix(bool spin_down)
pair<vector<double>, vector<complex<double>>> hybridization(bool spin_down)
virtual void print_wavefunction(ostream &fout) override
virtual pair<matrix<Complex>, vector<uint64_t>> density_matrix_mixed(vector<int> sites) override
virtual pair<matrix<Complex>, vector<uint64_t>> density_matrix_factorized(vector<int> sites) override
virtual matrix<Complex> hopping_matrix(bool spin_down)
virtual matrix<Complex> hopping_matrix(bool spin_down)
void build_cf(state<double> &Omega, bool spin_down)

Constructs the continued fraction representation from the Lanczos method or full diagonalization if the dimension is small enough.

Parameters:
  • Omega – state on which the contribution to the Green function is built

  • spin_down – true if we are building the spin down component of the GF

void build_cf(state<Complex> &Omega, bool spin_down)

Public Members

size_t look_up_size
matrix<HilbertField> tc
matrix<HilbertField> tcb
matrix<HilbertField> tb
matrix<HilbertField> tc_down

one-body matrices for cluster, cluster-bath and bath

matrix<HilbertField> tcb_down
matrix<HilbertField> tb_down
matrix<HilbertField> tcb_nd

one-body matrices for cluster, cluster-bath and bath (spin down)

matrix<HilbertField> tb_nd
matrix<HilbertField> tcb_nd_down

non diagonalized versions of these matrices (for debugging/printing)

matrix<HilbertField> tb_nd_down
set<shared_ptr<state<HilbertField>>> states

same, for the spin-down version when mixing = 4

set of states forming the density matrix

deque<pair<Complex, matrix<Complex>>> look_up_table
deque<pair<Complex, matrix<Complex>>> look_up_table_down