From e78667a63ec7491d243fdf81cacaf4fffec76913 Mon Sep 17 00:00:00 2001 From: leburgel Date: Mon, 24 Jun 2024 15:35:50 +0200 Subject: [PATCH] Add sum over onsite expectation values --- src/operators/localoperator.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/operators/localoperator.jl b/src/operators/localoperator.jl index 4cab8416..e2356f00 100644 --- a/src/operators/localoperator.jl +++ b/src/operators/localoperator.jl @@ -198,7 +198,7 @@ Compute the expectation value of an on-site and an anisotropic nearest-neighbor This is used to evaluate and differentiate the energy in ground-state PEPS optimizations. """ function costfun(peps::InfinitePEPS, env, op::AnisotropicNNOperator) - oos = expectation_value(peps, env, op.h0)[1] + oos = sum(expectation_value(peps, env, op.h0)) oh = sum(expectation_value(peps, env, op.hx)) ov = sum(expectation_value(rotr90(peps), rotate_north(env, WEST), op.hy)) #ov = sum(expectation_value(rotl90(peps), rotl90(env), op.hy))