Let we have a super algebra (ring), $R=R_0 \oplus R_1$. A homogeneous element of $R$ is an element belongs to $R_0$ or $R_1$. This function has three outputs,-1 for non-homogeneous, 0 for homogeneous and even, and 1 for homogeneous and odd elements.
i1 : R1=QQ[x_0..x_4]; |
i2 : R2=QQ[e_0, e_1]; |
i3 : R= superRing(R1, R2) o3 = R o3 : QuotientRing |
i4 : L={e_0, e_1} o4 = {e , e } 0 1 o4 : List |
i5 : f=x_1*x_2*x_3+x_1*e_0+e_1*e_0-4*x_2*e_1*e_0+4 o5 = x x x + x e + 4x e e - e e + 4 1 2 3 1 0 2 0 1 0 1 o5 : R |
i6 : parity(f, R, L) o6 = -1 |
i7 : g=x_1*x_2*x_3+e_0*e_1+4; |
i8 : parity(g, R, L) o8 = 0 |
The object parity is a method function.