28 #ifndef MODELS_CODED_2U1_H
29 #define MODELS_CODED_2U1_H
38 template<
class Matrix>
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));
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,
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;
110 #define REGISTER(op, kind) op = tag_handler->register_op(op ## _op, kind);
126 std::pair<tag_type, value_type> ptag;
127 for (
int p=0; p<lat.
size(); ++p) {
131 term.push_back( boost::make_tuple(p, doubly_occ) );
132 this->
terms_.push_back(term);
135 std::vector<int> neighs = lat.
forward(p);
136 for (std::vector<int>::iterator hopto = neighs.begin();
137 hopto != neighs.end(); ++hopto)
140 lat.
get_prop<
int>(
"type", p, *hopto));
146 ptag = tag_handler->get_product_tag(fill, create_up);
147 term.
coeff *= ptag.second;
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);
158 ptag = tag_handler->get_product_tag(fill, destroy_up);
159 term.
coeff *= -ptag.second;
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);
170 ptag = tag_handler->get_product_tag(fill, create_down);
171 term.
coeff *= ptag.second;
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);
182 ptag = tag_handler->get_product_tag(fill, destroy_down);
183 term.
coeff *= -ptag.second;
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);
196 throw std::runtime_error(
"update() not yet implemented for this model.");
207 typedef std::vector<block_matrix<Matrix, TwoU1> > op_vec;
208 typedef std::vector<std::pair<op_vec, bool> > bond_element;
212 if (parms[
"MEASURE[Density]"]) {
216 op_vec(1,tag_handler->get_op(count_up))) );
218 if (parms[
"MEASURE[Density]"]) {
222 op_vec(1,tag_handler->get_op(count_down))) );
225 if (parms[
"MEASURE[Local density]"]) {
229 op_vec(1,tag_handler->get_op(count_up))) );
231 if (parms[
"MEASURE[Local density]"]) {
235 op_vec(1,tag_handler->get_op(count_down))) );
238 if (parms[
"MEASURE[Onebody density matrix]"]) {
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) );
245 ops,
false,
false) );
247 if (parms[
"MEASURE[Onebody density matrix]"]) {
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) );
254 ops,
false,
false) );
271 ret[0] =
static_cast<int>(parms[
"u1_total_charge1"]);
272 ret[1] =
static_cast<int>(parms[
"u1_total_charge2"]);
278 if (name ==
"create_up")
280 else if (name ==
"create_down")
282 else if (name ==
"destroy_up")
284 else if (name ==
"destroy_down")
286 else if (name ==
"count_up")
288 else if (name ==
"count_down")
290 else if (name ==
"doubly_occ")
293 throw std::runtime_error(
"Operator not valid for this model.");
308 boost::shared_ptr<TagHandler<Matrix, TwoU1> > tag_handler;
309 tag_type create_up, create_down, destroy_up, destroy_down,
310 count_up, count_down, doubly_occ,
316 std::ostringstream key;
318 return (parms.
is_set(key.str())) ? parms[key.str()] : parms[
"t"];
boost::ptr_vector< measurement< Matrix, TwoU1 > > measurements_type
table_ptr operators_table() const
tag_type get_operator_tag(std::string const &name, size_t type) const
tag_type filling_matrix_tag(size_t type) const
Matrix::value_type value_type
measurements_type measurements() const
bool is_set(std::string const &key) const
definition of Model base class
base::term_descriptor term_descriptor
size_type insert_block(Matrix const &, charge, charge)
boost::shared_ptr< table_type > table_ptr
table_type::tag_type tag_type
TwoU1::charge total_quantum_numbers(BaseParameters &parms) const
std::vector< term_descriptor > terms_type
Index< TwoU1 > const & phys_dim(size_t type) const
virtual op_t const & identity_matrix(size_t type) const
model_impl< Matrix, TwoU1 > base
tag_type identity_matrix_tag(size_t type) const
T get_prop(std::string property, pos_t site) const
::term_descriptor< typename Matrix::value_type > term_descriptor
FermiHubbardTwoU1(const Lattice &lat_, BaseParameters &parms_)
base::table_type table_type
void update(BaseParameters const &p)
std::vector< pos_t > forward(pos_t site) const
base::table_ptr table_ptr
base::terms_type terms_type
void gemm(block_matrix< Matrix1, SymmGroup > const &A, block_matrix< Matrix2, SymmGroup > const &B, block_matrix< Matrix3, SymmGroup > &C)
base::measurements_type measurements_type
virtual op_t const & filling_matrix(size_t type) const
#define REGISTER(op, kind)