I am attempting to create a trial wavefunction that is a superposition of two wavefunctions.
My code does roughly the following:
Hubbard sites;
auto sites1,sites2 = sites; // N is even
sites = Hubbard(N);
sites1 = sites;
sites2 = sites;
IQMPS psi1, psi2;
auto state1 = InitState(sites1);
auto state2 = InitState(sites2);
loop over sites;
for odd sites, state1.set(i, "UpDn")
for even sites, state2.set(i, "UpDn")
other sites are empty
psi1 = IQMPS(state1);
psi2 = IQMPS(state2);
psi = sum(psi1,psi2); // I also tried out sum(psi1, psi1) as a check
psi.norm();
The electron densities that result for psi are
8 8 8 8 8 8
whereas I was expecting
1 1 1 1 1 1
Notes:
The above code works fine for a single wavefunction. That is, if I just set psi = psi1 or psi = psi2, just the odd or just the even sites are filled, the electron density is
2 0 2 0 2 0
or
0 2 0 2 0 2
When I set psi = sum(psi1, psi1) the electron density is
8 0 8 0 8 0
The only portion of the code that isn't working, from what I can tell, is the sum( , ) function. Is there a bug in sum() that is not conserving quantum numbers? Is there another function that I can use to conserve quantum numbers while adding wavefunctions?