Struct model

Struct Documentation

struct model

class for a cluster model, independent of the precise value of its parameters

Public Functions

model(const string &_name, const size_t _n_orb, const size_t _n_bath, const vector<vector<int>> &gen, bool bath_irrep)

Constructor.

Parameters:
  • _name – name of system (cluster). Used to distinguish different cluster shapes within a larger calculation

  • _n_orb – number of orbitals (bath included) in the model

  • _n_bath – number of bath orbitals in the model

  • gen – sequence of generators (permutations of sites)

void add_chemical_potential()
bool create_or_destroy(int pm, const symmetric_orbital &a, state<double> &x, vector<double> &y, double z)

Applies a creation or annihilation operator |y> += z * c_a |x> ou |y> += z * c^+_a |x>

Parameters:
  • pm – if = 1: creation; if = -1: destruction.

  • a – symmetric orbital

  • x – in state

  • y – out state (allocated before)

  • z – coefficient of the out state

bool create_or_destroy(int pm, const symmetric_orbital &a, state<Complex> &x, vector<Complex> &y, Complex z)

Applies a creation or annihilation operator |y> += z * c_a |x> ou |y> += z * c^+_a |x>

Parameters:
  • pm – if = 1: creation; if = -1: destruction.

  • a – symmetric orbital

  • x – in state

  • y – out state (allocated before)

  • z – coefficient of the out state

void print(ostream &fout)

Prints the definition of the model into a stream.

void print_graph(const vector<vector<double>> &pos)

Prints a graph representation of the model, using the dot language.

The fixed positions of the cluster sites per se (not the bath) are provided in ‘pos’

shared_ptr<ED_mixed_basis> provide_basis(const sector &sec)

returns the basis required for the sector sec.

Builds it if needed.

Parameters:

sec – sector of the state

shared_ptr<ED_factorized_basis> provide_factorized_basis(const sector &sec)

returns the basis required for the sector sec.

Builds it if needed.

Parameters:

sec – sector of the state

void build_HS_operators(const sector &sec, bool is_complex)

Builds the operators necessary in a given sector.

Parameters:
  • GS_sector – sector of the state

  • complex – true if the HS operators must be complex-valued

Public Members

bool is_closed

true if operators can no longer be added, as the first instance of the model was created

bool is_factorized

true if the Hamiltonian can be expressed as H = K_up\otimes 1 + 1\otimes K_down + V

bool has_complex_HS

true if the model requires a complex Hilbert space

map<destruction_identifier, shared_ptr<destruction_operator<Complex>>> destruction_complex

set of destruction operators

map<destruction_identifier, shared_ptr<destruction_operator<double>>> destruction

set of destruction operators

map<sector, shared_ptr<ED_mixed_basis>> basis

list of bases

map<sector, shared_ptr<ED_factorized_basis>> factorized_basis

list of bases in the facto

map<string, shared_ptr<Hermitian_operator>> term

list of operators in the Hamiltonian, by name

map<sector, vector<double>> last_eigenvectors
map<sector, double> last_eigenvalues
mutable std::mutex model_mutex

protects lazy-init maps (basis, destruction) from concurrent threads

shared_ptr<symmetry_group> group

contains data on symmetry operations

size_t n_bath

number of sites considered as ‘bath’ (no Green function computation for these)

size_t n_orb

total number of sites (=L+nb)

size_t n_sites

number of sites in the cluster per se (for Green function computations)

string name

name of the system (i.e. cluster name)

vector<bool> in_bath
vector<vector<vector<symmetric_orbital>>> sym_orb

indicates whether an orbital (from 0 to 2*n_orb) is in bath or not

int mixing

mixing state of the cluster itself (stored copy from model_instance)