# Z_4 symmetry

edited

Hello,

I am trying to implement a $Z4$ symmetry in the electron site, similar to the $Z3$ symmetry in the Z3 site. I created a new site in which I have a $Z_4$ QN, and all operators are equal to the electron site.

Z4pSite(Args const& args = Args::global())
{
auto ts = TagSet("Site,Z4p");
if( args.defined("SiteNumber") )
if(args.getBool("ConserveQNs",true))
{
s = Index(QN({0,4}),1,
QN({1,4}),1,
QN({2,4}),1,
QN({3,4}),1,Out,ts);
}
else
{
s = Index(4,ts);
}
}


When I use this Z4 site, I can measure the totalQN of an MPS that I define

auto sites = Z4p(N,{"ConserveQNs",true});
auto state = InitState(sites);
for(int i = N; i >= 1; --i)
{
state.set(i,"Emp");
}
state.set(1,"Up");
state.set(2,"UpDn");
auto psi = MPS(state);
Print(totalQN(psi));


and it gives me the expected QN. However when I try to make an Hamiltonian that conserves $Z_4$ QN , I aways get the error "From line 173, file itdata/qdense.cc
Setting Tensor element non-zero would violate its symmetry.
Setting Tensor element non-zero would violate its symmetry.
Aborted (core dumped)", no matter how simple the Hamiltonian is, even if it is just a nearest neighbour hopping:

#include "itensor/all.h"
using namespace itensor;
int main()
{
int N = 16;
auto J1=1;
auto sites = Z4p(N,{"ConserveQNs",true});
auto ampo = AutoMPO(sites);
for(int b = 1; b < N; ++b)
{
ampo += -J1,"Cdagup",b,"Cup",b+1;
ampo += -J1,"Cdagup",b+1,"Cup",b;
ampo += -J1,"Cdagdn",b,"Cdn",b+1;
ampo += -J1,"Cdagdn",b+1,"Cdn",b;
}
auto H = toMPO(ampo);
return 0;
}


I'm wondering that could be the problem, as I tried to implement the $Z_3$ symmetry in the tJ siteset and it worked without any problems.

Regards,
Raphael L R C Teixeira

commented by (70.1k points)
Hi, could you please post how you defined the Cdagup, Cup, etc operators in detail? It may well be that the Hamiltonian you are making out of those operators, the way they are defined, does not conserve the Z4 quantum number.
commented by (70.1k points)
Relatedly, how are you wanting to define those operators ideally? It's a little confusing to me what is meant by "C dagger" and "C" in this context since these degrees of freedom are not electrons. (So what is spin "up" and "down" and what do those mean for these kind of sites?)
commented by (120 points)
Hello Miles,

I was trying to define a QN such that empty state has QN - 0, up  QN - 1, UpDn - QN=2 and Dn - Qn 3, and I defined the same way the electron site with a phase:

ITensor
op(std::string const& opname,
Args const& args) const
{
auto sP = prime(s);

IndexVal Em(s(1)),
EmP(sP(1)),
Up(s(2)),
UpP(sP(2)),
UD(s(3)),
UDP(sP(3)),
Dn(s(4)),
DnP(sP(4));

ITensor Op(dag(s),sP);

if(opname == "Cup")
{
Op.set(Up,EmP,1);
Op.set(UD,DnP,-1);
}
else
if(opname == "Cdagup")
{
Op.set(Em,UpP,1);
Op.set(Dn,UDP,-1);
}
else
if(opname == "Cdn")
{
Op.set(Dn,EmP,1_i);
Op.set(UD,UpP,-1_i);
}
else
if(opname == "Cdagdn")
{
Op.set(Em,DnP,-1_i);
Op.set(Up,UDP,1_i);
}

I was trying to implement the basis from arXiv:1802.06061 (Eq. A4). I also tried without the phase, literally the same from electron site, and it didn`t work.
commented by (70.1k points)
I see, thanks. But from what I can see in that paper, the definition of the fermion operators such as Cdagup are related to the Z4 basis in a rather complicated way, as shown by Equation (2) which relates the d operator to a linear combination of C operators with both spin types (up and down). Is your definition equivalent to that one?
commented by (120 points)
edited
Yes it should be the same. Ok, now I see it. Even though it is a rather complicated way to define  the C operators in terms of this Z4 D operators (A7), if I were to implement this way, it should work, right? I will be trying this. Thank you!
commented by (70.1k points)
Yes, I wanted to point that out more from the physics side to make sure you had thought about those mappings the same way I was reading them.

But I'm puzzled by one thing: the way you defined Cup, Cdagup, etc. in the code looks to me like it might still respect the Z4 symmetry. So in parallel to you I will do a few tests to check whether I'm right about that and see exactly what part is leading to the error message. I'll let you know -