Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sage.matrix, sage.modules: Update # needs #36569

Merged
merged 19 commits into from
Nov 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/sage/matrix/args.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -871,6 +871,7 @@ cdef class MatrixArgs:

Check github issue #36065:

sage: # needs sage.rings.number_field
sage: class MyAlgebraicNumber(sage.rings.qqbar.AlgebraicNumber):
....: def __bool__(self):
....: raise ValueError
Expand Down
2 changes: 1 addition & 1 deletion src/sage/matrix/constructor.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,7 @@ def matrix(*args, **kwds):

Check :trac:`24459`::

sage: # needs sage.libs.flint
sage: # needs sage.libs.linbox
sage: Matrix(ZZ, sys.maxsize, sys.maxsize)
Traceback (most recent call last):
...
Expand Down
22 changes: 11 additions & 11 deletions src/sage/matrix/matrix0.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -543,11 +543,11 @@ cdef class Matrix(sage.structure.element.Matrix):

TESTS::

sage: class MyAlgebraicNumber(sage.rings.qqbar.AlgebraicNumber): # needs sage.rings.number_fields
sage: class MyAlgebraicNumber(sage.rings.qqbar.AlgebraicNumber): # needs sage.rings.number_field
....: def __bool__(self):
....: raise ValueError
sage: mat = matrix(1, 1, MyAlgebraicNumber(1)) # needs sage.rings.number_fields
sage: bool(mat) # needs sage.rings.number_fields
sage: mat = matrix(1, 1, MyAlgebraicNumber(1)) # needs sage.rings.number_field
sage: bool(mat) # needs sage.rings.number_field
Traceback (most recent call last):
...
ValueError
Expand Down Expand Up @@ -4898,7 +4898,7 @@ cdef class Matrix(sage.structure.element.Matrix):
Over finite fields::

sage: A = matrix(GF(59), 3, [10,56,39,53,56,33,58,24,55])
sage: A.multiplicative_order() # needs sage.groups
sage: A.multiplicative_order() # needs sage.libs.pari
580
sage: (A^580).is_one()
True
Expand All @@ -4918,7 +4918,7 @@ cdef class Matrix(sage.structure.element.Matrix):
Over `\ZZ`::

sage: m = matrix(ZZ, 2, 2, [-1,1,-1,0])
sage: m.multiplicative_order() # needs sage.groups
sage: m.multiplicative_order() # needs sage.libs.pari
3

sage: m = posets.ChainPoset(6).coxeter_transformation() # needs sage.combinat sage.graphs
Expand All @@ -4930,10 +4930,10 @@ cdef class Matrix(sage.structure.element.Matrix):
10

sage: M = matrix(ZZ, 2, 2, [1, 1, 0, 1])
sage: M.multiplicative_order() # needs sage.groups
sage: M.multiplicative_order() # needs sage.libs.pari
+Infinity

sage: for k in range(600): # needs sage.groups
sage: for k in range(600): # needs sage.groups sage.modular
....: m = SL2Z.random_element()
....: o = m.multiplicative_order()
....: if o != Infinity and m**o != SL2Z.one():
Expand All @@ -4948,7 +4948,7 @@ cdef class Matrix(sage.structure.element.Matrix):
....: else:
....: return ZZ.random_element(-100,100)
sage: rnd = matrix(ZZ, 8, 8, val)
sage: (rnd * m24 * rnd.inverse_of_unit()).multiplicative_order() # needs sage.groups
sage: (rnd * m24 * rnd.inverse_of_unit()).multiplicative_order() # needs sage.libs.pari
24

TESTS::
Expand Down Expand Up @@ -5827,9 +5827,9 @@ cdef class Matrix(sage.structure.element.Matrix):

Tests for :trac:`28570`::

sage: P = posets.TamariLattice(7) # needs sage.combinat sage.graphs
sage: M = P._hasse_diagram._leq_matrix # needs sage.combinat sage.graphs
sage: M.inverse_of_unit() # this was very slow, now 1s # needs sage.combinat sage.graphs
sage: P = posets.TamariLattice(7) # needs sage.graphs
sage: M = P._hasse_diagram._leq_matrix # needs sage.graphs
sage: M.inverse_of_unit() # this was very slow, now 1s # needs sage.graphs
429 x 429 sparse matrix over Integer Ring...

sage: m = matrix(Zmod(2**2), 1, 1, [1], sparse=True)
Expand Down
2 changes: 1 addition & 1 deletion src/sage/matrix/matrix1.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ cdef class Matrix(Matrix0):
[ [ 0, 1, 2 ], [ 3, 4, 5 ], [ 6, 7, 8 ] ]
sage: g.CharacteristicPolynomial()
x_1^3-12*x_1^2-18*x_1
sage: A.characteristic_polynomial()
sage: A.characteristic_polynomial() # needs sage.libs.pari
x^3 - 12*x^2 - 18*x
sage: matrix(QQ, g) == A
True
Expand Down
Loading