28 #ifndef MEASUREMENTS_AVERAGE_H
29 #define MEASUREMENTS_AVERAGE_H
36 namespace measurements {
38 template <
class Matrix,
class SymmGroup>
42 typedef std::vector<block_matrix<Matrix, SymmGroup> > op_vec;
43 typedef std::vector<std::pair<op_vec, bool> > bond_element;
49 op_vec
const & identities, op_vec
const & fillings,
53 generator mpom(lattice, identities, fillings);
55 for (std::size_t p = 0; p < lattice.
size(); ++p)
58 term.
operators.push_back( std::make_pair(p, ops[lattice.
get_prop<
int>(
"type", p)]) );
69 op_vec
const & identities, op_vec
const & fillings,
70 std::vector<bond_element>
const& ops)
73 generator mpom(lattice, identities, fillings);
75 for (std::size_t i = 0; i < ops.size(); ++i) {
76 for (std::size_t p = 0; p < lattice.
size(); ++p) {
78 term.
operators.push_back( std::make_pair(p, ops[i][0].first[lattice.
get_prop<
int>(
"type", p)]) );
80 std::vector<Lattice::pos_t> neighs = lattice.
forward(p);
81 for (
typename std::vector<Lattice::pos_t>::const_iterator hopto = neighs.begin();
82 hopto != neighs.end(); ++hopto)
85 term2.
operators.push_back( std::make_pair(*hopto, ops[i][1].first[lattice.
get_prop<
int>(
"type", p)]) );
104 #ifdef __INTEL_COMPILER
106 this->
result =
static_cast<overlap_func
>(&
overlap)(super_mpo, mps) / nn;
include all MPO generator
double expval(MPS< Matrix, SymmGroup > const &mps, MPO< Matrix, SymmGroup > const &mpo, int d)
average(std::string const &name_, const Lattice &lattice, op_vec const &identities, op_vec const &fillings, std::vector< bond_element > const &ops)
Bond term.
bool all_true(InputIterator first, InputIterator last, Predicate pred)
measurement< Matrix, SymmGroup > * do_clone() const
definition of Measurement base class
average(std::string const &name_, const Lattice &lattice, op_vec const &identities, op_vec const &fillings, op_vec const &ops)
Site term.
bool is_hermitian_meas(std::vector< block_matrix< Matrix, SymmGroup > > const &ops)
UTILITIES.
MPS< Matrix, SymmGroup >::scalar_type overlap(MPS< Matrix, SymmGroup > const &mps1, MPS< Matrix, SymmGroup > const &mps2)
T get_prop(std::string property, pos_t site) const
void evaluate(MPS< Matrix, SymmGroup > const &mps, boost::optional< reduced_mps< Matrix, SymmGroup > const & > rmps=boost::none)
MPSTensor< Matrix, SymmGroup >::scalar_type scalar_type
std::vector< op_pair_t > operators
MPS< Matrix, SymmGroup > mpo_to_smps(MPO< Matrix, SymmGroup > const &mpo, Index< SymmGroup > const &phys_i)
functions to operate on MPS and MPO (compute expectation values, etc.)
void add_term(Operator_Term< Matrix, SymmGroup > const &term)
std::vector< pos_t > forward(pos_t site) const
MPO< Matrix, SymmGroup > create_mpo()
Index< SymmGroup > phys_psi
MPS< Matrix, SymmGroup >::scalar_type dm_trace(MPS< Matrix, SymmGroup > const &mps, Index< SymmGroup > const &phys_psi)