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.Thu, 30 Mar 2017 17:31:43 +0200How to find solution to the following matrixhttps://ask.sagemath.org/question/37042/how-to-find-solution-to-the-following-matrix/[ a a + 1]
[ a^2 a^2 + a]
Following is the code which tries to find solution to the 2X2 matrix A in field GF(2^4,'a'). I am trying to find solution(vector) x such that Ax=O; where O is a zero vector. The rank of A is 1 and still I am getting trivial solution(zero vector). How to find non-trivial solution of the above matrix
sage: F.<a>=GF(2^4);
sage: A=Matrix(GF(2^4,'a'),[[a,a^4],[a^2,a^5]]);
sage: b=vector(GF(2^4,'a'),2)
sage: A.rank()
sage: A.solve_right(b)
(0, 0)Thu, 23 Mar 2017 06:42:12 +0100https://ask.sagemath.org/question/37042/how-to-find-solution-to-the-following-matrix/Answer by tmonteil for <p>[ a a + 1]
[ a^2 a^2 + a]</p>
<p>Following is the code which tries to find solution to the 2X2 matrix A in field GF(2^4,'a'). I am trying to find solution(vector) x such that Ax=O; where O is a zero vector. The rank of A is 1 and still I am getting trivial solution(zero vector). How to find non-trivial solution of the above matrix </p>
<pre><code>sage: F.<a>=GF(2^4);
sage: A=Matrix(GF(2^4,'a'),[[a,a^4],[a^2,a^5]]);
sage: b=vector(GF(2^4,'a'),2)
sage: A.rank()
sage: A.solve_right(b)
(0, 0)
</code></pre>
https://ask.sagemath.org/question/37042/how-to-find-solution-to-the-following-matrix/?answer=37047#post-id-37047The `solve_right` method only gives you one solution (and is mainly used for affine equations, where `b` is nonzero). The set of solutions is the (right) kernel of your matrix:
sage: A.right_kernel()
Vector space of degree 2 and dimension 1 over Finite Field in a of size 2^4
Basis matrix:
[ 1 a^3 + a^2 + a + 1]
sage: A.right_kernel().basis()[0]
(1, a^3 + a^2 + a + 1)
sage: A*A.right_kernel().basis()[0]
(0, 0)Thu, 23 Mar 2017 16:03:55 +0100https://ask.sagemath.org/question/37042/how-to-find-solution-to-the-following-matrix/?answer=37047#post-id-37047Comment by kaassama for <p>The <code>solve_right</code> method only gives you one solution (and is mainly used for affine equations, where <code>b</code> is nonzero). The set of solutions is the (right) kernel of your matrix:</p>
<pre><code>sage: A.right_kernel()
Vector space of degree 2 and dimension 1 over Finite Field in a of size 2^4
Basis matrix:
[ 1 a^3 + a^2 + a + 1]
sage: A.right_kernel().basis()[0]
(1, a^3 + a^2 + a + 1)
sage: A*A.right_kernel().basis()[0]
(0, 0)
</code></pre>
https://ask.sagemath.org/question/37042/how-to-find-solution-to-the-following-matrix/?comment=37133#post-id-37133That's a pretty good explaination.Thu, 30 Mar 2017 17:31:43 +0200https://ask.sagemath.org/question/37042/how-to-find-solution-to-the-following-matrix/?comment=37133#post-id-37133