Skip to content

Commit

Permalink
sagemathgh-36569: sage.matrix, sage.modules: Update # needs
Browse files Browse the repository at this point in the history
    
<!-- ^^^^^
Please provide a concise, informative and self-explanatory title.
Don't put issue numbers in there, do this in the PR body below.
For example, instead of "Fixes sagemath#1234" use "Introduce new method to
calculate 1+1"
-->
<!-- Describe your changes here in detail -->

<!-- Why is this change required? What problem does it solve? -->
<!-- If this PR resolves an open issue, please link to it here. For
example "Fixes sagemath#12345". -->
- Cherry picked from sagemath#35095
- Part of sagemath#29705
<!-- If your change requires a documentation PR, please link it
appropriately. -->

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->
<!-- If your change requires a documentation PR, please link it
appropriately -->
<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
<!-- Feel free to remove irrelevant items. -->

- [x] The title is concise, informative, and self-explanatory.
- [ ] The description explains in detail what this PR is about.
- [x] I have linked a relevant issue or discussion.
- [ ] I have created tests covering the changes.
- [ ] I have updated the documentation accordingly.

### ⌛ Dependencies

<!-- List all open PRs that this PR logically depends on
- sagemath#12345: short description why this is a dependency
- sagemath#34567: ...
-->

<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
    
URL: sagemath#36569
Reported by: Matthias Köppe
Reviewer(s): David Coudert
  • Loading branch information
Release Manager committed Oct 31, 2023
2 parents 6e9fd5b + c3b6f2f commit 705c09d
Show file tree
Hide file tree
Showing 28 changed files with 401 additions and 304 deletions.
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

0 comments on commit 705c09d

Please sign in to comment.