From 06ddb91ee9b5462572d1eac4753aa5c0301fc2f1 Mon Sep 17 00:00:00 2001 From: Markus Hauru Date: Wed, 9 Sep 2020 13:35:15 +0200 Subject: [PATCH] Change normalization in reality check --- src/genericmera.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/genericmera.jl b/src/genericmera.jl index cfc998f..c6c94d6 100644 --- a/src/genericmera.jl +++ b/src/genericmera.jl @@ -734,7 +734,7 @@ function expect(op, m::GenericMERA, pars = (;), opscale = 1, evalscale = 1) rho = densitymatrix(m, evalscale, pars) op = ascended_operator(op, m, evalscale) value = dot(rho, op) - if abs(imag(value)/norm(op)) > 1e-13 + if abs(imag(value)/(norm(op)*norm(rho))) > 1e-13 @warn("Non-real expectation value: $value") end return real(value)