Hi guys,
I have a problem of syntax after I moved from Itensor 1 to Itensor 2. I had a piece of code which allows to create a set of sites, some of them spins the others bosons. I cannot construct anymore the bosons sites with a vector of 'IndexQN'. I have the feeling this is related to the new storage type of the library, but I am not sure :)
Thanks for your help!
inline void SpinBoson::
constructSites()
{
std::vector<IndexQN> I;
for(int j = 1; j <= N_; ++j)
{
if (std::binary_search(Is_.begin(),Is_.end(),j))
{
site_.at(j) = IQIndex(nameint("S=1/2 site=",j),
Index(nameint("Up for site",j),1,Site),QN(+1,0),
Index(nameint("Dn for site",j),1,Site),QN(-1,0));
}
else
{
for (int r = 0;r<d_;r++)
{
std::string str = format("%d for site %d",r,j);
I.push_back(IndexQN(Index(str,1,Site),QN(0,r)));
}
site_.at(j) = IQIndex(nameint("boson site=",j),I);
}
}
}
Note, the error is
no matching constructor for initialization of
'itensor::IQIndex'
site_.at(j) = IQIndex(nameint("boson site=",j),I);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~
itensor2/itensor/iqindex.h:55:5: note: candidate constructor not viable: no known conversion from
'std::vector<IndexQN>' to 'storage &&' (aka 'vector<itensor::IndexQN> &&') for 2nd argument