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

Go to the source code of this file.

Functions

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

Function Documentation

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

Definition at line 34 of file model_u1.cpp.

35 {
36  typedef std::map<std::string, int> qn_map_type;
37  assert(all_conserved_qn.size() == 1);
38  qn_map_type::const_iterator it = all_conserved_qn.begin();
39  alps::half_integer<short> tmp = alps::evaluate<double>(static_cast<std::string>(parms[it->first+"_total"]), parms);
40  return U1::charge( detail::to_integer(tmp) );
41 }
int to_integer(alps::half_integer< T > const &qn_value)
int charge
Definition: u1.h:42
template<>
U1::charge state_to_charge< U1 > ( alps::site_state< short > const &  state,
alps::SiteBasisDescriptor< short > const &  b,
std::map< std::string, int > const &  all_conserved_qn 
)

Definition at line 44 of file model_u1.cpp.

46 {
47  typedef std::map<std::string, int> qn_map_type;
49  for (alps::SiteBasisDescriptor<short>::const_iterator it = b.begin(); it != b.end(); ++it) {
50  qn_map_type::const_iterator match = all_conserved_qn.find(it->name());
51  if (match != all_conserved_qn.end())
52  c = detail::to_integer( get_quantumnumber(state, it->name(), b) );
53  }
54  return c;
55 }
int to_integer(alps::half_integer< T > const &qn_value)
static const charge IdentityCharge
Definition: u1.h:45
int charge
Definition: u1.h:42