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

#include <models_none.hpp>

Inheritance diagram for BoseHubbardNone< Matrix >:
model_impl< Matrix, TrivialGroup >

Public Types

typedef boost::shared_ptr
< mps_initializer< Matrix,
TrivialGroup > > 
initializer_ptr
 

Public Member Functions

 BoseHubbardNone (const Lattice &lat, BaseParameters &model_)
 
void update (BaseParameters const &p)
 
Index< TrivialGroup > 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
 
TrivialGroup::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 BoseHubbardNone< Matrix >

Definition at line 38 of file models_none.hpp.

Member Typedef Documentation

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

Definition at line 49 of file model.h.

Constructor & Destructor Documentation

template<class Matrix >
BoseHubbardNone< Matrix >::BoseHubbardNone ( const Lattice lat,
BaseParameters model_ 
)
inline

Definition at line 55 of file models_none.hpp.

56  : model(model_)
57  , lattice(lat)
58  , tag_handler(new table_type())
59  {
60  int Nmax = model["Nmax"];
61  double U = model["U"];
62  double t = model["t"];
63  double V = model["V"];
64 
65  op_t ident_op;
66  op_t create_op, destroy_op, count_op, interaction_op;
67 
69  size_t N = Nmax+1;
70 
71  phys.insert(std::make_pair(C, N));
72  ident_op.insert_block(Matrix::identity_matrix(N), C, C);
73 
74  Matrix mcount(N,N), minteraction(N,N), mcreate(N,N), mdestroy(N,N);
75  for (int n=1; n<=Nmax; ++n)
76  {
77  mcount(n,n) = n;
78  if ((n*n-n) != 0)
79  minteraction(n,n) = n*n-n;
80 
81  mcreate(n-1,n) = std::sqrt(value_type(n)); // input n-1, output n
82  mdestroy(n,n-1) = std::sqrt(value_type(n)); // input n, output n-1
83  }
84  count_op.insert_block(mcount, C,C);
85  interaction_op.insert_block(minteraction, C,C);
86  create_op.insert_block(mcreate, C,C);
87  destroy_op.insert_block(mdestroy, C,C);
88 
89  /**********************************************************************/
90  /*** Create operator tag table ****************************************/
91  /**********************************************************************/
92 
93 #define REGISTER(op, kind) op = tag_handler->register_op(op ## _op, kind);
94 
96  REGISTER(create, tag_detail::bosonic)
97  REGISTER(destroy, tag_detail::bosonic)
98  REGISTER(count, tag_detail::bosonic)
99  REGISTER(interaction, tag_detail::bosonic)
100 
101 #undef REGISTER
102  /**********************************************************************/
103 
104 
105  for (int p=0; p<lat.size(); ++p) {
106  /* interaction */
107  if (U != 0.) {
108  term_descriptor term;
109  term.is_fermionic = false;
110  term.coeff = U/2.;
111  term.push_back( boost::make_tuple(p, interaction) );
112  this->terms_.push_back(term);
113  }
114 
115  std::vector<int> neighs = lat.forward(p);
116  for (int n=0; n<neighs.size(); ++n) {
117  /* hopping */
118  {
119  term_descriptor term;
120  term.coeff = -t;
121  term.push_back( boost::make_tuple(p, create) );
122  term.push_back( boost::make_tuple(neighs[n], destroy) );
123  this->terms_.push_back(term);
124  }
125  {
126  term_descriptor term;
127  term.coeff = -t;
128  term.push_back( boost::make_tuple(p, destroy) );
129  term.push_back( boost::make_tuple(neighs[n], create) );
130  this->terms_.push_back(term);
131  }
132  /* nearest-neighborn interaction */
133  if (V != 0.){
134  term_descriptor term;
135  term.coeff = V;
136  term.push_back( boost::make_tuple(p, count) );
137  term.push_back( boost::make_tuple(neighs[n], count) );
138  this->terms_.push_back(term);
139  }
140  }
141  }
142 
143  }
block_matrix< Matrix, SymmGroup > identity_matrix(Index< SymmGroup > const &size)
block_matrix< Matrix, SymmGroup > sqrt(block_matrix< Matrix, SymmGroup > m)
#define REGISTER(op, kind)
static const charge IdentityCharge
Definition: none.h:44
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, TrivialGroup >::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 BoseHubbardNone< Matrix >::filling_matrix_tag ( size_t  type) const
inlinevirtual

Implements model_impl< Matrix, TrivialGroup >.

Definition at line 160 of file models_none.hpp.

161  {
162  return identity_matrix_tag(type);
163  }
tag_type identity_matrix_tag(size_t type) const
virtual op_t const& model_impl< Matrix, TrivialGroup >::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 BoseHubbardNone< Matrix >::get_operator_tag ( std::string const &  name,
size_t  type 
) const
inlinevirtual

Implements model_impl< Matrix, TrivialGroup >.

Definition at line 204 of file models_none.hpp.

205  {
206  if (name == "n")
207  return count;
208  else if (name == "bdag")
209  return create;
210  else if (name == "b")
211  return destroy;
212  else
213  throw std::runtime_error("Operator not valid for this model.");
214  return 0;
215  }
virtual terms_type const& model_impl< Matrix, TrivialGroup >::hamiltonian_terms ( ) const
inlinevirtualinherited

Definition at line 74 of file model.h.

74 { return terms_; }
virtual op_t const& model_impl< Matrix, TrivialGroup >::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 BoseHubbardNone< Matrix >::identity_matrix_tag ( size_t  type) const
inlinevirtual

Implements model_impl< Matrix, TrivialGroup >.

Definition at line 156 of file models_none.hpp.

157  {
158  return ident;
159  }
virtual initializer_ptr model_impl< Matrix, TrivialGroup >::initializer ( Lattice const &  lat,
BaseParameters parms 
) const
virtualinherited
template<class Matrix >
measurements_type BoseHubbardNone< Matrix >::measurements ( ) const
inlinevirtual

Implements model_impl< Matrix, TrivialGroup >.

Definition at line 170 of file models_none.hpp.

171  {
172  typedef std::vector<block_matrix<Matrix, TrivialGroup> > op_vec;
173  typedef std::vector<std::pair<op_vec, bool> > bond_element;
174 
175  measurements_type meas;
176 
177  if (model["MEASURE[Density]"]) {
178  meas.push_back( new measurements::average<Matrix, TrivialGroup>("Density", lattice,
179  op_vec(1,this->identity_matrix(0)),
180  op_vec(1,this->filling_matrix(0)),
181  op_vec(1,tag_handler->get_op(count))) );
182  }
183 
184  if (model["MEASURE[Local density]"]) {
185  meas.push_back( new measurements::local<Matrix, TrivialGroup>("Local density", lattice,
186  op_vec(1,this->identity_matrix(0)),
187  op_vec(1,this->filling_matrix(0)),
188  op_vec(1,tag_handler->get_op(count))) );
189  }
190 
191  if (model["MEASURE[Onebody density matrix]"]) {
192  bond_element ops;
193  ops.push_back( std::make_pair(op_vec(1,tag_handler->get_op(create)), false) );
194  ops.push_back( std::make_pair(op_vec(1,tag_handler->get_op(destroy)), false) );
195  meas.push_back( new measurements::correlations<Matrix, TrivialGroup>("Onebody density matrix", lattice,
196  op_vec(1,this->identity_matrix(0)),
197  op_vec(1,this->filling_matrix(0)),
198  ops, true, false) );
199  }
200 
201  return meas;
202  }
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 BoseHubbardNone< Matrix >::operators_table ( ) const
inlinevirtual

Implements model_impl< Matrix, TrivialGroup >.

Definition at line 217 of file models_none.hpp.

218  {
219  return tag_handler;
220  }
template<class Matrix >
Index<TrivialGroup> const& BoseHubbardNone< Matrix >::phys_dim ( size_t  type) const
inlinevirtual

Implements model_impl< Matrix, TrivialGroup >.

Definition at line 152 of file models_none.hpp.

153  {
154  return phys;
155  }
template<class Matrix >
TrivialGroup::charge BoseHubbardNone< Matrix >::total_quantum_numbers ( BaseParameters parms) const
inlinevirtual

Implements model_impl< Matrix, TrivialGroup >.

Definition at line 164 of file models_none.hpp.

165  {
167  }
static const charge IdentityCharge
Definition: none.h:44
template<class Matrix >
void BoseHubbardNone< Matrix >::update ( BaseParameters const &  p)
inlinevirtual

Implements model_impl< Matrix, TrivialGroup >.

Definition at line 145 of file models_none.hpp.

146  {
147  // TODO: update this->terms_ with the new parameters
148  throw std::runtime_error("update() not yet implemented for this model.");
149  return;
150  }

Member Data Documentation

terms_type model_impl< Matrix, TrivialGroup >::terms_
protectedinherited

Definition at line 85 of file model.h.


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