Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Finding Inverse of a Polynomial in a Galois Ring $GR(2^k,d)$

I'm trying to find the inverse of the polynomial ( 7X^2 + 1 ) in the Galois ring ( GR(2^3, 3) ) where the modulus polynomial is ( h(X) = X^3 + X + 1 ). However, I keep encountering the error "Flint exception (Impossible inverse): Cannot invert modulo (2 4)."

Here is the SageMath code I'm using:

k = 3

d = 3

R = IntegerModRing(2**k)

GR = PolynomialRing(R, 'X') X = GR.gen()

h = X^3 + X + 1

GaloisRing = GR.quotient(h, 'X')

poly = GaloisRing(7*X^2 + 1)

poly_elem = poly.lift() poly_modulus = h

g, u, v = xgcd(poly_elem, poly_modulus)

if g != 1: raise ValueError(f"The element {elem} does not have an inverse in the Galois ring.") inverse = GaloisRing(u % poly_modulus)

Then I get an error:

```

Flint exception (Impossible inverse):Cannot invert modulo 2*4

(no backtrace available)

Unhandled SIGABRT: An abort() occurred. This probably occurred because a compiled module has a bug in it and is not properly wrapped with sig_on(), sig_off(). Python will now terminate. ```

Questions: 1. Why am I encountering this error when trying to find the inverse of ( 7X^2 + 1 ) in ( \text{GR}(2^3, 3) )? 2. Is there a mistake in how I'm defining the Galois ring or using the extended Euclidean algorithm? 3. How can I correctly find the inverse of \7X^2 + 1 ) in this Galois ring?

Finding Inverse of a Polynomial in a Galois Ring $GR(2^k,d)$

I'm trying to find the inverse of the polynomial ( 7X^2 + 1 ) in the Galois ring ( GR(2^3, 3) ) where the modulus polynomial is ( h(X) = X^3 + X + 1 ). However, I keep encountering the error "Flint exception (Impossible inverse): Cannot invert modulo (2 4)."

Here is the SageMath code I'm using:

k = 3

3 d = 3

3 R = IntegerModRing(2**k)

IntegerModRing(2**k) GR = PolynomialRing(R, 'X') X = GR.gen()

GR.gen() h = X^3 + X + 1

1 GaloisRing = GR.quotient(h, 'X')

'X') poly = GaloisRing(7*X^2 + 1)

1) poly_elem = poly.lift() poly_modulus = h

h g, u, v = xgcd(poly_elem, poly_modulus)

poly_modulus) if g != 1: raise ValueError(f"The element {elem} does not have an inverse in the Galois ring.") inverse = GaloisRing(u % poly_modulus)

poly_modulus)

Then I get an error:

```

Flint exception (Impossible inverse):Cannot invert modulo 2*4

2*4 ------------------------------------------------------------------------ (no backtrace available)

available) ------------------------------------------------------------------------ Unhandled SIGABRT: An abort() occurred. This probably occurred because a compiled *compiled* module has a bug in it and is not properly wrapped with sig_on(), sig_off(). Python will now terminate. ```

Questions: 1. Why am I encountering this error when trying to find the inverse of ( 7X^2 + 1 ) in ( \text{GR}(2^3, 3) )? 2. Is there a mistake in how I'm defining the Galois ring or using the extended Euclidean algorithm? 3. How can I correctly find the inverse of \7X^2 + 1 ) in this Galois ring?

click to hide/show revision 3
retagged

Finding Inverse of a Polynomial in a Galois Ring $GR(2^k,d)$

I'm trying to find the inverse of the polynomial ( 7X^2 + 1 ) in the Galois ring ( GR(2^3, 3) ) where the modulus polynomial is ( h(X) = X^3 + X + 1 ). However, I keep encountering the error "Flint exception (Impossible inverse): Cannot invert modulo (2 4)."

Here is the SageMath code I'm using:

k = 3

d = 3

R = IntegerModRing(2**k)

GR = PolynomialRing(R, 'X')
X = GR.gen()

h = X^3 + X + 1

GaloisRing = GR.quotient(h, 'X')

poly = GaloisRing(7*X^2 + 1)

poly_elem = poly.lift()
poly_modulus = h

g, u, v = xgcd(poly_elem, poly_modulus)

if g != 1: raise ValueError(f"The element {elem} does not have an inverse in the Galois ring.")
inverse = GaloisRing(u % poly_modulus)

Then I get an error:

Flint exception (Impossible inverse):Cannot invert modulo 2*4
------------------------------------------------------------------------
(no backtrace available)
------------------------------------------------------------------------
Unhandled SIGABRT: An abort() occurred.
This probably occurred because a *compiled* module has a bug
in it and is not properly wrapped with sig_on(), sig_off().
Python will now terminate.

Questions: 1. Why am I encountering this error when trying to find the inverse of ( 7X^2 + 1 ) in ( \text{GR}(2^3, 3) )? 2. Is there a mistake in how I'm defining the Galois ring or using the extended Euclidean algorithm? 3. How can I correctly find the inverse of \7X^2 + 1 ) in this Galois ring?