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
HCB< Matrix > Class Template Reference

#include <models_u1.hpp>

Inheritance diagram for HCB< 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

 HCB (const Lattice &lat, double t=1)
 
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 HCB< Matrix >

Definition at line 170 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 >
HCB< Matrix >::HCB ( const Lattice lat,
double  t = 1 
)
inline

Definition at line 184 of file models_u1.hpp.

185  : tag_handler(new table_type())
186  {
187  phys.insert(std::make_pair(0, 1));
188  phys.insert(std::make_pair(1, 1));
189 
190  op_t ident_op;
191  op_t create_op, destroy_op, count_op;
192 
193  ident_op.insert_block(Matrix(1, 1, 1), 0, 0);
194  ident_op.insert_block(Matrix(1, 1, 1), 1, 1);
195 
196  create_op.insert_block(Matrix(1, 1, 1), 0, 1);
197  destroy_op.insert_block(Matrix(1, 1, 1), 1, 0);
198 
199  count_op.insert_block(Matrix(1, 1, 1), 1, 1);
200 
201  /**********************************************************************/
202  /*** Create operator tag table ****************************************/
203  /**********************************************************************/
204 
205 #define REGISTER(op, kind) op = tag_handler->register_op(op ## _op, kind);
206 
208  REGISTER(create, tag_detail::bosonic)
209  REGISTER(destroy, tag_detail::bosonic)
210  REGISTER(count, tag_detail::bosonic)
211 
212 #undef REGISTER
213  /**********************************************************************/
214 
215 
216  for (int p=0; p<lat.size(); ++p) {
217  std::vector<int> neighs = lat.forward(p);
218  for (int n=0; n<neighs.size(); ++n) {
219  {
220  term_descriptor term;
221  term.coeff = -t;
222  term.push_back( boost::make_tuple(p, create) );
223  term.push_back( boost::make_tuple(neighs[n], destroy) );
224  this->terms_.push_back(term);
225  }
226  {
227  term_descriptor term;
228  term.coeff = -t;
229  term.push_back( boost::make_tuple(p, destroy) );
230  term.push_back( boost::make_tuple(neighs[n], create) );
231  this->terms_.push_back(term);
232  }
233  }
234  }
235 
236  }
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 HCB< Matrix >::filling_matrix_tag ( size_t  type) const
inlinevirtual

Implements model_impl< Matrix, U1 >.

Definition at line 254 of file models_u1.hpp.

255  {
256  return identity_matrix_tag(type);
257  }
tag_type identity_matrix_tag(size_t type) const
Definition: models_u1.hpp:250
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 HCB< Matrix >::get_operator_tag ( std::string const &  name,
size_t  type 
) const
inlinevirtual

Implements model_impl< Matrix, U1 >.

Definition at line 268 of file models_u1.hpp.

269  {
270  if (name == "n")
271  return count;
272  else if (name == "bdag")
273  return create;
274  else if (name == "b")
275  return destroy;
276  else
277  throw std::runtime_error("Operator not valid for this model.");
278  return 0;
279  }
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 HCB< Matrix >::identity_matrix_tag ( size_t  type) const
inlinevirtual

Implements model_impl< Matrix, U1 >.

Definition at line 250 of file models_u1.hpp.

251  {
252  return ident;
253  }
virtual initializer_ptr model_impl< Matrix, U1 >::initializer ( Lattice const &  lat,
BaseParameters parms 
) const
virtualinherited
template<class Matrix >
measurements_type HCB< Matrix >::measurements ( ) const
inlinevirtual

Implements model_impl< Matrix, U1 >.

Definition at line 263 of file models_u1.hpp.

264  {
265  return measurements_type();
266  }
template<class Matrix >
table_ptr HCB< Matrix >::operators_table ( ) const
inlinevirtual

Implements model_impl< Matrix, U1 >.

Definition at line 281 of file models_u1.hpp.

282  {
283  return tag_handler;
284  }
template<class Matrix >
Index<U1> const& HCB< Matrix >::phys_dim ( size_t  type) const
inlinevirtual

Implements model_impl< Matrix, U1 >.

Definition at line 246 of file models_u1.hpp.

247  {
248  return phys;
249  }
template<class Matrix >
U1::charge HCB< Matrix >::total_quantum_numbers ( BaseParameters parms) const
inlinevirtual

Implements model_impl< Matrix, U1 >.

Definition at line 258 of file models_u1.hpp.

259  {
260  return static_cast<int>(parms["u1_total_charge"]);
261  }
template<class Matrix >
void HCB< Matrix >::update ( BaseParameters const &  p)
inlinevirtual

Implements model_impl< Matrix, U1 >.

Definition at line 239 of file models_u1.hpp.

240  {
241  // TODO: update this->terms_ with the new parameters
242  throw std::runtime_error("update() not yet implemented for this model.");
243  return;
244  }

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: