J-ideals of matrices

Let B be an n×n-matrix over a principal ideal domain D.

For an ideal J, the J-ideal of B is defined to be NJ(B)={fD[X]f(B)Mn(J)}.

For a prime element p of D and t0, a (pt)-minimal polynomial of B is a monic polynomial fN(pt)(B) of minimal degree.

This module computes these minimal polynomials.

Let p be a prime element of D. Then there is a finite set Sp of positive integers and monic polynomials νps for sSp such that for t1,

N(pt)(B)=μBD[X]+ptD[X]+sSpsb(t)pmax{0,ts}νpsD[X]

holds where b(t)=min{rSprs}. The degree of νps is strictly increasing in sSp and νps is a (ps)-minimal polynomial. If tmaxSp, then the summand μBD[X] can be omitted.

All computations are done by the class ComputeMinimalPolynomials where various intermediate results are cached. It provides the following methods:

EXAMPLES:

sage: from sage.matrix.compute_J_ideal import ComputeMinimalPolynomials
sage: B = matrix(ZZ, [[1, 0, 1], [1, -2, -1], [10, 0, 0]])
sage: C = ComputeMinimalPolynomials(B)
sage: C.prime_candidates()
[2, 3, 5]
sage: for t in range(4):
....:     print(C.null_ideal(2^t))
Principal ideal (1) of
    Univariate Polynomial Ring in x over Integer Ring
Ideal (2, x^2 + x) of
    Univariate Polynomial Ring in x over Integer Ring
Ideal (4, x^2 + 3*x + 2) of
    Univariate Polynomial Ring in x over Integer Ring
Ideal (8, x^3 + x^2 - 12*x - 20, 2*x^2 + 6*x + 4) of
    Univariate Polynomial Ring in x over Integer Ring
sage: C.p_minimal_polynomials(2)
{2: x^2 + 3*x + 2}
sage: C.integer_valued_polynomials_generators()
(x^3 + x^2 - 12*x - 20, [1, 1/4*x^2 + 3/4*x + 1/2])
>>> from sage.all import *
>>> from sage.matrix.compute_J_ideal import ComputeMinimalPolynomials
>>> B = matrix(ZZ, [[Integer(1), Integer(0), Integer(1)], [Integer(1), -Integer(2), -Integer(1)], [Integer(10), Integer(0), Integer(0)]])
>>> C = ComputeMinimalPolynomials(B)
>>> C.prime_candidates()
[2, 3, 5]
>>> for t in range(Integer(4)):
...     print(C.null_ideal(Integer(2)**t))
Principal ideal (1) of
    Univariate Polynomial Ring in x over Integer Ring
Ideal (2, x^2 + x) of
    Univariate Polynomial Ring in x over Integer Ring
Ideal (4, x^2 + 3*x + 2) of
    Univariate Polynomial Ring in x over Integer Ring
Ideal (8, x^3 + x^2 - 12*x - 20, 2*x^2 + 6*x + 4) of
    Univariate Polynomial Ring in x over Integer Ring
>>> C.p_minimal_polynomials(Integer(2))
{2: x^2 + 3*x + 2}
>>> C.integer_valued_polynomials_generators()
(x^3 + x^2 - 12*x - 20, [1, 1/4*x^2 + 3/4*x + 1/2])
from sage.matrix.compute_J_ideal import ComputeMinimalPolynomials
B = matrix(ZZ, [[1, 0, 1], [1, -2, -1], [10, 0, 0]])
C = ComputeMinimalPolynomials(B)
C.prime_candidates()
for t in range(4):
    print(C.null_ideal(2^t))
C.p_minimal_polynomials(2)
C.integer_valued_polynomials_generators()

The last output means that

{fQ[X]f(B)M3(Z)}=(x3+x212x20)Q[X]+Z[X]+14(x2+3x+2)Z[X].

Todo

Test code over PIDs other than ZZ.

This requires implementation of frobenius() over more general domains than ZZ.

Additionally, lifting() requires modification or a bug needs fixing, see AskSage Question 35555.

REFERENCES:

AUTHORS:

  • Clemens Heuberger (2016)

  • Roswitha Rissner (2016)

ACKNOWLEDGEMENT:

  • Clemens Heuberger is supported by the Austrian Science Fund (FWF): P 24644-N26.

  • Roswitha Rissner is supported by the Austrian Science Fund (FWF): P 27816-N26.

Classes and Methods

class sage.matrix.compute_J_ideal.ComputeMinimalPolynomials(B)[source]

Bases: SageObject

Create an object for computing (pt)-minimal polynomials and J-ideals.

For an ideal J and a square matrix B over a principal ideal domain D, the J-ideal of B is defined to be NJ(B)={fD[X]f(B)Mn(J)}.

For a prime element p of D and t0, a (pt)-minimal polynomial of B is a monic polynomial fN(pt)(B) of minimal degree.

The characteristic polynomial of B is denoted by χB; n is the size of B.

INPUT:

  • B – a square matrix over a principal ideal domain D

OUTPUT:

An object which allows to call p_minimal_polynomials(), null_ideal() and integer_valued_polynomials_generators().

EXAMPLES:

sage: from sage.matrix.compute_J_ideal import ComputeMinimalPolynomials
sage: B = matrix(ZZ, [[1, 0, 1], [1, -2, -1], [10, 0, 0]])
sage: C = ComputeMinimalPolynomials(B)
sage: C.prime_candidates()
[2, 3, 5]
sage: for t in range(4):
....:     print(C.null_ideal(2^t))
Principal ideal (1) of
    Univariate Polynomial Ring in x over Integer Ring
Ideal (2, x^2 + x) of
    Univariate Polynomial Ring in x over Integer Ring
Ideal (4, x^2 + 3*x + 2) of
    Univariate Polynomial Ring in x over Integer Ring
Ideal (8, x^3 + x^2 - 12*x - 20, 2*x^2 + 6*x + 4) of
    Univariate Polynomial Ring in x over Integer Ring
sage: C.p_minimal_polynomials(2)
{2: x^2 + 3*x + 2}
sage: C.integer_valued_polynomials_generators()
(x^3 + x^2 - 12*x - 20, [1, 1/4*x^2 + 3/4*x + 1/2])
>>> from sage.all import *
>>> from sage.matrix.compute_J_ideal import ComputeMinimalPolynomials
>>> B = matrix(ZZ, [[Integer(1), Integer(0), Integer(1)], [Integer(1), -Integer(2), -Integer(1)], [Integer(10), Integer(0), Integer(0)]])
>>> C = ComputeMinimalPolynomials(B)
>>> C.prime_candidates()
[2, 3, 5]
>>> for t in range(Integer(4)):
...     print(C.null_ideal(Integer(2)**t))
Principal ideal (1) of
    Univariate Polynomial Ring in x over Integer Ring
Ideal (2, x^2 + x) of
    Univariate Polynomial Ring in x over Integer Ring
Ideal (4, x^2 + 3*x + 2) of
    Univariate Polynomial Ring in x over Integer Ring
Ideal (8, x^3 + x^2 - 12*x - 20, 2*x^2 + 6*x + 4) of
    Univariate Polynomial Ring in x over Integer Ring
>>> C.p_minimal_polynomials(Integer(2))
{2: x^2 + 3*x + 2}
>>> C.integer_valued_polynomials_generators()
(x^3 + x^2 - 12*x - 20, [1, 1/4*x^2 + 3/4*x + 1/2])
from sage.matrix.compute_J_ideal import ComputeMinimalPolynomials
B = matrix(ZZ, [[1, 0, 1], [1, -2, -1], [10, 0, 0]])
C = ComputeMinimalPolynomials(B)
C.prime_candidates()
for t in range(4):
    print(C.null_ideal(2^t))
C.p_minimal_polynomials(2)
C.integer_valued_polynomials_generators()
current_nu(p, t, pt_generators, prev_nu)[source]

Compute (pt)-minimal polynomial of B.

INPUT:

  • p – a prime element of D

  • t – positive integer

  • pt_generators – list (g1,,gs) of polynomials in D[X] such that N(pt)(B)=(g1,,gs)+pN(pt1)(B)

  • prev_nu – a (pt1)-minimal polynomial of B

OUTPUT:

A (pt)-minimal polynomial of B.

EXAMPLES:

sage: from sage.matrix.compute_J_ideal import ComputeMinimalPolynomials
sage: B = matrix(ZZ, [[1, 0, 1], [1, -2, -1], [10, 0, 0]])
sage: C = ComputeMinimalPolynomials(B)
sage: x = polygen(ZZ, 'x')
sage: nu_1 = x^2 + x
sage: generators_4 = [2*x^2 + 2*x, x^2 + 3*x + 2]
sage: C.current_nu(2, 2, generators_4, nu_1)
x^2 + 3*x + 2
>>> from sage.all import *
>>> from sage.matrix.compute_J_ideal import ComputeMinimalPolynomials
>>> B = matrix(ZZ, [[Integer(1), Integer(0), Integer(1)], [Integer(1), -Integer(2), -Integer(1)], [Integer(10), Integer(0), Integer(0)]])
>>> C = ComputeMinimalPolynomials(B)
>>> x = polygen(ZZ, 'x')
>>> nu_1 = x**Integer(2) + x
>>> generators_4 = [Integer(2)*x**Integer(2) + Integer(2)*x, x**Integer(2) + Integer(3)*x + Integer(2)]
>>> C.current_nu(Integer(2), Integer(2), generators_4, nu_1)
x^2 + 3*x + 2
from sage.matrix.compute_J_ideal import ComputeMinimalPolynomials
B = matrix(ZZ, [[1, 0, 1], [1, -2, -1], [10, 0, 0]])
C = ComputeMinimalPolynomials(B)
x = polygen(ZZ, 'x')
nu_1 = x^2 + x
generators_4 = [2*x^2 + 2*x, x^2 + 3*x + 2]
C.current_nu(2, 2, generators_4, nu_1)

ALGORITHM:

[HR2016], Algorithm 4.

find_monic_replacements(p, t, pt_generators, prev_nu)[source]

Replace possibly non-monic generators of N(pt)(B) by monic generators.

INPUT:

  • p – a prime element of D

  • t – nonnegative integer

  • pt_generators – list (g1,,gs) of polynomials in D[X] such that N(pt)(B)=(g1,,gs)+pN(pt1)(B)

  • prev_nu – a (pt1)-minimal polynomial of B

OUTPUT:

A list (h1,,hr) of monic polynomials such that N(pt)(B)=(h1,,hr)+pN(pt1)(B).

EXAMPLES:

sage: from sage.matrix.compute_J_ideal import ComputeMinimalPolynomials
sage: B = matrix(ZZ, [[1, 0, 1], [1, -2, -1], [10, 0, 0]])
sage: C = ComputeMinimalPolynomials(B)
sage: x = polygen(ZZ, 'x')
sage: nu_1 = x^2 + x
sage: generators_4 = [2*x^2 + 2*x, x^2 + 3*x + 2]
sage: C.find_monic_replacements(2, 2, generators_4, nu_1)
[x^2 + 3*x + 2]
>>> from sage.all import *
>>> from sage.matrix.compute_J_ideal import ComputeMinimalPolynomials
>>> B = matrix(ZZ, [[Integer(1), Integer(0), Integer(1)], [Integer(1), -Integer(2), -Integer(1)], [Integer(10), Integer(0), Integer(0)]])
>>> C = ComputeMinimalPolynomials(B)
>>> x = polygen(ZZ, 'x')
>>> nu_1 = x**Integer(2) + x
>>> generators_4 = [Integer(2)*x**Integer(2) + Integer(2)*x, x**Integer(2) + Integer(3)*x + Integer(2)]
>>> C.find_monic_replacements(Integer(2), Integer(2), generators_4, nu_1)
[x^2 + 3*x + 2]
from sage.matrix.compute_J_ideal import ComputeMinimalPolynomials
B = matrix(ZZ, [[1, 0, 1], [1, -2, -1], [10, 0, 0]])
C = ComputeMinimalPolynomials(B)
x = polygen(ZZ, 'x')
nu_1 = x^2 + x
generators_4 = [2*x^2 + 2*x, x^2 + 3*x + 2]
C.find_monic_replacements(2, 2, generators_4, nu_1)

ALGORITHM:

[HR2016], Algorithms 2 and 3.

integer_valued_polynomials_generators()[source]

Determine the generators of the ring of integer valued polynomials on B.

OUTPUT:

A pair (mu_B, P) where P is a list of polynomials in K[X] such that

{fK[X]f(B)Mn(D)}=μBK[X]+gPgD[X]

where K denotes the fraction field of D.

EXAMPLES:

sage: from sage.matrix.compute_J_ideal import ComputeMinimalPolynomials
sage: B = matrix(ZZ, [[1, 0, 1], [1, -2, -1], [10, 0, 0]])
sage: C = ComputeMinimalPolynomials(B)
sage: C.integer_valued_polynomials_generators()
(x^3 + x^2 - 12*x - 20, [1, 1/4*x^2 + 3/4*x + 1/2])
>>> from sage.all import *
>>> from sage.matrix.compute_J_ideal import ComputeMinimalPolynomials
>>> B = matrix(ZZ, [[Integer(1), Integer(0), Integer(1)], [Integer(1), -Integer(2), -Integer(1)], [Integer(10), Integer(0), Integer(0)]])
>>> C = ComputeMinimalPolynomials(B)
>>> C.integer_valued_polynomials_generators()
(x^3 + x^2 - 12*x - 20, [1, 1/4*x^2 + 3/4*x + 1/2])
from sage.matrix.compute_J_ideal import ComputeMinimalPolynomials
B = matrix(ZZ, [[1, 0, 1], [1, -2, -1], [10, 0, 0]])
C = ComputeMinimalPolynomials(B)
C.integer_valued_polynomials_generators()
mccoy_column(p, t, nu)[source]

Compute matrix for McCoy’s criterion.

INPUT:

  • p – a prime element in D

  • t – positive integer

  • nu – a (pt)-minimal polynomial of B

OUTPUT:

An (n2+1)×1 matrix g with first entry nu such that (bχBI)g0(modpt) where b consists of the entries of adj(XB).

EXAMPLES:

sage: from sage.matrix.compute_J_ideal import ComputeMinimalPolynomials
sage: B = matrix(ZZ, [[1, 0, 1], [1, -2, -1], [10, 0, 0]])
sage: C = ComputeMinimalPolynomials(B)
sage: x = polygen(ZZ, 'x')
sage: nu_4 = x^2 + 3*x + 2
sage: g = C.mccoy_column(2, 2, nu_4)
sage: b = matrix(9, 1, (x - B).adjugate().list())
sage: M = matrix.block([[b, -B.charpoly(x)*matrix.identity(9)]])
sage: (M*g % 4).is_zero()
True
>>> from sage.all import *
>>> from sage.matrix.compute_J_ideal import ComputeMinimalPolynomials
>>> B = matrix(ZZ, [[Integer(1), Integer(0), Integer(1)], [Integer(1), -Integer(2), -Integer(1)], [Integer(10), Integer(0), Integer(0)]])
>>> C = ComputeMinimalPolynomials(B)
>>> x = polygen(ZZ, 'x')
>>> nu_4 = x**Integer(2) + Integer(3)*x + Integer(2)
>>> g = C.mccoy_column(Integer(2), Integer(2), nu_4)
>>> b = matrix(Integer(9), Integer(1), (x - B).adjugate().list())
>>> M = matrix.block([[b, -B.charpoly(x)*matrix.identity(Integer(9))]])
>>> (M*g % Integer(4)).is_zero()
True
from sage.matrix.compute_J_ideal import ComputeMinimalPolynomials
B = matrix(ZZ, [[1, 0, 1], [1, -2, -1], [10, 0, 0]])
C = ComputeMinimalPolynomials(B)
x = polygen(ZZ, 'x')
nu_4 = x^2 + 3*x + 2
g = C.mccoy_column(2, 2, nu_4)
b = matrix(9, 1, (x - B).adjugate().list())
M = matrix.block([[b, -B.charpoly(x)*matrix.identity(9)]])
(M*g % 4).is_zero()

ALGORITHM:

[HR2016], Algorithm 5.

null_ideal(b=0)[source]

Return the (b)-ideal N(b)(B)={fD[X]f(B)Mn(bD)}.

INPUT:

  • b – an element of D (default: 0)

OUTPUT: an ideal in D[X]

EXAMPLES:

sage: from sage.matrix.compute_J_ideal import ComputeMinimalPolynomials
sage: B = matrix(ZZ, [[1, 0, 1], [1, -2, -1], [10, 0, 0]])
sage: C = ComputeMinimalPolynomials(B)
sage: C.null_ideal()
Principal ideal (x^3 + x^2 - 12*x - 20) of
    Univariate Polynomial Ring in x over Integer Ring
sage: C.null_ideal(2)
Ideal (2, x^2 + x) of
    Univariate Polynomial Ring in x over Integer Ring
sage: C.null_ideal(4)
Ideal (4, x^2 + 3*x + 2) of
    Univariate Polynomial Ring in x over Integer Ring
sage: C.null_ideal(8)
Ideal (8, x^3 + x^2 - 12*x - 20, 2*x^2 + 6*x + 4) of
    Univariate Polynomial Ring in x over Integer Ring
sage: C.null_ideal(3)
Ideal (3, x^3 + x^2 - 12*x - 20) of
    Univariate Polynomial Ring in x over Integer Ring
sage: C.null_ideal(6)
Ideal (6, 2*x^3 + 2*x^2 - 24*x - 40, 3*x^2 + 3*x) of
    Univariate Polynomial Ring in x over Integer Ring
>>> from sage.all import *
>>> from sage.matrix.compute_J_ideal import ComputeMinimalPolynomials
>>> B = matrix(ZZ, [[Integer(1), Integer(0), Integer(1)], [Integer(1), -Integer(2), -Integer(1)], [Integer(10), Integer(0), Integer(0)]])
>>> C = ComputeMinimalPolynomials(B)
>>> C.null_ideal()
Principal ideal (x^3 + x^2 - 12*x - 20) of
    Univariate Polynomial Ring in x over Integer Ring
>>> C.null_ideal(Integer(2))
Ideal (2, x^2 + x) of
    Univariate Polynomial Ring in x over Integer Ring
>>> C.null_ideal(Integer(4))
Ideal (4, x^2 + 3*x + 2) of
    Univariate Polynomial Ring in x over Integer Ring
>>> C.null_ideal(Integer(8))
Ideal (8, x^3 + x^2 - 12*x - 20, 2*x^2 + 6*x + 4) of
    Univariate Polynomial Ring in x over Integer Ring
>>> C.null_ideal(Integer(3))
Ideal (3, x^3 + x^2 - 12*x - 20) of
    Univariate Polynomial Ring in x over Integer Ring
>>> C.null_ideal(Integer(6))
Ideal (6, 2*x^3 + 2*x^2 - 24*x - 40, 3*x^2 + 3*x) of
    Univariate Polynomial Ring in x over Integer Ring
from sage.matrix.compute_J_ideal import ComputeMinimalPolynomials
B = matrix(ZZ, [[1, 0, 1], [1, -2, -1], [10, 0, 0]])
C = ComputeMinimalPolynomials(B)
C.null_ideal()
C.null_ideal(2)
C.null_ideal(4)
C.null_ideal(8)
C.null_ideal(3)
C.null_ideal(6)
p_minimal_polynomials(p, s_max=None)[source]

Compute (ps)-minimal polynomials νs of B.

Compute a finite subset S of the positive integers and (ps)-minimal polynomials νs for sS.

For 0<tmaxS, a (pt)-minimal polynomial is given by νs where s=min{rSrt}. For t>maxS, the minimal polynomial of B is also a (pt)-minimal polynomial.

INPUT:

  • p – a prime in D

  • s_max – positive integer (default: None); if set, only (ps)-minimal polynomials for s <= s_max are computed (see below for details)

OUTPUT:

A dictionary. Keys are the finite set S, the values are the associated (ps)-minimal polynomials νs, sS.

Setting s_max only affects the output if s_max is at most maxS where S denotes the full set. In that case, only those νs with s <= s_max are returned where s_max is always included even if it is not included in the full set S.

EXAMPLES:

sage: from sage.matrix.compute_J_ideal import ComputeMinimalPolynomials
sage: B = matrix(ZZ, [[1, 0, 1], [1, -2, -1], [10, 0, 0]])
sage: C = ComputeMinimalPolynomials(B)
sage: C.p_minimal_polynomials(2)
{2: x^2 + 3*x + 2}
sage: set_verbose(1)
sage: C = ComputeMinimalPolynomials(B)
sage: C.p_minimal_polynomials(2)
verbose 1 (...: compute_J_ideal.py, p_minimal_polynomials)
------------------------------------------
verbose 1 (...: compute_J_ideal.py, p_minimal_polynomials)
p = 2, t = 1:
verbose 1 (...: compute_J_ideal.py, p_minimal_polynomials)
Result of lifting:
verbose 1 (...: compute_J_ideal.py, p_minimal_polynomials)
F =
verbose 1 (...: compute_J_ideal.py, p_minimal_polynomials)
[x^2 + x]
[      x]
[      0]
[      1]
[      1]
[  x + 1]
[      1]
[      0]
[      0]
[  x + 1]
verbose 1 (...: compute_J_ideal.py, current_nu)
------------------------------------------
verbose 1 (...: compute_J_ideal.py, current_nu)
(x^2 + x)
verbose 1 (...: compute_J_ideal.py, current_nu)
Generators with (p^t)-generating property:
verbose 1 (...: compute_J_ideal.py, current_nu)
[x^2 + x]
verbose 1 (...: compute_J_ideal.py, p_minimal_polynomials)
nu = x^2 + x
verbose 1 (...: compute_J_ideal.py, p_minimal_polynomials)
corresponding columns for G
verbose 1 (...: compute_J_ideal.py, p_minimal_polynomials)
[x^2 + x]
[  x + 2]
[      0]
[      1]
[      1]
[  x - 1]
[     -1]
[     10]
[      0]
[  x + 1]
verbose 1 (...: compute_J_ideal.py, p_minimal_polynomials)
------------------------------------------
verbose 1 (...: compute_J_ideal.py, p_minimal_polynomials)
p = 2, t = 2:
verbose 1 (...: compute_J_ideal.py, p_minimal_polynomials)
Result of lifting:
verbose 1 (...: compute_J_ideal.py, p_minimal_polynomials)
F =
verbose 1 (...: compute_J_ideal.py, p_minimal_polynomials)
[  2*x^2 + 2*x x^2 + 3*x + 2]
[          2*x         x + 4]
[            0             0]
[            2             1]
[            2             1]
[      2*x + 2         x + 1]
[            2            -1]
[            0            10]
[            0             0]
[      2*x + 2         x + 3]
verbose 1 (...: compute_J_ideal.py, current_nu)
------------------------------------------
verbose 1 (...: compute_J_ideal.py, current_nu)
(2*x^2 + 2*x, x^2 + 3*x + 2)
verbose 1 (...: compute_J_ideal.py, current_nu)
Generators with (p^t)-generating property:
verbose 1 (...: compute_J_ideal.py, current_nu)
[x^2 + 3*x + 2]
verbose 1 (...: compute_J_ideal.py, p_minimal_polynomials)
nu = x^2 + 3*x + 2
verbose 1 (...: compute_J_ideal.py, p_minimal_polynomials)
corresponding columns for G
verbose 1 (...: compute_J_ideal.py, p_minimal_polynomials)
[x^2 + 3*x + 2]
[        x + 4]
[            0]
[            1]
[            1]
[        x + 1]
[           -1]
[           10]
[            0]
[        x + 3]
verbose 1 (...: compute_J_ideal.py, p_minimal_polynomials)
------------------------------------------
verbose 1 (...: compute_J_ideal.py, p_minimal_polynomials)
p = 2, t = 3:
verbose 1 (...: compute_J_ideal.py, p_minimal_polynomials)
Result of lifting:
verbose 1 (...: compute_J_ideal.py, p_minimal_polynomials)
F =
verbose 1 (...: compute_J_ideal.py, p_minimal_polynomials)
[x^3 + 7*x^2 + 6*x x^3 + 3*x^2 + 2*x]
[        x^2 + 8*x         x^2 + 4*x]
[                0                 0]
[                x             x + 4]
[            x + 4                 x]
[    x^2 + 5*x + 4           x^2 + x]
[           -x + 4                -x]
[             10*x              10*x]
[                0                 0]
[        x^2 + 7*x     x^2 + 3*x + 4]
verbose 1 (...: compute_J_ideal.py, current_nu)
------------------------------------------
verbose 1 (...: compute_J_ideal.py, current_nu)
(x^3 + 7*x^2 + 6*x, x^3 + 3*x^2 + 2*x)
verbose 1 (...: compute_J_ideal.py, current_nu)
Generators with (p^t)-generating property:
verbose 1 (...: compute_J_ideal.py, current_nu)
...
verbose 1 (...: compute_J_ideal.py, current_nu)
[x^3 + 3*x^2 + 2*x]
verbose 1 (...: compute_J_ideal.py, p_minimal_polynomials)
nu = x^3 + 3*x^2 + 2*x
{2: x^2 + 3*x + 2}
sage: set_verbose(0)
sage: C.p_minimal_polynomials(2, s_max=1)
{1: x^2 + x}
sage: C.p_minimal_polynomials(2, s_max=2)
{2: x^2 + 3*x + 2}
sage: C.p_minimal_polynomials(2, s_max=3)
{2: x^2 + 3*x + 2}
>>> from sage.all import *
>>> from sage.matrix.compute_J_ideal import ComputeMinimalPolynomials
>>> B = matrix(ZZ, [[Integer(1), Integer(0), Integer(1)], [Integer(1), -Integer(2), -Integer(1)], [Integer(10), Integer(0), Integer(0)]])
>>> C = ComputeMinimalPolynomials(B)
>>> C.p_minimal_polynomials(Integer(2))
{2: x^2 + 3*x + 2}
>>> set_verbose(Integer(1))
>>> C = ComputeMinimalPolynomials(B)
>>> C.p_minimal_polynomials(Integer(2))
verbose 1 (...: compute_J_ideal.py, p_minimal_polynomials)
------------------------------------------
verbose 1 (...: compute_J_ideal.py, p_minimal_polynomials)
p = 2, t = 1:
verbose 1 (...: compute_J_ideal.py, p_minimal_polynomials)
Result of lifting:
verbose 1 (...: compute_J_ideal.py, p_minimal_polynomials)
F =
verbose 1 (...: compute_J_ideal.py, p_minimal_polynomials)
[x^2 + x]
[      x]
[      0]
[      1]
[      1]
[  x + 1]
[      1]
[      0]
[      0]
[  x + 1]
verbose 1 (...: compute_J_ideal.py, current_nu)
------------------------------------------
verbose 1 (...: compute_J_ideal.py, current_nu)
(x^2 + x)
verbose 1 (...: compute_J_ideal.py, current_nu)
Generators with (p^t)-generating property:
verbose 1 (...: compute_J_ideal.py, current_nu)
[x^2 + x]
verbose 1 (...: compute_J_ideal.py, p_minimal_polynomials)
nu = x^2 + x
verbose 1 (...: compute_J_ideal.py, p_minimal_polynomials)
corresponding columns for G
verbose 1 (...: compute_J_ideal.py, p_minimal_polynomials)
[x^2 + x]
[  x + 2]
[      0]
[      1]
[      1]
[  x - 1]
[     -1]
[     10]
[      0]
[  x + 1]
verbose 1 (...: compute_J_ideal.py, p_minimal_polynomials)
------------------------------------------
verbose 1 (...: compute_J_ideal.py, p_minimal_polynomials)
p = 2, t = 2:
verbose 1 (...: compute_J_ideal.py, p_minimal_polynomials)
Result of lifting:
verbose 1 (...: compute_J_ideal.py, p_minimal_polynomials)
F =
verbose 1 (...: compute_J_ideal.py, p_minimal_polynomials)
[  2*x^2 + 2*x x^2 + 3*x + 2]
[          2*x         x + 4]
[            0             0]
[            2             1]
[            2             1]
[      2*x + 2         x + 1]
[            2            -1]
[            0            10]
[            0             0]
[      2*x + 2         x + 3]
verbose 1 (...: compute_J_ideal.py, current_nu)
------------------------------------------
verbose 1 (...: compute_J_ideal.py, current_nu)
(2*x^2 + 2*x, x^2 + 3*x + 2)
verbose 1 (...: compute_J_ideal.py, current_nu)
Generators with (p^t)-generating property:
verbose 1 (...: compute_J_ideal.py, current_nu)
[x^2 + 3*x + 2]
verbose 1 (...: compute_J_ideal.py, p_minimal_polynomials)
nu = x^2 + 3*x + 2
verbose 1 (...: compute_J_ideal.py, p_minimal_polynomials)
corresponding columns for G
verbose 1 (...: compute_J_ideal.py, p_minimal_polynomials)
[x^2 + 3*x + 2]
[        x + 4]
[            0]
[            1]
[            1]
[        x + 1]
[           -1]
[           10]
[            0]
[        x + 3]
verbose 1 (...: compute_J_ideal.py, p_minimal_polynomials)
------------------------------------------
verbose 1 (...: compute_J_ideal.py, p_minimal_polynomials)
p = 2, t = 3:
verbose 1 (...: compute_J_ideal.py, p_minimal_polynomials)
Result of lifting:
verbose 1 (...: compute_J_ideal.py, p_minimal_polynomials)
F =
verbose 1 (...: compute_J_ideal.py, p_minimal_polynomials)
[x^3 + 7*x^2 + 6*x x^3 + 3*x^2 + 2*x]
[        x^2 + 8*x         x^2 + 4*x]
[                0                 0]
[                x             x + 4]
[            x + 4                 x]
[    x^2 + 5*x + 4           x^2 + x]
[           -x + 4                -x]
[             10*x              10*x]
[                0                 0]
[        x^2 + 7*x     x^2 + 3*x + 4]
verbose 1 (...: compute_J_ideal.py, current_nu)
------------------------------------------
verbose 1 (...: compute_J_ideal.py, current_nu)
(x^3 + 7*x^2 + 6*x, x^3 + 3*x^2 + 2*x)
verbose 1 (...: compute_J_ideal.py, current_nu)
Generators with (p^t)-generating property:
verbose 1 (...: compute_J_ideal.py, current_nu)
...
verbose 1 (...: compute_J_ideal.py, current_nu)
[x^3 + 3*x^2 + 2*x]
verbose 1 (...: compute_J_ideal.py, p_minimal_polynomials)
nu = x^3 + 3*x^2 + 2*x
{2: x^2 + 3*x + 2}
>>> set_verbose(Integer(0))
>>> C.p_minimal_polynomials(Integer(2), s_max=Integer(1))
{1: x^2 + x}
>>> C.p_minimal_polynomials(Integer(2), s_max=Integer(2))
{2: x^2 + 3*x + 2}
>>> C.p_minimal_polynomials(Integer(2), s_max=Integer(3))
{2: x^2 + 3*x + 2}
from sage.matrix.compute_J_ideal import ComputeMinimalPolynomials
B = matrix(ZZ, [[1, 0, 1], [1, -2, -1], [10, 0, 0]])
C = ComputeMinimalPolynomials(B)
C.p_minimal_polynomials(2)
set_verbose(1)
C = ComputeMinimalPolynomials(B)
C.p_minimal_polynomials(2)
set_verbose(0)
C.p_minimal_polynomials(2, s_max=1)
C.p_minimal_polynomials(2, s_max=2)
C.p_minimal_polynomials(2, s_max=3)

ALGORITHM:

[HR2016], Algorithm 5.

prime_candidates()[source]

Determine those primes p where μB might not be a (p)-minimal polynomial.

OUTPUT: list of primes

EXAMPLES:

sage: from sage.matrix.compute_J_ideal import ComputeMinimalPolynomials
sage: B = matrix(ZZ, [[1, 0, 1], [1, -2, -1], [10, 0, 0]])
sage: C = ComputeMinimalPolynomials(B)
sage: C.prime_candidates()
[2, 3, 5]
sage: C.p_minimal_polynomials(2)
{2: x^2 + 3*x + 2}
sage: C.p_minimal_polynomials(3)
{}
sage: C.p_minimal_polynomials(5)
{}
>>> from sage.all import *
>>> from sage.matrix.compute_J_ideal import ComputeMinimalPolynomials
>>> B = matrix(ZZ, [[Integer(1), Integer(0), Integer(1)], [Integer(1), -Integer(2), -Integer(1)], [Integer(10), Integer(0), Integer(0)]])
>>> C = ComputeMinimalPolynomials(B)
>>> C.prime_candidates()
[2, 3, 5]
>>> C.p_minimal_polynomials(Integer(2))
{2: x^2 + 3*x + 2}
>>> C.p_minimal_polynomials(Integer(3))
{}
>>> C.p_minimal_polynomials(Integer(5))
{}
from sage.matrix.compute_J_ideal import ComputeMinimalPolynomials
B = matrix(ZZ, [[1, 0, 1], [1, -2, -1], [10, 0, 0]])
C = ComputeMinimalPolynomials(B)
C.prime_candidates()
C.p_minimal_polynomials(2)
C.p_minimal_polynomials(3)
C.p_minimal_polynomials(5)

This means that 3 and 5 were candidates, but actually, μB turns out to be a (3)-minimal polynomial and a (5)-minimal polynomial.

sage.matrix.compute_J_ideal.lifting(p, t, A, G)[source]

Compute generators of {fD[X]dAf0(modpt)} given generators of {fD[X]dAf0(modpt1)}.

INPUT:

  • p – a prime element of some principal ideal domain D

  • t – nonnegative integer

  • A – a c×d matrix over D[X]

  • G – a matrix over D[X]. The columns of (pt1IG) are generators of {fD[X]dAf0(modpt1)}; can be set to None if t is zero

OUTPUT:

A matrix F over D[X] such that the columns of (ptIFpG) are generators of {fD[X]dAf0(modpt)}.

EXAMPLES:

sage: from sage.matrix.compute_J_ideal import lifting
sage: X = polygen(ZZ, 'X')
sage: A = matrix([[1, X], [2*X, X^2]])
sage: G0 = lifting(5, 0, A, None)
sage: G1 = lifting(5, 1, A, G0); G1
[]
sage: (A*G1 % 5).is_zero()
True
sage: A = matrix([[1, X, X^2], [2*X, X^2, 3*X^3]])
sage: G0 = lifting(5, 0, A, None)
sage: G1 = lifting(5, 1, A, G0); G1
[3*X^2]
[    X]
[    1]
sage: (A*G1 % 5).is_zero()
True
sage: G2 = lifting(5, 2, A, G1); G2
[15*X^2 23*X^2]
[   5*X      X]
[     5      1]
sage: (A*G2 % 25).is_zero()
True
sage: lifting(5, 10, A, G1)
Traceback (most recent call last):
...
ValueError: A*G not zero mod 5^9
>>> from sage.all import *
>>> from sage.matrix.compute_J_ideal import lifting
>>> X = polygen(ZZ, 'X')
>>> A = matrix([[Integer(1), X], [Integer(2)*X, X**Integer(2)]])
>>> G0 = lifting(Integer(5), Integer(0), A, None)
>>> G1 = lifting(Integer(5), Integer(1), A, G0); G1
[]
>>> (A*G1 % Integer(5)).is_zero()
True
>>> A = matrix([[Integer(1), X, X**Integer(2)], [Integer(2)*X, X**Integer(2), Integer(3)*X**Integer(3)]])
>>> G0 = lifting(Integer(5), Integer(0), A, None)
>>> G1 = lifting(Integer(5), Integer(1), A, G0); G1
[3*X^2]
[    X]
[    1]
>>> (A*G1 % Integer(5)).is_zero()
True
>>> G2 = lifting(Integer(5), Integer(2), A, G1); G2
[15*X^2 23*X^2]
[   5*X      X]
[     5      1]
>>> (A*G2 % Integer(25)).is_zero()
True
>>> lifting(Integer(5), Integer(10), A, G1)
Traceback (most recent call last):
...
ValueError: A*G not zero mod 5^9
from sage.matrix.compute_J_ideal import lifting
X = polygen(ZZ, 'X')
A = matrix([[1, X], [2*X, X^2]])
G0 = lifting(5, 0, A, None)
G1 = lifting(5, 1, A, G0); G1
(A*G1 % 5).is_zero()
A = matrix([[1, X, X^2], [2*X, X^2, 3*X^3]])
G0 = lifting(5, 0, A, None)
G1 = lifting(5, 1, A, G0); G1
(A*G1 % 5).is_zero()
G2 = lifting(5, 2, A, G1); G2
(A*G2 % 25).is_zero()
lifting(5, 10, A, G1)

ALGORITHM:

[HR2016], Algorithm 1.

sage.matrix.compute_J_ideal.p_part(f, p)[source]

Compute the p-part of a polynomial.

INPUT:

  • f – a polynomial over D

  • p – a prime in D

OUTPUT:

A polynomial g such that deggdegf and all nonzero coefficients of fpg are not divisible by p.

EXAMPLES:

sage: from sage.matrix.compute_J_ideal import p_part
sage: X = polygen(ZZ, 'X')
sage: f = X^3 + 5*X + 25
sage: g = p_part(f, 5); g
X + 5
sage: f - 5*g
X^3
>>> from sage.all import *
>>> from sage.matrix.compute_J_ideal import p_part
>>> X = polygen(ZZ, 'X')
>>> f = X**Integer(3) + Integer(5)*X + Integer(25)
>>> g = p_part(f, Integer(5)); g
X + 5
>>> f - Integer(5)*g
X^3
from sage.matrix.compute_J_ideal import p_part
X = polygen(ZZ, 'X')
f = X^3 + 5*X + 25
g = p_part(f, 5); g
f - 5*g