@@ -1926,11 +1926,12 @@ cdef class Matrix(sage.structure.element.Matrix):
1926
1926
1927
1927
Prior to :trac:`11544` this could take a full minute to run ( 2011) . ::
1928
1928
1929
+ sage: # needs sage. rings. number_field
1929
1930
sage: A = matrix( QQ, 4, 4, [1, 2, -2, 2, 1, 0, -1, -1, 0, -1, 1, 1, -1, 2, 1/2, 0 ])
1930
- sage: e = A. eigenvalues( ) [3 ] # needs sage . rings . number_field
1931
- sage: K = ( A - e) . kernel( ) # needs sage . rings . number_field
1932
- sage: P = K. basis_matrix( ) # needs sage . rings . number_field
1933
- sage: P. str( ) # needs sage . rings . number_field
1931
+ sage: e = A. eigenvalues( ) [3 ]
1932
+ sage: K = ( A - e) . kernel( )
1933
+ sage: P = K. basis_matrix( )
1934
+ sage: P. str( )
1934
1935
'[ 1.000000000000000? + 0.?e-17*I -2.116651487479748? + 0.0255565807096352?*I -0.2585224251020429? + 0.2886023409047535?*I -0.4847545623533090? - 1.871890760086142?*I ]'
1935
1936
1936
1937
Use single-row delimiters where appropriate::
@@ -2946,7 +2947,7 @@ cdef class Matrix(sage.structure.element.Matrix):
2946
2947
Traceback (most recent call last):
2947
2948
...
2948
2949
TypeError: Multiplying row by Symbolic Ring element cannot be done over
2949
- Rational Field, use change_ring or with_added_multiple_of_row instead.
2950
+ Rational Field, use change_ring or with_added_multiple_of_row instead.
2950
2951
"""
2951
2952
self .check_row_bounds_and_mutability(i,j)
2952
2953
try :
@@ -3031,7 +3032,7 @@ cdef class Matrix(sage.structure.element.Matrix):
3031
3032
Traceback (most recent call last):
3032
3033
...
3033
3034
TypeError: Multiplying column by Symbolic Ring element cannot be done over
3034
- Rational Field, use change_ring or with_added_multiple_of_column instead.
3035
+ Rational Field, use change_ring or with_added_multiple_of_column instead.
3035
3036
"""
3036
3037
self .check_column_bounds_and_mutability(i,j)
3037
3038
try :
@@ -3135,7 +3136,8 @@ cdef class Matrix(sage.structure.element.Matrix):
3135
3136
sage: a.rescale_row(1,1/2)
3136
3137
Traceback (most recent call last):
3137
3138
...
3138
- TypeError: Rescaling row by Rational Field element cannot be done over Integer Ring, use change_ring or with_rescaled_row instead.
3139
+ TypeError: Rescaling row by Rational Field element cannot be done
3140
+ over Integer Ring, use change_ring or with_rescaled_row instead.
3139
3141
3140
3142
To rescale the matrix by 1/2, you must change the base ring to the
3141
3143
rationals::
@@ -3249,7 +3251,8 @@ cdef class Matrix(sage.structure.element.Matrix):
3249
3251
sage: a.rescale_col(2,1/2)
3250
3252
Traceback (most recent call last):
3251
3253
...
3252
- TypeError: Rescaling column by Rational Field element cannot be done over Integer Ring, use change_ring or with_rescaled_col instead.
3254
+ TypeError: Rescaling column by Rational Field element cannot be done
3255
+ over Integer Ring, use change_ring or with_rescaled_col instead.
3253
3256
3254
3257
To rescale the matrix by 1/2, you must change the base ring to the
3255
3258
rationals::
@@ -3940,21 +3943,21 @@ cdef class Matrix(sage.structure.element.Matrix):
3940
3943
3941
3944
def is_symmetric (self ):
3942
3945
"""
3943
- Return True if this is a symmetric matrix.
3946
+ Return `` True`` if this is a symmetric matrix.
3944
3947
3945
3948
A symmetric matrix is necessarily square.
3946
3949
3947
3950
EXAMPLES::
3948
3951
3949
- sage: m= Matrix(QQ,2, range(0,4))
3952
+ sage: m = Matrix(QQ, 2, range(0,4))
3950
3953
sage: m.is_symmetric()
3951
3954
False
3952
3955
3953
- sage: m= Matrix(QQ,2, (1,1,1,1,1,1))
3956
+ sage: m = Matrix(QQ, 2, (1,1,1,1,1,1))
3954
3957
sage: m.is_symmetric()
3955
3958
False
3956
3959
3957
- sage: m= Matrix(QQ,1, (2,))
3960
+ sage: m = Matrix(QQ, 1, (2,))
3958
3961
sage: m.is_symmetric()
3959
3962
True
3960
3963
@@ -4901,7 +4904,7 @@ cdef class Matrix(sage.structure.element.Matrix):
4901
4904
Over finite fields::
4902
4905
4903
4906
sage: A = matrix( GF( 59) , 3, [10,56,39,53,56,33,58,24,55 ])
4904
- sage: A. multiplicative_order( ) # needs sage. rings . finite_rings
4907
+ sage: A. multiplicative_order( ) # needs sage. groups
4905
4908
580
4906
4909
sage: ( A^ 580) . is_one( )
4907
4910
True
@@ -5243,7 +5246,7 @@ cdef class Matrix(sage.structure.element.Matrix):
5243
5246
sage: R.<x,y> = FreeAlgebra(QQ,2)
5244
5247
sage: a = matrix(2, 2, [1,2,x*y,y*x])
5245
5248
sage: b = matrix(2, 2, [1,2,y*x,y*x])
5246
- sage: a - b # indirect doctest
5249
+ sage: a - b # indirect doctest
5247
5250
[ 0 0]
5248
5251
[x*y - y*x 0]
5249
5252
@@ -5316,11 +5319,12 @@ cdef class Matrix(sage.structure.element.Matrix):
5316
5319
[ x*y x^2*y x*y^2]
5317
5320
[ -x^2*y^2 x^2*y + x*y^2 x^2*y - x*y^2]
5318
5321
5319
- sage: R.<x,y> = FreeAlgebra(ZZ,2) # needs sage.combinat
5322
+ sage: # needs sage.combinat
5323
+ sage: R.<x,y> = FreeAlgebra(ZZ,2)
5320
5324
sage: a = matrix(R, 2, 3, [1,x,y, -x*y,x+y,x-y]); a
5321
5325
[ 1 x y]
5322
5326
[ -x*y x + y x - y]
5323
- sage: (x*y) * a # indirect doctest # needs sage.combinat
5327
+ sage: (x*y) * a # indirect doctest
5324
5328
[ x*y x*y*x x*y^2]
5325
5329
[ -x*y*x*y x*y*x + x*y^2 x*y*x - x*y^2]
5326
5330
"""
@@ -5361,11 +5365,12 @@ cdef class Matrix(sage.structure.element.Matrix):
5361
5365
[ x*y y^2]
5362
5366
[x^2*y y^3]
5363
5367
5364
- sage: R.<x,y> = FreeAlgebra(ZZ,2) # needs sage.combinat
5365
- sage: a = matrix(R, 2, 3, [1,x,y, -x*y,x+y,x-y]); a # needs sage.combinat
5368
+ sage: # needs sage.combinat
5369
+ sage: R.<x,y> = FreeAlgebra(ZZ,2)
5370
+ sage: a = matrix(R, 2, 3, [1,x,y, -x*y,x+y,x-y]); a
5366
5371
[ 1 x y]
5367
5372
[ -x*y x + y x - y]
5368
- sage: a * (x*y) # needs sage.combinat
5373
+ sage: a * (x*y)
5369
5374
[ x*y x^2*y y*x*y]
5370
5375
[ -x*y*x*y x^2*y + y*x*y x^2*y - y*x*y]
5371
5376
"""
@@ -5396,10 +5401,10 @@ cdef class Matrix(sage.structure.element.Matrix):
5396
5401
[ 1 -x*y ]
5397
5402
[ x x + y ]
5398
5403
[ y x - y ]
5399
- sage: a* b # indirect doctest
5404
+ sage: a* b # indirect doctest
5400
5405
[ x^2 + y^2 + 1 x^2 + x*y - y^2 ]
5401
5406
[ x^2 + x*y - y^2 x^2*y^2 + 2*x^2 + 2*y^2 ]
5402
- sage: b* a # indirect doctest
5407
+ sage: b* a # indirect doctest
5403
5408
[ x^2*y^2 + 1 -x^2*y - x*y^2 + x -x^2*y + x*y^2 + y ]
5404
5409
[ -x^2*y - x*y^2 + x 2*x^2 + 2*x*y + y^2 x^2 + x*y - y^2 ]
5405
5410
[ -x^2*y + x*y^2 + y x^2 + x*y - y^2 x^2 - 2*x*y + 2*y^2 ]
@@ -5487,7 +5492,9 @@ cdef class Matrix(sage.structure.element.Matrix):
5487
5492
sage: a* v
5488
5493
Traceback ( most recent call last) :
5489
5494
...
5490
- TypeError: unsupported operand parent( s) for * : 'Full MatrixSpace of 2 by 3 dense matrices over Integer Ring' and 'Ambient free module of rank 2 over the principal ideal domain Integer Ring'
5495
+ TypeError: unsupported operand parent( s) for * :
5496
+ 'Full MatrixSpace of 2 by 3 dense matrices over Integer Ring' and
5497
+ 'Ambient free module of rank 2 over the principal ideal domain Integer Ring'
5491
5498
5492
5499
This illustrates how coercion works::
5493
5500
@@ -5672,8 +5679,9 @@ cdef class Matrix(sage.structure.element.Matrix):
5672
5679
5673
5680
Matrices over p-adics. See :trac:`17272` ::
5674
5681
5675
- sage: R = ZpCA( 5, 5, print_mode='val-unit') # needs sage. rings. padics
5676
- sage: A = matrix( R, 3, 3, [250,2369,1147,106,927,362,90,398,2483 ]) # needs sage. rings. padics
5682
+ sage: # needs sage. rings. padics
5683
+ sage: R = ZpCA( 5, 5, print_mode='val-unit')
5684
+ sage: A = matrix( R, 3, 3, [250,2369,1147,106,927,362,90,398,2483 ])
5677
5685
sage: A
5678
5686
[5^3 * 2 + O(5^5) 2369 + O(5^5) 1147 + O(5^5) ]
5679
5687
[ 106 + O(5^5) 927 + O(5^5) 362 + O(5^5) ]
0 commit comments