SyTen

◆ calc_expval()

template<typename Lattice , typename State >
std::string syten::calc_expval ( Lattice const &  lat,
State &&  a,
State &&  b,
SDef const &  norm,
std::string const &  op_expr,
int const  variance,
bool const  column,
bool const  realOnly,
bool const  imagOnly,
Index const  prec 
)

Calculates an expectation value and possibly a variance for given states, lattices and operators.

Returns a string expression for the result without newline termination.

Template Parameters
LatticeLattice type
StateState type
Parameters
latlattice on which the operator is defined
afirst state (complex-conjugated)
bsecond state (not complex-conjugated)
normOverlap of a and b or norm of a, result will be divided by this
op_exproperator expression, parsed with respect to lat
variance0: no variance calculation, 1: extended output (expectation value and variance), 2: only variance
columnif true, prints real and imaginary part separated by some whitespace (overwrites realOnly and columnOnly)
realOnlyif true, only prints real part
imagOnlyif true, only prints imaginary part
precoutput precision
Returns
a string with the result, suitable for directly printing to std::cout or in a file, without trailing newline.

References abs(), syten::IPEPS::expectation(), norm(), syten::MPS::parse(), print_result(), and syten::MPS::variance().

Referenced by do_expval().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: