How to create a ring in MAGMA with relations?

1.3k Views Asked by At

I'm using MAGMA221 and would like to create a ring over $GF(2)$ with respect to a list of relations. Here's what I have so far:

$\mathtt{Z:=GF(2);} \\\mathtt{P<x,y,z>:=PolynomialRing(Z,3);}$

But what I'd like is the structure to be such that, for example, $x^2 + y = 0$ and $yz + 1 = 0$ so that when I do calculations, whenever MAGMA "sees" $x^2 + y$ it just replaces it with $0$. Is there a way to do this?

Thanks for the help and apologies in advance if any of my formatting or asking etiquette is wrong; this is my first time asking on here.

1

There are 1 best solutions below

2
On BEST ANSWER

You can use the quo-function, like this:

Q<x0,y0,z0> := quo<P | x^2+y, y*z+1>;

This gives you a new ring $Q$, which is isomorphic to $P$ modulo the ideal generated by $x^2+y$ and $yz+1$.

This is documented in the subsection "Affine Algebras" of the section "Commutative Algebra" in the MAGMA handbook.

Changing the normal form: I think (but have not verified) that MAGMA always prints the element in normal form with respect to a Gröbner basis of the given ideal of relation. By changing the monomial order used to compute this basis, using ChangeOrder, you can change the normal form. This may allow you to specify a presentation of the elements that is preferable to you. (From your comment I infer that you may want to minimize total degree.) Witness the following Magma session:

> P<x,y,z>:=PolynomialRing(Z,3);
> P;
Polynomial ring of rank 3 over GF(2)
Order: Lexicographical
Variables: x, y, z
> Q<x0,y0,z0> := quo< P | x^2-y^3>;
> Q;                               
Affine Algebra of rank 3 over GF(2)
Lexicographical Order
Variables: x0, y0, z0
Quotient relations:
[
    x0^2 + y0^3
]
> x0^2;
y0^3
> y0^3;
y0^3

Here lexicographical order with $x>y$ is used, so the $x$-term is reduced to a $y$-term, even though the latter has larger degree.

Now we use a different order, specifying that monomials are first ordered by total degree, then by lexicographical order, so that $x^2 < y^3$.

> P:=ChangeOrder(P,"glex");        
> P;
Ideal of Polynomial ring of rank 3 over GF(2)
Order: Graded Lexicographical
Variables: x, y, z
Homogeneous
Basis:
[
    1
]

> Q<x0,y0,z0> := quo< P | x^2-y^3>;
> Q;
Ideal of Affine Algebra of rank 3 over GF(2)
Graded Lexicographical Order
Variables: x0, y0, z0
Quotient relations:
[
    y0^3 + x0^2
]
Generating basis:
[
    1
]
> x0^2;
x^2
> y0^3;
x^2

See the section on Gröbner bases in the MAGMA handbook for more details and a list of possible orders.