File tree Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Original file line number Diff line number Diff line change @@ -4362,6 +4362,44 @@ cdef class Matrix_polynomial_dense(Matrix_generic_dense):
4362
4362
[ 0 1 0 0 ]
4363
4363
[ 0 0 x + 3 0 ]
4364
4364
4365
+ Here are a few more examples, similar to the above but over fields
4366
+ other than ``GF( 7) ``::
4367
+
4368
+ sage: ring. <x> = QQ[]
4369
+ sage: mat = matrix( [[x*(x-1)*(x-2), (x-2)*(x-3)*(x-4), (x-4)*(x-5)*(x-6) ]])
4370
+ sage: mat
4371
+ [ x^3 - 3*x^2 + 2*x x^3 - 9*x^2 + 26*x - 24 x^3 - 15*x^2 + 74*x - 120 ]
4372
+ sage: rcomp = mat. basis_completion( algorithm="smith") ; rcomp
4373
+ [ -1/12*x - 1/12 -1/12*x + 5/12 0 ]
4374
+ [ 1/12 1/12 1/24*x^2 - 13/24*x + 2 ]
4375
+ sage: mat. stack( rcomp) . determinant( )
4376
+ 1
4377
+
4378
+ sage: mat = matrix( [[x*(x-1), x*(x-2) ], \
4379
+ [x*(x-2), x*(x-3) ], \
4380
+ [(x-1)*(x-2), (x-1)*(x-3) ]])
4381
+ sage: mat. smith_form( transformation=False)
4382
+ [1 0 ]
4383
+ [0 x ]
4384
+ [0 0 ]
4385
+ sage: ccomp = mat. basis_completion( row_wise=False, algorithm="smith")
4386
+ sage: ccomp
4387
+ [1/2*x - 1/2 ]
4388
+ [ 1/2*x - 1 ]
4389
+ [1/2*x - 3/2 ]
4390
+ sage: ccomp. augment( mat) . smith_form( transformation=False)
4391
+ [ 1 0 0 ]
4392
+ [ 0 1 0 ]
4393
+ [ 0 0 1/2*x ]
4394
+
4395
+ sage: ring. <y> = NumberField( x** 2 - 2, "a") []
4396
+ sage: a = ring. base_ring( ) . gen( )
4397
+ sage: mat = matrix( [[3*a*y - 1, (-8*a - 1)*y - 2*a + 1 ]])
4398
+ sage: rcomp = mat. basis_completion( algorithm="smith") ; rcomp
4399
+ [ 39/119*a - 30/119 -99/119*a + 67/119 ]
4400
+ sage: mat. stack( rcomp) . determinant( )
4401
+ 1
4402
+
4365
4403
TESTS:
4366
4404
4367
4405
Corner cases are handled correctly::
You can’t perform that action at this time.
0 commit comments