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.Fri, 26 Oct 2018 19:41:11 +0200Creating a matrix that has elements part of a GFhttps://ask.sagemath.org/question/44081/creating-a-matrix-that-has-elements-part-of-a-gf/I am currently doing some implementation but I have something that I do not seem to find online and bugged me for a few hours:
e = 48;
K = GF(2^e);
KE = GF(2^(e*2));
A = matrix(KE,3,3);
E11 = 24;
E12 = 59;
E21 = 21;
E23 = 28;
E32 = 29;
E33 = 65;
A[0,0] = 2^E11;
A[0,1] = 2^E12;
A[0,2] = 0;
A[1,0] = 2^E21;
A[1,1] = 0;
A[1,2] = 2^E23;
A[2,0] = 0;
A[2,1] = 2^E32;
A[2,2] = 2^E33;
print A[2][1]
When I do this, it print 0, but given that I created it in GF(2^(e*2)), I believe it shouldn't. Because of this, when I try to get the inverse of this matrix, which is invertible, I do not get anything. Please let me know if you have any thoughts.Fri, 26 Oct 2018 16:38:11 +0200https://ask.sagemath.org/question/44081/creating-a-matrix-that-has-elements-part-of-a-gf/Answer by tmonteil for <p>I am currently doing some implementation but I have something that I do not seem to find online and bugged me for a few hours:</p>
<pre><code>e = 48;
K = GF(2^e);
KE = GF(2^(e*2));
A = matrix(KE,3,3);
E11 = 24;
E12 = 59;
E21 = 21;
E23 = 28;
E32 = 29;
E33 = 65;
A[0,0] = 2^E11;
A[0,1] = 2^E12;
A[0,2] = 0;
A[1,0] = 2^E21;
A[1,1] = 0;
A[1,2] = 2^E23;
A[2,0] = 0;
A[2,1] = 2^E32;
A[2,2] = 2^E33;
print A[2][1]
</code></pre>
<p>When I do this, it print 0, but given that I created it in GF(2^(e*2)), I believe it shouldn't. Because of this, when I try to get the inverse of this matrix, which is invertible, I do not get anything. Please let me know if you have any thoughts.</p>
https://ask.sagemath.org/question/44081/creating-a-matrix-that-has-elements-part-of-a-gf/?answer=44083#post-id-44083The field `KE = GF(2^(e*2))` has characteristic 2, hence every even number (in particular every nontrivial power of 2) will be equal to zero, which is what you got.
Fri, 26 Oct 2018 17:39:15 +0200https://ask.sagemath.org/question/44081/creating-a-matrix-that-has-elements-part-of-a-gf/?answer=44083#post-id-44083Answer by rburing for <p>I am currently doing some implementation but I have something that I do not seem to find online and bugged me for a few hours:</p>
<pre><code>e = 48;
K = GF(2^e);
KE = GF(2^(e*2));
A = matrix(KE,3,3);
E11 = 24;
E12 = 59;
E21 = 21;
E23 = 28;
E32 = 29;
E33 = 65;
A[0,0] = 2^E11;
A[0,1] = 2^E12;
A[0,2] = 0;
A[1,0] = 2^E21;
A[1,1] = 0;
A[1,2] = 2^E23;
A[2,0] = 0;
A[2,1] = 2^E32;
A[2,2] = 2^E33;
print A[2][1]
</code></pre>
<p>When I do this, it print 0, but given that I created it in GF(2^(e*2)), I believe it shouldn't. Because of this, when I try to get the inverse of this matrix, which is invertible, I do not get anything. Please let me know if you have any thoughts.</p>
https://ask.sagemath.org/question/44081/creating-a-matrix-that-has-elements-part-of-a-gf/?answer=44085#post-id-44085Did you mean to use the ring `Zmod(2^(e*2))` (the integers modulo $2^{2e}$) instead of `GF(2^(e*2))` (the finite field of order $2^{2e}$)? They are different things. The matrix is also not invertible over this ring, however.
It can only be invertible in a ring where the determinant over $\mathbb{Z}$,
-1 * 2^81 * 274177 * 67280421310721
is invertible, e.g. modulo primes which do not divide this number.Fri, 26 Oct 2018 19:41:11 +0200https://ask.sagemath.org/question/44081/creating-a-matrix-that-has-elements-part-of-a-gf/?answer=44085#post-id-44085