Hi,
I ran into some minor trouble trying to test-run some of the code examples from the Tensor homepage for my system.
- I have my custom hamiltonian MPO and I wanted to compute the excited state. Actually, for this test case, there are a number of degenerate groundstates, so the code should find another one with the same energy. It does, but when I compute overlap with the first gs, it's not at all orthogonal.
Here is how I've done it:
auto psi = MPS(initState);
Real energy = dmrg(psi,H,sweeps);
auto wfs=std::vector(1);
wfs.at(0) = psi;
auto psi1 = MPS(sites);
auto energy1 = dmrg(psi1,H,wfs,sweeps,{"Weight=",1000.0})
psi.position(N/2);
psi1.position(N/2);
auto overlap1 = (dag(psi.A(N/2))*psi1.A(N/2)).toComplex();
So I get correct (small system, I checked by exact diagonalisation ) gs. energy and also the excited one being equal to gs, as it should be, but the overlaps are complex numbers of roughly this magnitude (-0.216118,-0.107735). Which does not seem very orthogonal, given that H has couplings of order 1 and the weight used to penalize overlap with the first ground state is three orders of magnitude larger.
Do you perhaps have an idea what's going on?
- A minor question: one of the examples on the site was computing MPS overlap simply by calling "overlap(psi,psi1)"
Is this implemented? When I tried I get:
iq2chainsimple2.cc:155:18: error: use of undeclared identifier 'overlap'; did you mean 'overlaps'?
auto overlap2 = overlap(psi,psi1);
^~~~~~~
overlaps
/Users/matthew/Programming/itensor/itensor/matrix/matrixref.h:675:1: note: 'overlaps' declared here
overlaps(const VectorRef & A, const VectorRef & B)
^
iq2chainsimple2.cc:155:26: error: no viable conversion from 'itensor::MPSt' to 'const itensor::VectorRef'
auto overlap2 = overlap(psi,psi1);
^~~
/Users/matthew/Programming/itensor/itensor/matrix/matrixref.h:528:19: note: candidate constructor not viable: no known conversion from
'itensor::MPSt' to 'const itensor::VectorRef &' for 1st argument
inline VectorRef::VectorRef(const VectorRef & V)
^
/Users/matthew/Programming/itensor/itensor/matrix/matrixref.h:675:28: note: passing argument to parameter 'A' here
overlaps(const VectorRef & A, const VectorRef & B)