ALPS MPS Codes
Reference documentation.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Namespaces | Functions
symmetry_factory.h File Reference
#include "dmrg/utils/DmrgParameters.h"
#include "dmrg/block_matrix/symmetry.h"
#include <boost/function.hpp>
#include <boost/tokenizer.hpp>
#include <map>
#include <string>
#include "utils/io.hpp"

Go to the source code of this file.

Namespaces

 dmrg
 

Functions

std::string guess_alps_symmetry (BaseParameters &parms)
 
template<class TR >
TR::shared_ptr dmrg::symmetry_factory (DmrgParameters &parms)
 

Function Documentation

std::string guess_alps_symmetry ( BaseParameters parms)

Definition at line 39 of file symmetry_factory.h.

40 {
41  std::map<int, std::string> symm_names;
42  symm_names[0] = "none";
43  symm_names[1] = "u1";
44  symm_names[2] = "2u1";
45 
46  int n=0;
47  typedef boost::tokenizer<boost::char_separator<char> > tokenizer;
48  if (parms.defined("CONSERVED_QUANTUMNUMBERS")) {
49  boost::char_separator<char> sep(" ,");
50  std::string qn_string = parms["CONSERVED_QUANTUMNUMBERS"].str();
51  tokenizer qn_tokens(qn_string, sep);
52  for (tokenizer::iterator it=qn_tokens.begin(); it != qn_tokens.end(); it++) {
53  if (parms.defined(*it + "_total"))
54  n += 1;
55  }
56  }
57  return symm_names[n];
58 }