ALPS MPS Codes
Reference documentation.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Protected Attributes | List of all members
Heisenberg< Matrix > Class Template Reference

#include <models_u1.hpp>

Inheritance diagram for Heisenberg< Matrix >:
model_impl< Matrix, U1 >

Public Types

typedef boost::shared_ptr
< mps_initializer< Matrix, U1 > > 
initializer_ptr
 
typedef std::size_t size_t
 

Public Member Functions

 Heisenberg (const Lattice &lat, double Jxy, double Jz)
 
void update (BaseParameters const &p)
 
Index< U1 > const & phys_dim (size_t type) const
 
tag_type identity_matrix_tag (size_t type) const
 
tag_type filling_matrix_tag (size_t type) const
 
U1::charge total_quantum_numbers (BaseParameters &parms) const
 
measurements_type measurements () const
 
tag_type get_operator_tag (std::string const &name, size_t type) const
 
table_ptr operators_table () const
 
virtual op_t const & identity_matrix (size_t type) const
 
virtual op_t const & filling_matrix (size_t type) const
 
virtual terms_type const & hamiltonian_terms () const
 
virtual op_t const & get_operator (std::string const &name, size_t type) const
 
virtual initializer_ptr initializer (Lattice const &lat, BaseParameters &parms) const
 

Protected Attributes

terms_type terms_
 

Detailed Description

template<class Matrix>
class Heisenberg< Matrix >

Definition at line 39 of file models_u1.hpp.

Member Typedef Documentation

typedef boost::shared_ptr<mps_initializer<Matrix, U1 > > model_impl< Matrix, U1 >::initializer_ptr
inherited

Definition at line 49 of file model.h.

typedef std::size_t model_impl< Matrix, U1 >::size_t
inherited

Definition at line 60 of file model.h.

Constructor & Destructor Documentation

template<class Matrix >
Heisenberg< Matrix >::Heisenberg ( const Lattice lat,
double  Jxy,
double  Jz 
)
inline

Definition at line 53 of file models_u1.hpp.

54  : tag_handler(new table_type())
55  {
56  phys.insert(std::make_pair(1, 1));
57  phys.insert(std::make_pair(-1, 1));
58 
59  op_t ident_op, splus_op, sminus_op, sz_op;
60 
61  ident_op.insert_block(Matrix(1, 1, 1), -1, -1);
62  ident_op.insert_block(Matrix(1, 1, 1), 1, 1);
63 
64  splus_op.insert_block(Matrix(1, 1, 1), -1, 1);
65 
66  sminus_op.insert_block(Matrix(1, 1, 1), 1, -1);
67 
68  sz_op.insert_block(Matrix(1, 1, 0.5), 1, 1);
69  sz_op.insert_block(Matrix(1, 1, -0.5), -1, -1);
70 
71  /**********************************************************************/
72  /*** Create operator tag table ****************************************/
73  /**********************************************************************/
74 
75 #define REGISTER(op, kind) op = tag_handler->register_op(op ## _op, kind);
76 
78  REGISTER(splus, tag_detail::bosonic)
79  REGISTER(sminus, tag_detail::bosonic)
80  REGISTER(sz, tag_detail::bosonic)
81 
82 #undef REGISTER
83  /**********************************************************************/
84 
85 
86  for (int p=0; p<lat.size(); ++p) {
87  std::vector<int> neighs = lat.forward(p);
88  for (int n=0; n<neighs.size(); ++n) {
89  {
90  term_descriptor term;
91  term.coeff = Jz;
92  term.push_back( boost::make_tuple(p, sz) );
93  term.push_back( boost::make_tuple(neighs[n], sz) );
94  this->terms_.push_back(term);
95  }
96  {
97  term_descriptor term;
98  term.coeff = Jxy/2;
99  term.push_back( boost::make_tuple(p, splus) );
100  term.push_back( boost::make_tuple(neighs[n], sminus) );
101  this->terms_.push_back(term);
102  }
103  {
104  term_descriptor term;
105  term.coeff = Jxy/2;
106  term.push_back( boost::make_tuple(p, sminus) );
107  term.push_back( boost::make_tuple(neighs[n], splus) );
108  this->terms_.push_back(term);
109  }
110  }
111  }
112 
113  }
terms_type terms_
Definition: model.h:85
#define REGISTER(op, kind)
size_type insert_block(Matrix const &, charge, charge)
std::vector< pos_t > forward(pos_t site) const
Definition: lattice.h:100
std::size_t insert(std::pair< charge, std::size_t > const &x)
pos_t size() const
Definition: lattice.h:115

Member Function Documentation

virtual op_t const& model_impl< Matrix, U1 >::filling_matrix ( size_t  type) const
inlinevirtualinherited

Definition at line 69 of file model.h.

69 { return operators_table()->get_op( filling_matrix_tag(type) ); }
virtual table_ptr operators_table() const =0
virtual tag_type filling_matrix_tag(size_t type) const =0
template<class Matrix >
tag_type Heisenberg< Matrix >::filling_matrix_tag ( size_t  type) const
inlinevirtual

Implements model_impl< Matrix, U1 >.

Definition at line 129 of file models_u1.hpp.

130  {
131  return identity_matrix_tag(type);
132  }
tag_type identity_matrix_tag(size_t type) const
Definition: models_u1.hpp:125
virtual op_t const& model_impl< Matrix, U1 >::get_operator ( std::string const &  name,
size_t  type 
) const
inlinevirtualinherited

Definition at line 77 of file model.h.

77 { return operators_table()->get_op( get_operator_tag(name, type) ); }
virtual tag_type get_operator_tag(std::string const &name, size_t type) const =0
virtual table_ptr operators_table() const =0
template<class Matrix >
tag_type Heisenberg< Matrix >::get_operator_tag ( std::string const &  name,
size_t  type 
) const
inlinevirtual

Implements model_impl< Matrix, U1 >.

Definition at line 143 of file models_u1.hpp.

144  {
145  if (name == "splus")
146  return splus;
147  else if (name == "sminus")
148  return sminus;
149  else if (name == "sz")
150  return sz;
151  else
152  throw std::runtime_error("Operator not valid for this model.");
153  return 0;
154  }
virtual terms_type const& model_impl< Matrix, U1 >::hamiltonian_terms ( ) const
inlinevirtualinherited

Definition at line 74 of file model.h.

74 { return terms_; }
terms_type terms_
Definition: model.h:85
virtual op_t const& model_impl< Matrix, U1 >::identity_matrix ( size_t  type) const
inlinevirtualinherited

Definition at line 67 of file model.h.

67 { return operators_table()->get_op( identity_matrix_tag(type) ); }
virtual table_ptr operators_table() const =0
virtual tag_type identity_matrix_tag(size_t type) const =0
template<class Matrix >
tag_type Heisenberg< Matrix >::identity_matrix_tag ( size_t  type) const
inlinevirtual

Implements model_impl< Matrix, U1 >.

Definition at line 125 of file models_u1.hpp.

126  {
127  return ident;
128  }
virtual initializer_ptr model_impl< Matrix, U1 >::initializer ( Lattice const &  lat,
BaseParameters parms 
) const
virtualinherited
template<class Matrix >
measurements_type Heisenberg< Matrix >::measurements ( ) const
inlinevirtual

Implements model_impl< Matrix, U1 >.

Definition at line 138 of file models_u1.hpp.

139  {
140  return measurements_type();
141  }
template<class Matrix >
table_ptr Heisenberg< Matrix >::operators_table ( ) const
inlinevirtual

Implements model_impl< Matrix, U1 >.

Definition at line 156 of file models_u1.hpp.

157  {
158  return tag_handler;
159  }
template<class Matrix >
Index<U1> const& Heisenberg< Matrix >::phys_dim ( size_t  type) const
inlinevirtual

Implements model_impl< Matrix, U1 >.

Definition at line 121 of file models_u1.hpp.

122  {
123  return phys;
124  }
template<class Matrix >
U1::charge Heisenberg< Matrix >::total_quantum_numbers ( BaseParameters parms) const
inlinevirtual

Implements model_impl< Matrix, U1 >.

Definition at line 133 of file models_u1.hpp.

134  {
135  return static_cast<int>(parms["u1_total_charge"]);
136  }
template<class Matrix >
void Heisenberg< Matrix >::update ( BaseParameters const &  p)
inlinevirtual

Implements model_impl< Matrix, U1 >.

Definition at line 115 of file models_u1.hpp.

116  {
117  // TODO: update this->terms_ with the new parameters
118  return;
119  }

Member Data Documentation

terms_type model_impl< Matrix, U1 >::terms_
protectedinherited

Definition at line 85 of file model.h.


The documentation for this class was generated from the following file: