ALPS MPS Codes
Reference documentation.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Functions
dmrg Namespace Reference

Classes

class  time_limit
 

Functions

template<class TR >
TR::shared_ptr symmetry_factory (DmrgParameters &parms)
 

Function Documentation

template<class TR >
TR::shared_ptr dmrg::symmetry_factory ( DmrgParameters parms)

Definition at line 63 of file symmetry_factory.h.

64  {
65  typedef typename TR::shared_ptr ptr_type;
66  std::map<std::string, ptr_type> factory_map;
67 
68  maquis::cout << "This binary contains symmetries: ";
69 #ifdef HAVE_NU1
70  factory_map["nu1"] = ptr_type(new typename TR::template F<NU1>::type());
71  maquis::cout << "nu1 ";
72 #endif
73 #ifdef HAVE_TrivialGroup
74  factory_map["none"] = ptr_type(new typename TR::template F<TrivialGroup>::type());
75  maquis::cout << "none ";
76 #endif
77 #ifdef HAVE_U1
78  factory_map["u1"] = ptr_type(new typename TR::template F<U1>::type());
79  maquis::cout << "u1 ";
80 #endif
81 #ifdef HAVE_TwoU1
82  factory_map["2u1"] = ptr_type(new typename TR::template F<TwoU1>::type());
83  maquis::cout << "2u1 ";
84 #endif
85 #ifdef HAVE_TwoU1PG
86  factory_map["2u1pg"] = ptr_type(new typename TR::template F<TwoU1PG>::type());
87  maquis::cout << "2u1pg ";
88 #endif
89 #ifdef HAVE_Ztwo
90  factory_map["Z2"] = ptr_type(new typename TR::template F<Ztwo>::type());
91  maquis::cout << "Z2 ";
92 #endif
93  maquis::cout << std::endl;
94 
95 
96  std::string symm_name;
97  if (!parms.is_set("symmetry")) {
98 #ifdef HAVE_NU1
99  symm_name = "nu1";
100 #else
101  if (parms["model_library"] == "alps")
102  symm_name = guess_alps_symmetry(parms);
103 #endif
104  } else {
105  symm_name = parms["symmetry"].str();
106  }
107 
108  if (factory_map.find(symm_name) != factory_map.end())
109  return factory_map[symm_name];
110  else
111  throw std::runtime_error("Don't know this symmetry group. Please, check your compilation flags.");
112 #ifdef AMBIENT
113  ambient::sync();
114 #endif
115  return ptr_type();
116  }
std::string guess_alps_symmetry(BaseParameters &parms)
bool is_set(std::string const &key) const