Open mtfishman opened 2 years ago
Generalize expect and correlation_matrix to MPOs.
expect
correlation_matrix
This comes up here: http://itensor.org/support/3350/calculating-observables-from-density-matrices and is needed in PastaQ.
PastaQ
A conceptually simple approach would be something like:
function expect(M::MPO, x::String, n::Int) s = dag.(siteinds(first, M; plev=0)) O = op(x, s, n) return tr(apply([O], M)) end
used like:
expect(M, "Sx", 3) # Compute `tr(Sx_3 * M)`
where of course we would want to handle moving the orthogonality center around efficiently when computing ranges of local expectation values.
Yes, that forum question also made me realize we should have this.
Generalize
expect
andcorrelation_matrix
to MPOs.This comes up here: http://itensor.org/support/3350/calculating-observables-from-density-matrices and is needed in
PastaQ
.A conceptually simple approach would be something like:
used like:
where of course we would want to handle moving the orthogonality center around efficiently when computing ranges of local expectation values.