I am using the code for generating the gates for qu8it
The resultant gate is not unitary (and so not hermitian too). I am a bit confused with the result. Is it possible for a quantum gate to be non-unitary? When I take the just real or just imaginary part of the matrix, then it is unitary. Is the code have some missing part or am I missing some fact about qudits?
This is the code thanks to @unknown :
TestA:=function(p)local Ig,Zg,Xg,Hg,Pg,grp,cen,sgrp,scen,C;
Ig:=IdentityMat(p);
Zg:=DiagonalMat(List([0..p-1],x->E(p)^x));
Xg:=IdentityMat(p){\mod([0..p-1]+1,p)+1};
Hg:=List([0..p-1],x->List([0..p-1],y->E(p)^(x*y)))/ER(p);
Pg:=DiagonalMat(List([0..p-1],x->E(2*p)^(x*(x-\mod(p,2)))));
grp:=Group([Hg,Pg,Zg]);cen:=Center(grp);sgrp:=Size(grp);scen:=Size(cen);
Print(" |G| = ",String(sgrp,-5));Print(" |Cen(G)| = ",String(scen,-5));Print(" |G/Cen(G)| = ",String(sgrp/scen,-5));Print("\n");
if(p=8)then
Print("Z=\n");PrintArray(Zg);
Print("X=\n");PrintArray(Xg);
Print("H=\n");PrintArray(Hg);
Print("P=\n");PrintArray(Pg);
C:=KroneckerProduct([[1,0],[0,1]],[[1,1],[1,-1]]/ER(2));C:=C{[1,3,2,4]}{[1,3,2,4]};
Zg:=C^-1*Zg*C;
Xg:=C^-1*Xg*C;
Hg:=C^-1*Hg*C;
Pg:=C^-1*Pg*C;
grp:=Group([Hg,Pg,Zg]);
Print(" all elements are monomial? ",ForAll(Elements(grp),IsMonomialMatrix),"\n");
fi;
return grp;end;
g2:=TestA(2);;
g4:=TestA(4);;
g8:=TestA(8);;
This is the qu8it Hadamard:
a=1j
b=0.707+0.707j
qudit_8_H = Qobj([ [ 1/4*b-1/4*b**3, 1/4*b-1/4*b**3, 1/4*b-1/4*b**3, 1/4*b-1/4*b**3, 1/4*b-1/4*b**3, 1/4*b-1/4*b**3, 1/4*b-1/4*b**3, 1/4*b-1/4*b**3 ],
[ 1/4*b-1/4*b**3, 1/4+1/4*a, 1/4*b+1/4*b**3, -1/4+1/4*a, -1/4*b+1/4*b**3, -1/4-1/4*a, -1/4*b-1/4*b**3, 1/4-1/4*a ],
[ 1/4*b-1/4*b**3, 1/4*b+1/4*b**3, -1/4*b+1/4*b**3, -1/4*b-1/4*b**3, 1/4*b-1/4*b**3, 1/4*b+1/4*b**3, -1/4*b+1/4*b**3, -1/4*b-1/4*b**3 ],
[ 1/4*b-1/4*b**3, -1/4+1/4*a, -1/4*b-1/4*b**3, 1/4+1/4*a, -1/4*b+1/4*b**3, 1/4-1/4*a, 1/4*b+1/4*b**3, -1/4-1/4*a ],
[ 1/4*b-1/4*b**3, -1/4*b+1/4*b**3, 1/4*b-1/4*b**3, -1/4*b+1/4*b**3, 1/4*b-1/4*b**3, -1/4*b+1/4*b**3, 1/4*b-1/4*b**3, -1/4*b+1/4*b**3 ],
[ 1/4*b-1/4*b**3, -1/4-1/4*a, 1/4*b+1/4*b**3, 1/4-1/4*a, -1/4*b+1/4*b**3, 1/4+1/4*a, -1/4*b-1/4*b**3, -1/4+1/4*a ],
[ 1/4*b-1/4*b**3, -1/4*b-1/4*b**3, -1/4*b+1/4*b**3, 1/4*b+1/4*b**3, 1/4*b-1/4*b**3, -1/4*b-1/4*b**3, -1/4*b+1/4*b**3, 1/4*b+1/4*b**3 ],
[ 1/4*b-1/4*b**3, 1/4-1/4*a, -1/4*b-1/4*b**3, -1/4-1/4*a, -1/4*b+1/4*b**3, -1/4+1/4*a, 1/4*b+1/4*b**3, 1/4+1/4*a ] ]
)