-
Notifications
You must be signed in to change notification settings - Fork 25
Fix expectation values for PEPS/PEPO with dual physical spaces #283
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
Your PR no longer requires formatting changes. Thank you for your contribution! |
|
I vaguely remember this being related to the anti-periodic boundary condition in the imaginary time for fermions in the case of tr(exp(-βH)). But for other cases I'm still confused... |
|
Looking at this, I'm actually completely unsure why we had a supertrace and why that was working in the first place. I would have to go through and see what we used to do, but I definitely think that when I implemented this I just tried some stuff until it worked. I think the main point though is that the density matrix we are supplying to these functions actually contains precisely the minus sign that is canceled by the The main problem is that we at some point got a little "lazy" and just played around with the twists until things worked, but unfortunately these twists can move around a network ( In general though, there is the additional question of what we mean with a dual physical space as well. One way we could define this is to start from a regular space and then |
This is also kind of bothering me, which originated from our choice to purify a mixed state with dual ancilla spaces. (On the other hand, in So strictly speaking, the resulting "purified state" is an operator. We discussed this earlier, but I still don't quite get it... It appears that when calculating expectation values of 2-layer PEPO, we should use |
|
I constructed a minimal example that may help understand what happened, but I can't precisely pin it down. Consider a very simple state on 2 sites. using Random, TensorKit, PEPSKit, LinearAlgebra
Random.seed!(2872346)
V1 = Vect[FermionParity](0 => 2, 1 => 2)
V2 = V1
V = V1 ⊗ V2
ψ = randn(ComplexF64, V)Suppose we want to measure the value of an operator A1 acting on site1. The straightforward way to do it is: A2 = TensorKit.id(V2);
nume = @plansor conj(ψ[b1 b2]) * (A1 ⊗ A2)[b1 b2; k1 k2] * ψ[k1 k2]
deno = @plansor conj(ψ[1 2]) * ψ[1 2]
val = nume / deno
display([nume, deno, val])
#= output
3-element Vector{ComplexF64}:
5.471371195603439 + 4.618427854927436im
6.927824745720233 + 0.0im
0.7897675527925934 + 0.666649060050276im
=#Here we use Alternatively, we first construct the reduced density matrix on site 1: ρ12 = ψ * ψ'
@plansor ρ1[k1; b1] := ρ12[k1 2; b1 2];
# equivalent construction
@plansor ρ1′[-1; -2] := conj(ψ[-2 b2]) * A2[b2; k2] * ψ[-1 k2]
@assert ρ1 ≈ ρ1′Its eigenvalues are all positive as expected, and gives the correct expectation value of A1 using D, U = eigh(ρ1)
@assert minimum(D.data) > 0
@assert nume ≈ tr(A1 * ρ1)
@assert deno ≈ tr(ρ1)What happened in PEPSKit might be something like the following: since contraction with the CTMRGEnv is done with @tensor ρ1_[-1; -2] := conj(ψ[-2 b2]) * A2[b2; k2] * ψ[-1 k2] # wrongHowever, this introduced an unwanted twist that happens to be cancelled by |
This PR wants to fix expectation values for PEPS/PEPO with dual physical spaces (relevant for fermionic networks). An additional test is included to ensure that the expectation value of identity operators is 1.
A side product is I generalized
physicalspace(peps, r, c)etc to arbitrary integer values ofr, c.(Right now I only added the test, and haven't fix the twists yet. I want to finish this before #274 to make sure that I made the correct twists for the physical legs.)