ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Sun, 23 Oct 2022 02:15:27 +0200Smith Normal Formhttps://ask.sagemath.org/question/64575/smith-normal-form/After executing the following for computing the snf (or Smith
normal form) of a matrix I got two different results.
In the second case I expected to get integer
transformation matrices.
The code below can be [run in sagecell](https://tinyurl.com/wpxn7hmb).
sage: B = matrix([[1143, 2361, -1995, 2694],
[-342, -704, 595, -806],
[-454, -936, 791, -1070],
[-521, -1077, 910, -1228]])
sage: C = matrix(QQ, [[1143, 2361, -1995, 2694],
[-342, -704, 595, -806],
[-454, -936, 791, -1070],
[-521, -1077, 910, -1228]])
sage: print(type(C), "\n", type(B))
<class 'sage.matrix.matrix_rational_dense.Matrix_rational_dense'>
<class 'sage.matrix.matrix_integer_dense.Matrix_integer_dense'>
sage: print(C == B)
True
sage: show(B.smith_form())
([1 0 0 0] [ 0 1 0 0]
[0 1 0 0] [-5 -1 -3 -8]
[0 0 0 0] [19 3 10 31]
[0 0 0 0], [ 7 0 5 11],
[ 0 0 1 0]
[ 4505 -53 1549031 112]
[ 5715 -60 1963950 142]
[ 284 2 96814 7])
sage: show(C.smith_form())
([1 0 0 0] [ 1/1143 0 0 0]
[0 1 0 0] [ 19/155 127/310 0 0]
[0 0 0 0] [ 8/45 -11/15 1 0]
[0 0 0 0], [ 5/9 1/3 0 1],
[ 1 -787/381 7/62 -71/31]
[ 0 1 49/62 -1/31]
[ 0 0 1 0]
[ 0 0 0 1])drazSun, 23 Oct 2022 02:15:27 +0200https://ask.sagemath.org/question/64575/Finding generators of subgroups of free abelian groups.https://ask.sagemath.org/question/61497/finding-generators-of-subgroups-of-free-abelian-groups/Let $N$ be a finitely generated abelian group. Let $M$ be a subgroup of $N$ with the same rank as that of $N$. Given an $\mathbb{Z}$-basis $v_1,\ldots,v_m$ of $M$ and an element $v\in N$, find a basis of the group generated by $v_1,\ldots,v_m,v$.
I am fairly certain that doing so is possible, but I cannot come up with an effective algorithm. Does anyone have code that is similar to this?GalvanizedPlutoniumMon, 14 Mar 2022 11:56:34 +0100https://ask.sagemath.org/question/61497/Elementary divisors of a matrixhttps://ask.sagemath.org/question/42485/elementary-divisors-of-a-matrix/Hi,
I need to compute elementary divisors of a matrix (xI-A), where A is a matrix defined over GF(2). So, i try to define a univariate polynomial ring (R) over GF(2) and compute the elementary divisors of (xI-A) using the elementary_divisors() procedure. But as the size of the matrix increases, the algorithm is too slow. My matrices are of dimension 100.
Can anyone suggest an alternative approach to solve the problem. RamachandranSun, 03 Jun 2018 18:56:18 +0200https://ask.sagemath.org/question/42485/how to get the smith normal form of lambda matrixhttps://ask.sagemath.org/question/34464/how-to-get-the-smith-normal-form-of-lambda-matrix/ Hi:
Right now, I know sage matrix can get the smith_form and elementary_divisors on pure integer matrix. But I want to get the same stuff on lambda matrix. What I actually mean is:
www.solitaryroad.com/c153.html (my karma is not enough to put a direct link)
I directly construct a matrix and the minus lambda times identity matrix and call smith_form is not working. So how to get the smith normal form of lambda matrix in sagemath? Or if sagemath can not do that, which computer algebra system can do the job?cguoSat, 13 Aug 2016 23:53:00 +0200https://ask.sagemath.org/question/34464/