Hello,
I want to define a new siteset with two "colors" (A and B) of spin 1/2. We can assume that in a chain lattice odd sites=A and that even sites=B. In my system, @@S^z_\mathrm{tot}@@ of A and B spin is conserved separately. This also means that @@S^z_\mathrm{tot}(A+B)=S^z_\mathrm{tot}(A)+S^z_\mathrm{tot}(B)@@ is conserved.
Using the standard "SpinHalf" siteset would only lead to @@S^z_\mathrm{tot}(A+B)@@ conservation. So I've implemented a new one with two QNs where the only difference with the standard one is
SpinHalfABSite(int n, Args const& args = Args::global())
{
if(n%2 == 1)
s = IQIndex{nameint("S=1/2 (A) ",n),
Index(nameint("Up ",n),1,Site),QN(+1, 0),
Index(nameint("Dn ",n),1,Site),QN(-1, 0)};
else
s = IQIndex{nameint("S=1/2 (B) ",n),
Index(nameint("Up ",n),1,Site),QN(0, +1),
Index(nameint("Dn ",n),1,Site),QN(0, -1)};
}
I think that at this point, it is correct. The problem is when I want to build an IQMPO through the AutoMPO builder for my specific Hamiltonian,
auto ampo = AutoMPO(sites);
for(int i = 1; i < sites.N(); i += 2)
{
for(int j = 1; j < sites.N(); j += 2)
{
if(i < j)
{
ampo += 1.0,"S+",i,"S-",i+1,"S-",j,"S+",j+1;
ampo += 1.0,"S-",i,"S+",i+1,"S+",j,"S-",j+1;
}
}
}
auto ham = IQMPO(ampo);
where @@S^\alpha_{i,j}@@ acts on the A spins and @@S^\alpha_{i+1,j+1}@@ on the B ones. However, this leads to the following error,
I = IQIndex(Hl4,2,Link,901) <Out>
(hl4_0,2,Link,628) QN()
qn = QN(-4,4)
From line 514, file iqindex.cc
IQIndex does not contain given QN block.
IQIndex does not contain given QN block.
Abort trap: 6
I do not get this error when working with only one color of spin (and the same Hamiltonian). The error happens inside the 'compressMPO' function, when making the compressed MPO for the fourth site (no matter the system size, it always happens at the fourth one).
I'm trying to figure out a bit more this part of the ITensor code but if you have any idea of what could be wrong!