ALPS MPS Codes
Reference documentation.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Functions
model_2u1.cpp File Reference
#include "dmrg/models/alps/symm_handler.hpp"
#include "dmrg/block_matrix/symmetry/2u1.h"

Go to the source code of this file.

Functions

template<>
TwoU1::charge state_to_charge< TwoU1 > (alps::site_state< short > const &state, alps::SiteBasisDescriptor< short > const &b, std::map< std::string, int > const &all_conserved_qn)
 
template<>
TwoU1::charge init_charge< TwoU1 > (const alps::Parameters &parms, std::map< std::string, int > const &all_conserved_qn)
 

Function Documentation

template<>
TwoU1::charge init_charge< TwoU1 > ( const alps::Parameters &  parms,
std::map< std::string, int > const &  all_conserved_qn 
)

Definition at line 48 of file model_2u1.cpp.

49 {
50  typedef std::map<std::string, int> qn_map_type;
51  assert(all_conserved_qn.size() == 2);
52 
54  for (qn_map_type::const_iterator it=all_conserved_qn.begin(); it!=all_conserved_qn.end(); ++it) {
55  alps::half_integer<short> tmp = alps::evaluate<double>(static_cast<std::string>(parms[it->first+"_total"]), parms);
56  c[it->second] = detail::to_integer(tmp);
57  }
58 
59  return c;
60 }
int to_integer(alps::half_integer< T > const &qn_value)
static const charge IdentityCharge
Definition: nu1_tpl.h:273
template<>
TwoU1::charge state_to_charge< TwoU1 > ( alps::site_state< short > const &  state,
alps::SiteBasisDescriptor< short > const &  b,
std::map< std::string, int > const &  all_conserved_qn 
)

Definition at line 34 of file model_2u1.cpp.

36 {
37  typedef std::map<std::string, int> qn_map_type;
39  for (alps::SiteBasisDescriptor<short>::const_iterator it = b.begin(); it != b.end(); ++it) {
40  qn_map_type::const_iterator match = all_conserved_qn.find(it->name());
41  if (match != all_conserved_qn.end())
42  c[match->second] = detail::to_integer( get_quantumnumber(state, it->name(), b) );
43  }
44  return c;
45 }
int to_integer(alps::half_integer< T > const &qn_value)
static const charge IdentityCharge
Definition: nu1_tpl.h:273