1 #ifndef QNANO_NEW_MANYBODY_EXECUTABLE_TEMPLATE_DEFINED_H 2 #define QNANO_NEW_MANYBODY_EXECUTABLE_TEMPLATE_DEFINED_H 4 #include "manybody/Manybody_Hamiltonian.h" 5 #include "tools/Abstract_Solver.h" 6 #include "tools/Eigenvector_Printer.h" 7 #include "tools/Parameter_Map.h" 9 #include "manybody/Manybody_Perturbative_Correction_Template.h" 11 template <
class Tsolver>
void Postprocess_Manybody_Template(Tsolver *solver,
Manybody_Hamiltonian *hamil){
15 template <
class Tsolver,
class Tpr
inter>
16 void Manybody_Executable_Template(
Parameter_Map ¶m_map,
bool verbose){
18 if(verbose)std::cout<<
"Setting up manybody Hamiltonian..."<<std::endl;
21 hamil->setup(param_map, verbose);
23 if(verbose)std::cout<<
"Dimension: "<<hamil->get_DIM()<<std::endl;
26 bool dump=param_map.get_as_bool(
"dump",
false);
28 std::cout<<
"Dumping Hamiltonian"<<std::endl;
32 if(verbose)std::cout<<
"Setting up Eigen Solver"<<std::endl;
33 Tsolver *solver=
new Tsolver(hamil);
36 if(verbose)std::cout<<
"Solving"<<std::endl;
39 if(verbose)std::cout<<
"Printing"<<std::endl;
40 if(!param_map.is_specified(
"eigenvalue_filename")){
41 param_map.add(
"eigenvalue_filename",
"energies.dat");
47 EVprinter->
setup(param_map);
48 EVprinter->print_sparse=
true;
49 EVprinter->sparse_print_index=Manybody_Hilbert_Space::print_index;
51 EVprinter->spi_ctx=(
void*)( fmhs);
55 ss<<
"rank_h "<<fmhs->get_rank_h()<<std::endl;
56 ss<<
"nr_e "<<fmhs->get_nr_e()<<std::endl;
57 ss<<
"nr_h "<<fmhs->get_nr_h()<<std::endl;
58 ss<<
"eigenvalue $EIGENVALUE"<<std::endl;
59 ss<<
"eigenvector:"<<std::endl;
60 EVprinter->EV_header=ss.str();
65 Calculate_Manybody_Perturbation<Tsolver>(param_map,solver,EVprinter,hamil);
67 Postprocess_Manybody_Template<Tsolver>(solver,hamil);
72 if(verbose)std::cout<<
"Done"<<std::endl;
Definition: Parameter_Map.h:12
Definition: Manybody_Hilbert_Space.h:8
virtual void setup(Parameter_Map ¶m_map)
Definition: Eigenvector_Printer.cc:35
int get_rank_e() const
nr of electron/hole states
Definition: Manybody_Hilbert_Space.h:14
void dump_sparse_Matrix(const std::string &file_IA, const std::string &file_JA, const std::string &file_values)
Support for dumping the sparse Matrix.
Definition: Sparse_Matrix_Generator.cc:3
Definition: Eigenvector_Printer.h:8
Definition: Manybody_Hamiltonian.h:14