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

#include <models_2u1.hpp>

Inheritance diagram for FermiHubbardTwoU1< Matrix >:
model_impl< Matrix, TwoU1 >

Public Types

typedef model_impl< Matrix, TwoU1base
 
typedef base::table_type table_type
 
typedef base::table_ptr table_ptr
 
typedef base::tag_type tag_type
 
typedef base::term_descriptor term_descriptor
 
typedef base::terms_type terms_type
 
typedef base::op_t op_t
 
typedef base::measurements_type measurements_type
 
typedef Matrix::value_type value_type
 
typedef boost::shared_ptr
< mps_initializer< Matrix,
TwoU1 > > 
initializer_ptr
 
typedef std::size_t size_t
 

Public Member Functions

 FermiHubbardTwoU1 (const Lattice &lat_, BaseParameters &parms_)
 
void update (BaseParameters const &p)
 
Index< TwoU1 > const & phys_dim (size_t type) const
 
measurements_type measurements () const
 
tag_type identity_matrix_tag (size_t type) const
 
tag_type filling_matrix_tag (size_t type) const
 
TwoU1::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
 
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 FermiHubbardTwoU1< Matrix >

Definition at line 39 of file models_2u1.hpp.

Member Typedef Documentation

template<class Matrix >
typedef model_impl<Matrix, TwoU1> FermiHubbardTwoU1< Matrix >::base

Definition at line 42 of file models_2u1.hpp.

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

Definition at line 49 of file model.h.

template<class Matrix >
typedef base::measurements_type FermiHubbardTwoU1< Matrix >::measurements_type

Definition at line 51 of file models_2u1.hpp.

template<class Matrix >
typedef base::op_t FermiHubbardTwoU1< Matrix >::op_t

Definition at line 50 of file models_2u1.hpp.

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

Definition at line 60 of file model.h.

template<class Matrix >
typedef base::table_ptr FermiHubbardTwoU1< Matrix >::table_ptr

Definition at line 45 of file models_2u1.hpp.

template<class Matrix >
typedef base::table_type FermiHubbardTwoU1< Matrix >::table_type

Definition at line 44 of file models_2u1.hpp.

template<class Matrix >
typedef base::tag_type FermiHubbardTwoU1< Matrix >::tag_type

Definition at line 46 of file models_2u1.hpp.

template<class Matrix >
typedef base::term_descriptor FermiHubbardTwoU1< Matrix >::term_descriptor

Definition at line 48 of file models_2u1.hpp.

template<class Matrix >
typedef base::terms_type FermiHubbardTwoU1< Matrix >::terms_type

Definition at line 49 of file models_2u1.hpp.

template<class Matrix >
typedef Matrix::value_type FermiHubbardTwoU1< Matrix >::value_type

Definition at line 53 of file models_2u1.hpp.

Constructor & Destructor Documentation

template<class Matrix >
FermiHubbardTwoU1< Matrix >::FermiHubbardTwoU1 ( const Lattice lat_,
BaseParameters parms_ 
)
inline

Definition at line 55 of file models_2u1.hpp.

56  : lat(lat_)
57  , parms(parms_)
58  , tag_handler(new TagHandler<Matrix, TwoU1>())
59  {
60  TwoU1::charge A(0), B(0), C(0), D(1);
61  B[0]=1; C[1]=1;
62  phys.insert(std::make_pair(A, 1));
63  phys.insert(std::make_pair(B, 1));
64  phys.insert(std::make_pair(C, 1));
65  phys.insert(std::make_pair(D, 1));
66 
67  op_t create_up_op, create_down_op, destroy_up_op, destroy_down_op,
68  count_up_op, count_down_op, doubly_occ_op,
69  fill_op, ident_op;
70 
71  ident_op.insert_block(Matrix(1, 1, 1), A, A);
72  ident_op.insert_block(Matrix(1, 1, 1), B, B);
73  ident_op.insert_block(Matrix(1, 1, 1), C, C);
74  ident_op.insert_block(Matrix(1, 1, 1), D, D);
75 
76  create_up_op.insert_block(Matrix(1, 1, 1), A, B);
77  create_up_op.insert_block(Matrix(1, 1, 1), C, D);
78  create_down_op.insert_block(Matrix(1, 1, 1), A, C);
79  create_down_op.insert_block(Matrix(1, 1, 1), B, D);
80 
81  destroy_up_op.insert_block(Matrix(1, 1, 1), B, A);
82  destroy_up_op.insert_block(Matrix(1, 1, 1), D, C);
83  destroy_down_op.insert_block(Matrix(1, 1, 1), C, A);
84  destroy_down_op.insert_block(Matrix(1, 1, 1), D, B);
85 
86  count_up_op.insert_block(Matrix(1, 1, 1), B, B);
87  count_up_op.insert_block(Matrix(1, 1, 1), D, D);
88  count_down_op.insert_block(Matrix(1, 1, 1), C, C);
89  count_down_op.insert_block(Matrix(1, 1, 1), D, D);
90 
91  doubly_occ_op.insert_block(Matrix(1, 1, 1), D, D);
92 
93  // TODO: use one sign operator only
94  fill_op.insert_block(Matrix(1, 1, 1), A, A);
95  fill_op.insert_block(Matrix(1, 1, -1), B, B);
96  fill_op.insert_block(Matrix(1, 1, -1), C, C);
97  fill_op.insert_block(Matrix(1, 1, 1), D, D);
98 
99  op_t tmp;
100 
101  gemm(fill_op, create_down_op, tmp);
102  create_down_op = tmp;
103  gemm(destroy_down_op, fill_op, tmp);
104  destroy_down_op = tmp;
105 
106  /**********************************************************************/
107  /*** Create operator tag table ****************************************/
108  /**********************************************************************/
109 
110 #define REGISTER(op, kind) op = tag_handler->register_op(op ## _op, kind);
111 
113  REGISTER(fill, tag_detail::bosonic)
114  REGISTER(create_up, tag_detail::fermionic)
115  REGISTER(create_down, tag_detail::fermionic)
116  REGISTER(destroy_up, tag_detail::fermionic)
117  REGISTER(destroy_down, tag_detail::fermionic)
118  REGISTER(count_up, tag_detail::bosonic)
119  REGISTER(count_down, tag_detail::bosonic)
120  REGISTER(doubly_occ, tag_detail::bosonic)
121 
122 #undef REGISTER
123  /**********************************************************************/
124 
125  value_type U = parms["U"];
126  std::pair<tag_type, value_type> ptag;
127  for (int p=0; p<lat.size(); ++p) {
128  { // U term
129  term_descriptor term;
130  term.coeff = U;
131  term.push_back( boost::make_tuple(p, doubly_occ) );
132  this->terms_.push_back(term);
133  }
134 
135  std::vector<int> neighs = lat.forward(p);
136  for (std::vector<int>::iterator hopto = neighs.begin();
137  hopto != neighs.end(); ++hopto)
138  {
139  value_type ti = get_t(parms,
140  lat.get_prop<int>("type", p, *hopto));
141  { // t*cdag_up*c_up
142  term_descriptor term;
143  term.is_fermionic = true;
144  term.coeff = -ti;
145 
146  ptag = tag_handler->get_product_tag(fill, create_up); // Note inverse notation because of notation in operator.
147  term.coeff *= ptag.second;
148 
149  term.push_back( boost::make_tuple(p, ptag.first) );
150  term.push_back( boost::make_tuple(*hopto, destroy_up) );
151  this->terms_.push_back(term);
152  }
153  { // t*c_up*cdag_up
154  term_descriptor term;
155  term.is_fermionic = true;
156  term.coeff = -ti;
157 
158  ptag = tag_handler->get_product_tag(fill, destroy_up); // Note inverse notation because of notation in operator.
159  term.coeff *= -ptag.second; // Note minus because of anti-commutation
160 
161  term.push_back( boost::make_tuple(p, ptag.first) );
162  term.push_back( boost::make_tuple(*hopto, create_up) );
163  this->terms_.push_back(term);
164  }
165  { // t*cdag_down*c_down
166  term_descriptor term;
167  term.is_fermionic = true;
168  term.coeff = -ti;
169 
170  ptag = tag_handler->get_product_tag(fill, create_down); // Note inverse notation because of notation in operator.
171  term.coeff *= ptag.second;
172 
173  term.push_back( boost::make_tuple(p, ptag.first) );
174  term.push_back( boost::make_tuple(*hopto, destroy_down) );
175  this->terms_.push_back(term);
176  }
177  { // t*c_down*cdag_down
178  term_descriptor term;
179  term.is_fermionic = true;
180  term.coeff = -ti;
181 
182  ptag = tag_handler->get_product_tag(fill, destroy_down); // Note inverse notation because of notation in operator.
183  term.coeff *= -ptag.second; // Note minus because of anti-commutation
184 
185  term.push_back( boost::make_tuple(p, ptag.first) );
186  term.push_back( boost::make_tuple(*hopto, create_down) );
187  this->terms_.push_back(term);
188  }
189  }
190  }
191  }
Matrix::value_type value_type
Definition: models_2u1.hpp:53
size_type insert_block(Matrix const &, charge, charge)
T get_prop(std::string property, pos_t site) const
Definition: lattice.h:103
std::vector< pos_t > forward(pos_t site) const
Definition: lattice.h:100
base::op_t op_t
Definition: models_2u1.hpp:50
void gemm(block_matrix< Matrix1, SymmGroup > const &A, block_matrix< Matrix2, SymmGroup > const &B, block_matrix< Matrix3, SymmGroup > &C)
pos_t size() const
Definition: lattice.h:115
#define REGISTER(op, kind)

Member Function Documentation

virtual op_t const& model_impl< Matrix, TwoU1 >::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 FermiHubbardTwoU1< Matrix >::filling_matrix_tag ( size_t  type) const
inlinevirtual

Implements model_impl< Matrix, TwoU1 >.

Definition at line 264 of file models_2u1.hpp.

265  {
266  return fill;
267  }
virtual op_t const& model_impl< Matrix, TwoU1 >::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 FermiHubbardTwoU1< Matrix >::get_operator_tag ( std::string const &  name,
size_t  type 
) const
inlinevirtual

Implements model_impl< Matrix, TwoU1 >.

Definition at line 276 of file models_2u1.hpp.

277  {
278  if (name == "create_up")
279  return create_up;
280  else if (name == "create_down")
281  return create_down;
282  else if (name == "destroy_up")
283  return destroy_up;
284  else if (name == "destroy_down")
285  return destroy_down;
286  else if (name == "count_up")
287  return count_up;
288  else if (name == "count_down")
289  return count_down;
290  else if (name == "doubly_occ")
291  return doubly_occ;
292  else
293  throw std::runtime_error("Operator not valid for this model.");
294  return 0;
295  }
virtual terms_type const& model_impl< Matrix, TwoU1 >::hamiltonian_terms ( ) const
inlinevirtualinherited

Definition at line 74 of file model.h.

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

Implements model_impl< Matrix, TwoU1 >.

Definition at line 260 of file models_2u1.hpp.

261  {
262  return ident;
263  }
virtual initializer_ptr model_impl< Matrix, TwoU1 >::initializer ( Lattice const &  lat,
BaseParameters parms 
) const
virtualinherited
template<class Matrix >
measurements_type FermiHubbardTwoU1< Matrix >::measurements ( ) const
inlinevirtual

Implements model_impl< Matrix, TwoU1 >.

Definition at line 205 of file models_2u1.hpp.

206  {
207  typedef std::vector<block_matrix<Matrix, TwoU1> > op_vec;
208  typedef std::vector<std::pair<op_vec, bool> > bond_element;
209 
210  measurements_type meas;
211 
212  if (parms["MEASURE[Density]"]) {
213  meas.push_back( new measurements::average<Matrix, TwoU1>("Density up", lat,
214  op_vec(1,this->identity_matrix(0)),
215  op_vec(1,this->filling_matrix(0)),
216  op_vec(1,tag_handler->get_op(count_up))) );
217  }
218  if (parms["MEASURE[Density]"]) {
219  meas.push_back( new measurements::average<Matrix, TwoU1>("Density down", lat,
220  op_vec(1,this->identity_matrix(0)),
221  op_vec(1,this->filling_matrix(0)),
222  op_vec(1,tag_handler->get_op(count_down))) );
223  }
224 
225  if (parms["MEASURE[Local density]"]) {
226  meas.push_back( new measurements::local<Matrix, TwoU1>("Local density up", lat,
227  op_vec(1,this->identity_matrix(0)),
228  op_vec(1,this->filling_matrix(0)),
229  op_vec(1,tag_handler->get_op(count_up))) );
230  }
231  if (parms["MEASURE[Local density]"]) {
232  meas.push_back( new measurements::local<Matrix, TwoU1>("Local density down", lat,
233  op_vec(1,this->identity_matrix(0)),
234  op_vec(1,this->filling_matrix(0)),
235  op_vec(1,tag_handler->get_op(count_down))) );
236  }
237 
238  if (parms["MEASURE[Onebody density matrix]"]) {
239  bond_element ops;
240  ops.push_back( std::make_pair(op_vec(1,tag_handler->get_op(create_up)), true) );
241  ops.push_back( std::make_pair(op_vec(1,tag_handler->get_op(destroy_up)), true) );
242  meas.push_back( new measurements::correlations<Matrix, TwoU1>("Onebody density matrix up", lat,
243  op_vec(1,this->identity_matrix(0)),
244  op_vec(1,this->filling_matrix(0)),
245  ops, false, false) );
246  }
247  if (parms["MEASURE[Onebody density matrix]"]) {
248  bond_element ops;
249  ops.push_back( std::make_pair(op_vec(1,tag_handler->get_op(create_down)), true) );
250  ops.push_back( std::make_pair(op_vec(1,tag_handler->get_op(destroy_down)), true) );
251  meas.push_back( new measurements::correlations<Matrix, TwoU1>("Onebody density matrix down", lat,
252  op_vec(1,this->identity_matrix(0)),
253  op_vec(1,this->filling_matrix(0)),
254  ops, false, false) );
255  }
256 
257  return meas;
258  }
virtual op_t const & identity_matrix(size_t type) const
Definition: model.h:67
base::measurements_type measurements_type
Definition: models_2u1.hpp:51
virtual op_t const & filling_matrix(size_t type) const
Definition: model.h:69
template<class Matrix >
table_ptr FermiHubbardTwoU1< Matrix >::operators_table ( ) const
inlinevirtual

Implements model_impl< Matrix, TwoU1 >.

Definition at line 297 of file models_2u1.hpp.

298  {
299  return tag_handler;
300  }
template<class Matrix >
Index<TwoU1> const& FermiHubbardTwoU1< Matrix >::phys_dim ( size_t  type) const
inlinevirtual

Implements model_impl< Matrix, TwoU1 >.

Definition at line 200 of file models_2u1.hpp.

201  {
202  return phys;
203  }
template<class Matrix >
TwoU1::charge FermiHubbardTwoU1< Matrix >::total_quantum_numbers ( BaseParameters parms) const
inlinevirtual

Implements model_impl< Matrix, TwoU1 >.

Definition at line 268 of file models_2u1.hpp.

269  {
270  typename TwoU1::charge ret(0);
271  ret[0] = static_cast<int>(parms["u1_total_charge1"]);
272  ret[1] = static_cast<int>(parms["u1_total_charge2"]);
273  return ret;
274  }
template<class Matrix >
void FermiHubbardTwoU1< Matrix >::update ( BaseParameters const &  p)
inlinevirtual

Implements model_impl< Matrix, TwoU1 >.

Definition at line 193 of file models_2u1.hpp.

194  {
195  // TODO: update this->terms_ with the new parameters
196  throw std::runtime_error("update() not yet implemented for this model.");
197  return;
198  }

Member Data Documentation

terms_type model_impl< Matrix, TwoU1 >::terms_
protectedinherited

Definition at line 85 of file model.h.


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