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

#include <models_u1.hpp>

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

 BoseHubbard (const Lattice &lat_, BaseParameters &model_)
 
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
 
tag_type get_operator_tag (std::string const &name, size_t type) const
 
table_ptr operators_table () const
 
measurements_type measurements () 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 BoseHubbard< Matrix >

Definition at line 296 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 >
BoseHubbard< Matrix >::BoseHubbard ( const Lattice lat_,
BaseParameters model_ 
)
inline

Definition at line 311 of file models_u1.hpp.

312  : lat(lat_)
313  , model(model_)
314  , tag_handler(new table_type())
315  {
316  int Nmax = model["Nmax"];
317  double t = model["t"];
318  double U = model["U"];
319  double V = model["V"];
320 
321  op_t ident_op;
322  op_t create_op, destroy_op, count_op, interaction_op;
323 
324  phys.insert(std::make_pair(0, 1));
325  ident_op.insert_block(Matrix(1, 1, 1), 0, 0);
326 
327  for (int n=1; n<=Nmax; ++n)
328  {
329  phys.insert(std::make_pair(n, 1));
330 
331  ident_op.insert_block(Matrix(1, 1, 1), n, n);
332 
333  count_op.insert_block(Matrix(1, 1, n), n, n);
334  if ((n*n-n) != 0)
335  interaction_op.insert_block(Matrix(1, 1, n*n-n), n, n);
336 
337 
338  create_op.insert_block(Matrix(1, 1, std::sqrt(value_type(n))), n-1, n);
339  destroy_op.insert_block(Matrix(1, 1, std::sqrt(value_type(n))), n, n-1);
340  }
341 
342 
343  /**********************************************************************/
344  /*** Create operator tag table ****************************************/
345  /**********************************************************************/
346 
347 #define REGISTER(op, kind) op = tag_handler->register_op(op ## _op, kind);
348 
350  REGISTER(create, tag_detail::bosonic)
351  REGISTER(destroy, tag_detail::bosonic)
352  REGISTER(count, tag_detail::bosonic)
353  REGISTER(interaction, tag_detail::bosonic)
354 
355 #undef REGISTER
356  /**********************************************************************/
357 
358 
359  for (int p=0; p<lat.size(); ++p) {
360  /* interaction */
361  {
362  term_descriptor term;
363  term.coeff = U/2.;
364  term.push_back( boost::make_tuple(p, interaction) );
365  this->terms_.push_back(term);
366  }
367 
368  std::vector<int> neighs = lat.forward(p);
369  for (int n=0; n<neighs.size(); ++n) {
370  /* hopping */
371  {
372  term_descriptor term;
373  term.coeff = -t;
374  term.push_back( boost::make_tuple(p, create) );
375  term.push_back( boost::make_tuple(neighs[n], destroy) );
376  this->terms_.push_back(term);
377  }
378  {
379  term_descriptor term;
380  term.coeff = -t;
381  term.push_back( boost::make_tuple(p, destroy) );
382  term.push_back( boost::make_tuple(neighs[n], create) );
383  this->terms_.push_back(term);
384  }
385  /* nearest-neighborn interaction */
386  {
387  term_descriptor term;
388  term.coeff = V;
389  term.push_back( boost::make_tuple(p, count) );
390  term.push_back( boost::make_tuple(neighs[n], count) );
391  this->terms_.push_back(term);
392  }
393  }
394  }
395 
396  }
terms_type terms_
Definition: model.h:85
#define REGISTER(op, kind)
block_matrix< Matrix, SymmGroup > sqrt(block_matrix< Matrix, SymmGroup > m)
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 BoseHubbard< Matrix >::filling_matrix_tag ( size_t  type) const
inlinevirtual

Implements model_impl< Matrix, U1 >.

Definition at line 413 of file models_u1.hpp.

414  {
415  return identity_matrix_tag(type);
416  }
tag_type identity_matrix_tag(size_t type) const
Definition: models_u1.hpp:409
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 BoseHubbard< Matrix >::get_operator_tag ( std::string const &  name,
size_t  type 
) const
inlinevirtual

Implements model_impl< Matrix, U1 >.

Definition at line 422 of file models_u1.hpp.

423  {
424  if (name == "n")
425  return count;
426  else if (name == "bdag")
427  return create;
428  else if (name == "b")
429  return destroy;
430  else if (name == "id")
431  return ident;
432  else if (name == "fill")
433  return ident;
434  else
435  throw std::runtime_error("Operator not valid for this model.");
436  return 0;
437  }
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 BoseHubbard< Matrix >::identity_matrix_tag ( size_t  type) const
inlinevirtual

Implements model_impl< Matrix, U1 >.

Definition at line 409 of file models_u1.hpp.

410  {
411  return ident;
412  }
virtual initializer_ptr model_impl< Matrix, U1 >::initializer ( Lattice const &  lat,
BaseParameters parms 
) const
virtualinherited
template<class Matrix >
measurements_type BoseHubbard< Matrix >::measurements ( ) const
inlinevirtual

Implements model_impl< Matrix, U1 >.

Definition at line 444 of file models_u1.hpp.

445  {
446  typedef std::vector<block_matrix<Matrix, U1> > op_vec;
447  typedef std::vector<std::pair<op_vec, bool> > bond_element;
448 
449  measurements_type meas;
450 
451  if (model["MEASURE[Density]"]) {
452  std::string name = "Density";
453  meas.push_back( new measurements::average<Matrix, U1>(name, lat,
454  op_vec(1,this->identity_matrix(0)),
455  op_vec(1,this->filling_matrix(0)),
456  op_vec(1,tag_handler->get_op(count))) );
457  }
458 
459  if (model["MEASURE[Local density]"]) {
460  std::string name = "Local density";
461  meas.push_back( new measurements::local<Matrix, U1>(name, lat,
462  op_vec(1,this->identity_matrix(0)),
463  op_vec(1,this->filling_matrix(0)),
464  op_vec(1,tag_handler->get_op(count))) );
465  }
466 
467  if (model["MEASURE[Onebody density matrix]"]) {
468  std::string name = "Onebody density matrix";
469  bond_element ops;
470  ops.push_back( std::make_pair(op_vec(1,tag_handler->get_op(create)), false) );
471  ops.push_back( std::make_pair(op_vec(1,tag_handler->get_op(destroy)), false) );
472  meas.push_back( new measurements::correlations<Matrix, U1>(name, lat,
473  op_vec(1,this->identity_matrix(0)),
474  op_vec(1,this->filling_matrix(0)),
475  ops, true, false) );
476  }
477 
478  return meas;
479  }
virtual op_t const & identity_matrix(size_t type) const
Definition: model.h:67
virtual op_t const & filling_matrix(size_t type) const
Definition: model.h:69
template<class Matrix >
table_ptr BoseHubbard< Matrix >::operators_table ( ) const
inlinevirtual

Implements model_impl< Matrix, U1 >.

Definition at line 439 of file models_u1.hpp.

440  {
441  return tag_handler;
442  }
template<class Matrix >
Index<U1> const& BoseHubbard< Matrix >::phys_dim ( size_t  type) const
inlinevirtual

Implements model_impl< Matrix, U1 >.

Definition at line 405 of file models_u1.hpp.

406  {
407  return phys;
408  }
template<class Matrix >
U1::charge BoseHubbard< Matrix >::total_quantum_numbers ( BaseParameters parms) const
inlinevirtual

Implements model_impl< Matrix, U1 >.

Definition at line 417 of file models_u1.hpp.

418  {
419  return static_cast<int>(parms["u1_total_charge"]);
420  }
template<class Matrix >
void BoseHubbard< Matrix >::update ( BaseParameters const &  p)
inlinevirtual

Implements model_impl< Matrix, U1 >.

Definition at line 398 of file models_u1.hpp.

399  {
400  // TODO: update this->terms_ with the new parameters
401  throw std::runtime_error("update() not yet implemented for this model.");
402  return;
403  }

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: