Skip to content

Commit

Permalink
In # optional, no commas between tags
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthias Koeppe committed Mar 8, 2023
1 parent 1aaa1fc commit 7e89a0d
Show file tree
Hide file tree
Showing 8 changed files with 99 additions and 99 deletions.
102 changes: 51 additions & 51 deletions src/sage/arith/misc.py

Large diffs are not rendered by default.

64 changes: 32 additions & 32 deletions src/sage/matrix/matrix2.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -3701,12 +3701,12 @@ cdef class Matrix(Matrix1):
sage: a = Q.gen(0) # optional - sage.rings.number_field
sage: A = matrix(Q, [[ 2, 5-a, 15-a], # optional - sage.rings.number_field
....: [2+a, a, -7 + 5*a]])
sage: result = A._right_kernel_matrix_over_number_field() # optional - sage.rings.number_field, sage.libs.pari
sage: result[0] # optional - sage.rings.number_field, sage.libs.pari
sage: result = A._right_kernel_matrix_over_number_field() # optional - sage.rings.number_field sage.libs.pari
sage: result[0] # optional - sage.rings.number_field sage.libs.pari
'pivot-pari-numberfield'
sage: P = result[1]; P # optional - sage.rings.number_field, sage.libs.pari
sage: P = result[1]; P # optional - sage.rings.number_field sage.libs.pari
[-a -3 1]
sage: A*P.transpose() == zero_matrix(Q, 2, 1) # optional - sage.rings.number_field, sage.libs.pari
sage: A*P.transpose() == zero_matrix(Q, 2, 1) # optional - sage.rings.number_field sage.libs.pari
True

TESTS:
Expand All @@ -3715,16 +3715,16 @@ cdef class Matrix(Matrix1):

sage: Q = QuadraticField(-7) # optional - sage.rings.number_field
sage: A = matrix(Q, 0, 2) # optional - sage.rings.number_field
sage: A._right_kernel_matrix_over_number_field()[1] # optional - sage.rings.number_field, sage.libs.pari
sage: A._right_kernel_matrix_over_number_field()[1] # optional - sage.rings.number_field sage.libs.pari
[1 0]
[0 1]
sage: A = matrix(Q, 2, 0) # optional - sage.rings.number_field, sage.libs.pari
sage: A._right_kernel_matrix_over_number_field()[1].parent() # optional - sage.rings.number_field, sage.libs.pari
sage: A = matrix(Q, 2, 0) # optional - sage.rings.number_field sage.libs.pari
sage: A._right_kernel_matrix_over_number_field()[1].parent() # optional - sage.rings.number_field sage.libs.pari
Full MatrixSpace of 0 by 0 dense matrices
over Number Field in a with defining polynomial x^2 + 7
with a = 2.645751311064591?*I
sage: A = zero_matrix(Q, 4, 3) # optional - sage.rings.number_field, sage.libs.pari
sage: A._right_kernel_matrix_over_number_field()[1] # optional - sage.rings.number_field, sage.libs.pari
sage: A = zero_matrix(Q, 4, 3) # optional - sage.rings.number_field sage.libs.pari
sage: A._right_kernel_matrix_over_number_field()[1] # optional - sage.rings.number_field sage.libs.pari
[1 0 0]
[0 1 0]
[0 0 1]
Expand Down Expand Up @@ -4070,10 +4070,10 @@ cdef class Matrix(Matrix1):
[ -2 -a - 1 0 1]
sage: A*C.transpose() == zero_matrix(Q, 2, 2) # optional - sage.rings.number_field
True
sage: P = A.right_kernel_matrix(algorithm='pari', basis='pivot'); P # optional - sage.rings.number_field, sage.libs.pari
sage: P = A.right_kernel_matrix(algorithm='pari', basis='pivot'); P # optional - sage.rings.number_field sage.libs.pari
[ -a -3 1 0]
[ -2 -a - 1 0 1]
sage: A*P.transpose() == zero_matrix(Q, 2, 2) # optional - sage.rings.number_field, sage.libs.pari
sage: A*P.transpose() == zero_matrix(Q, 2, 2) # optional - sage.rings.number_field sage.libs.pari
True
sage: E = A.right_kernel_matrix(algorithm='default', basis='echelon'); E # optional - sage.rings.number_field
[ 1 0 7/88*a + 3/88 -3/176*a - 39/176]
Expand Down Expand Up @@ -9544,10 +9544,10 @@ cdef class Matrix(Matrix1):

EXAMPLES::

sage: A = matrix(QQbar, [[(1/sqrt(5))*(1+i), (1/sqrt(55))*(3+2*I), (1/sqrt(22))*(2+2*I)], # optional - sage.symbolic, sage.rings.number_field
sage: A = matrix(QQbar, [[(1/sqrt(5))*(1+i), (1/sqrt(55))*(3+2*I), (1/sqrt(22))*(2+2*I)], # optional - sage.symbolic sage.rings.number_field
....: [(1/sqrt(5))*(1-i), (1/sqrt(55))*(2+2*I), (1/sqrt(22))*(-3+I)],
....: [ (1/sqrt(5))*I, (1/sqrt(55))*(3-5*I), (1/sqrt(22))*(-2)]])
sage: A.is_unitary() # optional - sage.symbolic, sage.rings.number_field
sage: A.is_unitary() # optional - sage.symbolic sage.rings.number_field
True

A permutation matrix is always orthogonal. ::
Expand All @@ -9561,9 +9561,9 @@ cdef class Matrix(Matrix1):
[0 0 0 1 0]
sage: P.is_unitary() # optional - sage.combinat
True
sage: P.change_ring(GF(3)).is_unitary() # optional - sage.combinat, sage.libs.pari
sage: P.change_ring(GF(3)).is_unitary() # optional - sage.combinat sage.libs.pari
True
sage: P.change_ring(GF(3)).is_unitary() # optional - sage.combinat, sage.libs.pari
sage: P.change_ring(GF(3)).is_unitary() # optional - sage.combinat sage.libs.pari
True

A square matrix far from unitary. ::
Expand Down Expand Up @@ -11947,9 +11947,9 @@ cdef class Matrix(Matrix1):
algebraic closure of this field to find the change-of-basis
matrix::

sage: cox = posets.TamariLattice(3).coxeter_transformation() # optional - sage.graphs, sage.combinat, sage.libs.pari
sage: M = cox.change_ring(GF(3)) # optional - sage.graphs, sage.combinat, sage.libs.pari
sage: M.is_similar(M**3, True) # long time # optional - sage.graphs, sage.combinat, sage.libs.pari
sage: cox = posets.TamariLattice(3).coxeter_transformation() # optional - sage.graphs sage.combinat sage.libs.pari
sage: M = cox.change_ring(GF(3)) # optional - sage.graphs sage.combinat sage.libs.pari
sage: M.is_similar(M**3, True) # long time # optional - sage.graphs sage.combinat sage.libs.pari
(
[1 0 0 0 0]
[0 1 1 0 2]
Expand Down Expand Up @@ -12905,32 +12905,32 @@ cdef class Matrix(Matrix1):

A matrix containing real roots::

sage: A = matrix(AA, [ [1, 0, sqrt(2)], # optional - sage.rings.number_field, sage.symbolic
sage: A = matrix(AA, [ [1, 0, sqrt(2)], # optional - sage.rings.number_field sage.symbolic
....: [0, sqrt(3), 0 ],
....: [sqrt(2), 0, sqrt(5)] ])
sage: A.is_positive_definite() # optional - sage.rings.number_field, sage.symbolic
sage: A.is_positive_definite() # optional - sage.rings.number_field sage.symbolic
True
sage: B = matrix(AA, [ [2*sqrt(5) + 5, 0, -sqrt(8*sqrt(5) + 18)], # optional - sage.rings.number_field, sage.symbolic
sage: B = matrix(AA, [ [2*sqrt(5) + 5, 0, -sqrt(8*sqrt(5) + 18)], # optional - sage.rings.number_field sage.symbolic
....: [0, sqrt(1/3), 0],
....: [-sqrt(8*sqrt(5) + 18), 0, sqrt(5) + 2] ])
sage: A.inverse_positive_definite() == B # optional - sage.rings.number_field, sage.symbolic
sage: A.inverse_positive_definite() == B # optional - sage.rings.number_field sage.symbolic
True
sage: A*B == A.matrix_space().identity_matrix() # optional - sage.rings.number_field, sage.symbolic
sage: A*B == A.matrix_space().identity_matrix() # optional - sage.rings.number_field sage.symbolic
True

A Hermitian (but not symmetric) matrix with complex entries::

sage: A = matrix(QQbar, [ [ 1, 0, I ], # optional - sage.rings.number_field, sage.symbolic
sage: A = matrix(QQbar, [ [ 1, 0, I ], # optional - sage.rings.number_field sage.symbolic
....: [ 0, sqrt(5), 0 ],
....: [-I, 0, 3 ] ])
sage: A.is_positive_definite() # optional - sage.rings.number_field, sage.symbolic
sage: A.is_positive_definite() # optional - sage.rings.number_field sage.symbolic
True
sage: B = matrix(QQbar, [ [ 3/2, 0, -I/2 ], # optional - sage.rings.number_field, sage.symbolic
sage: B = matrix(QQbar, [ [ 3/2, 0, -I/2 ], # optional - sage.rings.number_field sage.symbolic
....: [ 0, sqrt(1/5), 0 ],
....: [ I/2, 0, 1/2 ] ])
sage: A.inverse_positive_definite() == B # optional - sage.rings.number_field, sage.symbolic
sage: A.inverse_positive_definite() == B # optional - sage.rings.number_field sage.symbolic
True
sage: A*B == A.matrix_space().identity_matrix() # optional - sage.rings.number_field, sage.symbolic
sage: A*B == A.matrix_space().identity_matrix() # optional - sage.rings.number_field sage.symbolic
True

TESTS:
Expand Down Expand Up @@ -13349,11 +13349,11 @@ cdef class Matrix(Matrix1):
absolute value must be handled carefully. This tests that
situation in the case of cyclotomic fields. ::

sage: C = SymmetricGroup(5).character_table() # optional - sage.groups, sage.rings.number_field
sage: C.base_ring() # optional - sage.groups, sage.rings.number_field
sage: C = SymmetricGroup(5).character_table() # optional - sage.groups sage.rings.number_field
sage: C.base_ring() # optional - sage.groups sage.rings.number_field
Cyclotomic Field of order 1 and degree 1
sage: P, L, U = C.LU(pivot='partial') # optional - sage.groups, sage.rings.number_field
sage: C == P*L*U # optional - sage.groups, sage.rings.number_field
sage: P, L, U = C.LU(pivot='partial') # optional - sage.groups sage.rings.number_field
sage: C == P*L*U # optional - sage.groups sage.rings.number_field
True

Check that :trac:`32736` is solved::
Expand Down
2 changes: 1 addition & 1 deletion src/sage/modules/free_module_element.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -5065,7 +5065,7 @@ cdef class FreeModuleElement_generic_sparse(FreeModuleElement):
(4, 5, 6)
sage: parent(w[39893]) # optional - sage.libs.pari
Finite Field of size 17
sage: w[39893] = sqrt(2) # optional - sage.libs.pari, sage.symbolic
sage: w[39893] = sqrt(2) # optional - sage.libs.pari sage.symbolic
Traceback (most recent call last):
...
TypeError: self must be a numeric expression
Expand Down
2 changes: 1 addition & 1 deletion src/sage/repl/preparse.py
Original file line number Diff line number Diff line change
Expand Up @@ -1726,7 +1726,7 @@ def preparse(line, reset=True, do_time=False, ignore_prompts=False,
"ZZ = ZZ['u,v']; (x, y,) = ZZ._first_ngens(2)"
sage: preparse("ZZ.<x> = QQ[2^(1/3)]")
'ZZ = QQ[Integer(2)**(Integer(1)/Integer(3))]; (x,) = ZZ._first_ngens(1)'
sage: QQ[2^(1/3)] # optional - sage.symbolic, sage.rings.number_field
sage: QQ[2^(1/3)] # optional - sage.symbolic sage.rings.number_field
Number Field in a with defining polynomial x^3 - 2 with a = 1.259921049894873?
sage: preparse("a^b")
Expand Down
8 changes: 4 additions & 4 deletions src/sage/repl/rich_output/backend_doctest.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,14 +164,14 @@ def displayhook(self, plain_text, rich_output):
This ends up calling the displayhook::
sage: plt = plot(sin) # optional - sage.plot, sage.symbolic
sage: plt # optional - sage.plot, sage.symbolic
sage: plt = plot(sin) # optional - sage.plot sage.symbolic
sage: plt # optional - sage.plot sage.symbolic
Graphics object consisting of 1 graphics primitive
sage: plt.show() # optional - sage.plot, sage.symbolic
sage: plt.show() # optional - sage.plot sage.symbolic
sage: from sage.repl.rich_output import get_display_manager
sage: dm = get_display_manager()
sage: dm.displayhook(plt) # indirect doctest # optional - sage.plot, sage.symbolic
sage: dm.displayhook(plt) # indirect doctest # optional - sage.plot sage.symbolic
Graphics object consisting of 1 graphics primitive
"""
self.validate(rich_output)
Expand Down
10 changes: 5 additions & 5 deletions src/sage/repl/rich_output/display_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -708,14 +708,14 @@ def graphics_from_save(self, save_function, save_kwds,
sage: from sage.repl.rich_output import get_display_manager
sage: dm = get_display_manager()
sage: plt = plot(sin) # optional - sage.symbolic, sage.plot
sage: out = dm.graphics_from_save(plt.save, dict(), '.png', # optional - sage.symbolic, sage.plot
sage: plt = plot(sin) # optional - sage.symbolic sage.plot
sage: out = dm.graphics_from_save(plt.save, dict(), '.png', # optional - sage.symbolic sage.plot
....: dm.types.OutputImagePng)
sage: out # optional - sage.symbolic, sage.plot
sage: out # optional - sage.symbolic sage.plot
OutputImagePng container
sage: out.png.get().startswith(b'\x89PNG') # optional - sage.symbolic, sage.plot
sage: out.png.get().startswith(b'\x89PNG') # optional - sage.symbolic sage.plot
True
sage: out.png.filename() # random # optional - sage.symbolic, sage.plot
sage: out.png.filename() # random # optional - sage.symbolic sage.plot
'/home/user/.sage/temp/localhost.localdomain/23903/tmp_pu5woK.png'
"""
import os
Expand Down
8 changes: 4 additions & 4 deletions src/sage/sets/condition_set.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,11 @@ class ConditionSet(Set_generic, Set_base, Set_boolean_operators, Set_add_sub_ope
sage: predicate(x, y, z) = sqrt(x^2 + y^2 + z^2) < 1.2; predicate # optional - sage.symbolic
(x, y, z) |--> sqrt(x^2 + y^2 + z^2) < 1.20000000000000
sage: P_inter_B_again = ConditionSet(P, predicate); P_inter_B_again # optional - sage.geometry.polyhedron, sage.symbolic
sage: P_inter_B_again = ConditionSet(P, predicate); P_inter_B_again # optional - sage.geometry.polyhedron sage.symbolic
{ (x, y, z) ∈ P : sqrt(x^2 + y^2 + z^2) < 1.20000000000000 }
sage: vector([1, 0, 0]) in P_inter_B_again # optional - sage.geometry.polyhedron, sage.symbolic
sage: vector([1, 0, 0]) in P_inter_B_again # optional - sage.geometry.polyhedron sage.symbolic
True
sage: vector([1, 1, 1]) in P_inter_B_again # optional - sage.geometry.polyhedron, sage.symbolic
sage: vector([1, 1, 1]) in P_inter_B_again # optional - sage.geometry.polyhedron sage.symbolic
False
Iterating over subsets determined by predicates::
Expand Down Expand Up @@ -121,7 +121,7 @@ class ConditionSet(Set_generic, Set_base, Set_boolean_operators, Set_add_sub_ope
TESTS::
sage: TestSuite(P_inter_B).run(skip='_test_pickling') # cannot pickle lambdas # optional - sage.geometry.polyhedron
sage: TestSuite(P_inter_B_again).run() # optional - sage.geometry.polyhedron, sage.symbolic
sage: TestSuite(P_inter_B_again).run() # optional - sage.geometry.polyhedron sage.symbolic
"""
@staticmethod
def __classcall_private__(cls, universe, *predicates, vars=None, names=None, category=None):
Expand Down
2 changes: 1 addition & 1 deletion src/sage/sets/non_negative_integers.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def __contains__(self, elt):
False
sage: None in NN
False
sage: QQbar(sqrt(2)) in NN # optional - sage.symbolic, sage.rings.number_field
sage: QQbar(sqrt(2)) in NN # optional - sage.symbolic sage.rings.number_field
False
sage: RIF(1,2) in NN
False
Expand Down

0 comments on commit 7e89a0d

Please sign in to comment.