How to pick a random polynomial in a polynomial ring which is invertible in MAGMA?

136 Views Asked by At

I've just begun to use Magma and i was testing some features in Magma. I would like to know if it is possible to make a loop which provides me an invertible polynomial (in a polynomial ring).

Can someone help me ?

Thx.

A french dude (sorry for my quiet bad english :/ )

I defined a polynomial ring F2[x]/x^r -1 . I succeed to pick a random pol in it. If it's already invertible, i can compute P⁻1. Then, if P is not invertible, i tried to make a while loop to pick another pol but it didn't works.

1

There are 1 best solutions below

0
On

The following script does what you want: It picks a random element until it finds an invertible polynomial with r = 7:

R<x> := PolynomialRing(GaloisField(2));
QR := quo<R | x^7 - 1>;

f := Random(QR);
while not IsInvertible(f) do
    f := Random(QR);
end while;
f;
IsInvertible(f);

I tried to find a prettier way of picking a random element out of the group, by trying to compute the multiplicative group of QR and picking a random element from that. Maybe this is also possible, but I couldn't find it. You could also refer to https://math.stackexchange.com/ since MAGMA questions are generally accepted there.