27 #ifndef MAQUIS_DMRG_MODELS_INITIALIZER_FACTORY_H
28 #define MAQUIS_DMRG_MODELS_INITIALIZER_FACTORY_H
34 template <
class Matrix,
class SymmGroup>
38 typename SymmGroup::charge initc = this->total_quantum_numbers(parms);
40 int max_site_type = 0;
41 std::vector<int> site_types(lat.
size(), 0);
42 for (
int p = 0; p < lat.
size(); ++p) {
43 site_types[p] = lat.
get_prop<
int>(
"type", p);
44 max_site_type = std::max(site_types[p], max_site_type);
47 std::cout <<
"site_types: ";
48 std::copy(site_types.begin(), site_types.end(), std::ostream_iterator<int>(std::cout,
" "));
49 std::cout << std::endl;
51 std::vector<Index<SymmGroup> > site_bases(max_site_type+1);
52 for (
int type = 0; type < site_bases.size(); ++type) {
53 site_bases[type] = this->phys_dim(type);
54 std::cout <<
"phys["<<type <<
"]: " << site_bases[type] << std::endl;
57 if (parms[
"init_state"] ==
"default")
60 else if (parms[
"init_state"] ==
"const")
63 else if (parms[
"init_state"] ==
"thin")
66 else if (parms[
"init_state"] ==
"thin_const")
69 else if (parms[
"init_state"] ==
"basis_state")
72 else if (parms[
"init_state"] ==
"basis_state_generic")
75 else if (parms[
"init_state"] ==
"coherent")
78 else if (parms[
"init_state"] ==
"basis_state_dm")
81 else if (parms[
"init_state"] ==
"coherent_dm")
85 throw std::runtime_error(
"Don't know this initial state.");
definition of Model base class
virtual initializer_ptr initializer(Lattice const &lat, BaseParameters &parms) const
T get_prop(std::string property, pos_t site) const
functions to initialize the MPS
boost::shared_ptr< mps_initializer< Matrix, SymmGroup > > initializer_ptr