Hi!,
I am trying to measure the parity of a fermion state, however first of all I have the following problem:
If I start with (for example) with:
N = 100 #number of sites
Npart=N+1 #number of particles
sites = siteinds("Electron", N;
conserve_qns = false,
conserve_sz = false,
conserve_nf = false,
conserve_nfparity = true,
qnname_sz = "Sz",
qnname_nf = "Nf",
qnname_nfparity = "NfParity")
state = ["Emp" for n in 1:N]
p = Npart
for i in N:-1:1
if p > i
state[i] = "UpDn"
p -= 2
elseif p > 0
state[i] = (isodd(i) ? "Up" : "Dn")
p -= 1
end
end
psi0 = productMPS(sites,state)
and measure the number of particles of psi0
, the result is Npart = 101
But when i do a DMRG calculation,
energy, psi = dmrg(H, psi0, sweeps; observer=obs, outputlevel=outputlevel)
and measure the number of particles,
Number_p = sum(expect(psi,"Ntot"))
the result is Number_p = 100.00000000506148
.
As the Hamiltonian does not conserve the number of particles I would not expect to find Number_p =101
, but yes an odd number of particles because I’m imposing the conservation of the parity.
I’m not sure if my problem is conceptual or computational,
From already thank you very much!