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,
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);
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);
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);
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);
91 doubly_occ_op.insert_block(Matrix(1, 1, 1), D, D);
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);
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);
Matrix::value_type value_type
size_type insert_block(Matrix const &, charge, charge)
T get_prop(std::string property, pos_t site) const
std::vector< pos_t > forward(pos_t site) const
void gemm(block_matrix< Matrix1, SymmGroup > const &A, block_matrix< Matrix2, SymmGroup > const &B, block_matrix< Matrix3, SymmGroup > &C)
#define REGISTER(op, kind)