I have tried using the HubbardChain Hamiltonian in a simple test code based on the exthubbard.cc sample. It compiles fine but when running I get the error:
The code is included at the bottom. Changing "HubbardChain" to "ExtendedHubbard" makes everything run fine. As I am just learning to use ITensor I admit that it may well be a user error.
Hubbard model(N);
//
// Create the Hamiltonian matrix product operator.
// Here we use the IQMPO class which is an MPO of
// IQTensors, tensors whose indices are sorted
// with respect to quantum numbers
//
IQMPO H = HubbardChain(model);
//
// Set the initial wavefunction matrix product state
// to be a Neel state.
//
InitState initState(model);
int p = Npart;
for(int i = N; i >= 1; --i)
{
if(p > i)
{
cout << "Doubly occupying site " << i << endl;
initState.set(i,&Hubbard::UpDn);
p -= 2;
}
else
if(p > 0)
{
cout << "Singly occupying site " << i << endl;
initState.set(i,(i%2==1 ? &Hubbard::Up : &Hubbard::Dn));
p -= 1;
}
else
{
initState.set(i,&Hubbard::Emp);
}
}
IQMPS psi(model,initState);
cout << totalQN(psi) << endl;
//
// Set the parameters controlling the accuracy of the DMRG
// calculation for each DMRG sweep.
// Here less than 5 cutoff values are provided, for example,
// so all remaining sweeps will use the last one given (= 1E-10).
//
Sweeps sweeps(5);
sweeps.maxm() = 10,20,100,100,200;
sweeps.cutoff() = 1E-10;
sweeps.niter() = 2;
sweeps.noise() = 1E-7,1E-8,0.0;
cout << sweeps;
Real En = dmrg(psi,H,sweeps,Quiet());
//
// Print the final energy reported by DMRG
//
cout << format("\nGround State Energy = %.10f\n")%En;
cout << format("\nUsing psiHphi = %.10f\n") % psiHphi(psi,H,psi);
cout << "\nTotal QN of Ground State = " << totalQN(psi) << "\n";
return 0;
}