Program Listing for File model.hpp

Return to documentation for file (src_ed/model.hpp)

#ifndef model_h
#define model_h

#include <map>
#include <mutex>
#include <set>
#include <string>

#include "ED_basis.hpp"
#include "state.hpp"
#include "Operators/destruction_operator.hpp"


#define MIN_GAP 1.0e-6

struct Hermitian_operator;

struct model
{
  bool is_closed;
  bool is_factorized;
  bool has_complex_HS;
  map<destruction_identifier, shared_ptr<destruction_operator<Complex>>> destruction_complex;
  map<destruction_identifier, shared_ptr<destruction_operator<double>>> destruction;
  map<sector, shared_ptr<ED_mixed_basis>> basis;
  map<sector, shared_ptr<ED_factorized_basis>> factorized_basis;
  map<string, shared_ptr<Hermitian_operator>> term;
  map<sector, vector<double> > last_eigenvectors; //storing the last eigenvectors in each sectors for further solve
  map<sector, double > last_eigenvalues; //storing the last eigenvalues in each sectors for further solve
  mutable std::mutex model_mutex;
  shared_ptr<symmetry_group> group;
  size_t n_bath;
  size_t n_orb;
  size_t n_sites;
  string name;
  vector<bool> in_bath;
  vector<vector<vector<symmetric_orbital>>> sym_orb;
  int mixing;

  model(const string &_name, const size_t _n_orb, const size_t _n_bath, const vector<vector<int>> &gen, bool bath_irrep);
  void add_chemical_potential();
  bool create_or_destroy(int pm, const symmetric_orbital &a, state<double> &x, vector<double> &y, double z);
  bool create_or_destroy(int pm, const symmetric_orbital &a, state<Complex> &x, vector<Complex> &y, Complex z);
  void print(ostream& fout);
  void print_graph(const vector<vector<double>> &pos);
  shared_ptr<ED_mixed_basis> provide_basis(const sector& sec);
  shared_ptr<ED_factorized_basis> provide_factorized_basis(const sector& sec);
  void build_HS_operators(const sector& sec, bool is_complex);
};





#endif