ASKSAGE: Sage Q&A Forum - Individual question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Thu, 27 Jul 2017 01:13:06 -0500Check if a finitely generated matrix group is finite (works with QQ and not with CC)http://ask.sagemath.org/question/38403/check-if-a-finitely-generated-matrix-group-is-finite-works-with-qq-and-not-with-cc/Dear all, I am a newbie in sage. I would like to check if a finitely generated matrix group is finite. Before to proceed with the calculation on my actual problem (where matrices have complex entries), I have tried a very simple example. Consider the group generated by the matrices [1,0,0,1] and [0,1,1,0], this group is clearly finite. Can somebody explain me why the following code works:
sage: MS = MatrixSpace(QQ, 2, 2)
sage: G = MatrixGroup([MS([1,0,0,1]),MS([0,1,1,0])])
sage: G.is_finite()
True
but if I change the field QQ -> RR (or CC), an error is generated:
sage: MS = MatrixSpace(RR, 2, 2)
sage: G = MatrixGroup([MS([1,0,0,1]),MS([0,1,1,0])])
sage: G.is_finite()
---------------------------------------------------------------------------
NotImplementedError Traceback (most recent call last)
<ipython-input-215-0022a668c150> in <module>()
----> 1 G.is_finite()
/Applications/SageMath-7.6.app/Contents/Resources/sage/src/sage/groups/group.pyx in sage.groups.group.Group.is_finite (/Applications/SageMath-7.6.app/Contents/Resources/sage/src/build/cythonized/sage/groups/group.c:2696)()
179 NotImplementedError
180 """
--> 181 return self.order() != infinity
182
183 def is_multiplicative(self):
/Applications/SageMath-7.6.app/Contents/Resources/sage/src/sage/groups/group.pyx in sage.groups.group.Group.order (/Applications/SageMath-7.6.app/Contents/Resources/sage/src/build/cythonized/sage/groups/group.c:2623)()
164 NotImplementedError
165 """
--> 166 raise NotImplementedError
167
168 def is_finite(self):
NotImplementedError:
Is there any way to force the second piece of code to work with matrices with entries in CC?
Thank you in advance.Tue, 25 Jul 2017 10:22:22 -0500http://ask.sagemath.org/question/38403/check-if-a-finitely-generated-matrix-group-is-finite-works-with-qq-and-not-with-cc/Comment by FrédéricC for <p>Dear all, I am a newbie in sage. I would like to check if a finitely generated matrix group is finite. Before to proceed with the calculation on my actual problem (where matrices have complex entries), I have tried a very simple example. Consider the group generated by the matrices [1,0,0,1] and [0,1,1,0], this group is clearly finite. Can somebody explain me why the following code works:</p>
<pre><code>sage: MS = MatrixSpace(QQ, 2, 2)
sage: G = MatrixGroup([MS([1,0,0,1]),MS([0,1,1,0])])
sage: G.is_finite()
True
</code></pre>
<p>but if I change the field QQ -> RR (or CC), an error is generated:</p>
<pre><code>sage: MS = MatrixSpace(RR, 2, 2)
sage: G = MatrixGroup([MS([1,0,0,1]),MS([0,1,1,0])])
sage: G.is_finite()
---------------------------------------------------------------------------
NotImplementedError Traceback (most recent call last)
<ipython-input-215-0022a668c150> in <module>()
----> 1 G.is_finite()
/Applications/SageMath-7.6.app/Contents/Resources/sage/src/sage/groups/group.pyx in sage.groups.group.Group.is_finite (/Applications/SageMath-7.6.app/Contents/Resources/sage/src/build/cythonized/sage/groups/group.c:2696)()
179 NotImplementedError
180 """
--> 181 return self.order() != infinity
182
183 def is_multiplicative(self):
/Applications/SageMath-7.6.app/Contents/Resources/sage/src/sage/groups/group.pyx in sage.groups.group.Group.order (/Applications/SageMath-7.6.app/Contents/Resources/sage/src/build/cythonized/sage/groups/group.c:2623)()
164 NotImplementedError
165 """
--> 166 raise NotImplementedError
167
168 def is_finite(self):
NotImplementedError:
</code></pre>
<p>Is there any way to force the second piece of code to work with matrices with entries in CC?</p>
<p>Thank you in advance.</p>
http://ask.sagemath.org/question/38403/check-if-a-finitely-generated-matrix-group-is-finite-works-with-qq-and-not-with-cc/?comment=38412#post-id-38412Use an exact ring, such as QQbar or AA or UniversalCyclotomicField instead of CC.Thu, 27 Jul 2017 01:13:06 -0500http://ask.sagemath.org/question/38403/check-if-a-finitely-generated-matrix-group-is-finite-works-with-qq-and-not-with-cc/?comment=38412#post-id-38412Comment by dan_fulea for <p>Dear all, I am a newbie in sage. I would like to check if a finitely generated matrix group is finite. Before to proceed with the calculation on my actual problem (where matrices have complex entries), I have tried a very simple example. Consider the group generated by the matrices [1,0,0,1] and [0,1,1,0], this group is clearly finite. Can somebody explain me why the following code works:</p>
<pre><code>sage: MS = MatrixSpace(QQ, 2, 2)
sage: G = MatrixGroup([MS([1,0,0,1]),MS([0,1,1,0])])
sage: G.is_finite()
True
</code></pre>
<p>but if I change the field QQ -> RR (or CC), an error is generated:</p>
<pre><code>sage: MS = MatrixSpace(RR, 2, 2)
sage: G = MatrixGroup([MS([1,0,0,1]),MS([0,1,1,0])])
sage: G.is_finite()
---------------------------------------------------------------------------
NotImplementedError Traceback (most recent call last)
<ipython-input-215-0022a668c150> in <module>()
----> 1 G.is_finite()
/Applications/SageMath-7.6.app/Contents/Resources/sage/src/sage/groups/group.pyx in sage.groups.group.Group.is_finite (/Applications/SageMath-7.6.app/Contents/Resources/sage/src/build/cythonized/sage/groups/group.c:2696)()
179 NotImplementedError
180 """
--> 181 return self.order() != infinity
182
183 def is_multiplicative(self):
/Applications/SageMath-7.6.app/Contents/Resources/sage/src/sage/groups/group.pyx in sage.groups.group.Group.order (/Applications/SageMath-7.6.app/Contents/Resources/sage/src/build/cythonized/sage/groups/group.c:2623)()
164 NotImplementedError
165 """
--> 166 raise NotImplementedError
167
168 def is_finite(self):
NotImplementedError:
</code></pre>
<p>Is there any way to force the second piece of code to work with matrices with entries in CC?</p>
<p>Thank you in advance.</p>
http://ask.sagemath.org/question/38403/check-if-a-finitely-generated-matrix-group-is-finite-works-with-qq-and-not-with-cc/?comment=38405#post-id-38405In the first case we can also compute the order, and the list of elements.
In the second case, we use non-exact objects. (Why do we do this!?) Then i expect humanly that there is no multiplicative order method implemented for such a numerical matrix, being really glad that there is no one! Why should we work with inexact entries in a **finite** matrix group?
Note that we run into a `NotImplementedError: multiplicative order is only implemented for matrices over finite fields` in both following cases...
g = matrix( RR, 2, 2, [ sqrt(3)/2.0, 0.5, 0.5, sqrt(3)/2.0 ] )
g.multiplicative_order() # --> NotImplementedError
# and
sage: K.<a> = QuadraticField(3)
sage: g = matrix(K, 2,2, [a/2,1/2,-1/2,a/2] )
sage: g^12
[1 0]
[0 1]
sage: g.multiplicative_order() # --> NotImplementedErrorTue, 25 Jul 2017 13:32:20 -0500http://ask.sagemath.org/question/38403/check-if-a-finitely-generated-matrix-group-is-finite-works-with-qq-and-not-with-cc/?comment=38405#post-id-38405Answer by nbruin for <p>Dear all, I am a newbie in sage. I would like to check if a finitely generated matrix group is finite. Before to proceed with the calculation on my actual problem (where matrices have complex entries), I have tried a very simple example. Consider the group generated by the matrices [1,0,0,1] and [0,1,1,0], this group is clearly finite. Can somebody explain me why the following code works:</p>
<pre><code>sage: MS = MatrixSpace(QQ, 2, 2)
sage: G = MatrixGroup([MS([1,0,0,1]),MS([0,1,1,0])])
sage: G.is_finite()
True
</code></pre>
<p>but if I change the field QQ -> RR (or CC), an error is generated:</p>
<pre><code>sage: MS = MatrixSpace(RR, 2, 2)
sage: G = MatrixGroup([MS([1,0,0,1]),MS([0,1,1,0])])
sage: G.is_finite()
---------------------------------------------------------------------------
NotImplementedError Traceback (most recent call last)
<ipython-input-215-0022a668c150> in <module>()
----> 1 G.is_finite()
/Applications/SageMath-7.6.app/Contents/Resources/sage/src/sage/groups/group.pyx in sage.groups.group.Group.is_finite (/Applications/SageMath-7.6.app/Contents/Resources/sage/src/build/cythonized/sage/groups/group.c:2696)()
179 NotImplementedError
180 """
--> 181 return self.order() != infinity
182
183 def is_multiplicative(self):
/Applications/SageMath-7.6.app/Contents/Resources/sage/src/sage/groups/group.pyx in sage.groups.group.Group.order (/Applications/SageMath-7.6.app/Contents/Resources/sage/src/build/cythonized/sage/groups/group.c:2623)()
164 NotImplementedError
165 """
--> 166 raise NotImplementedError
167
168 def is_finite(self):
NotImplementedError:
</code></pre>
<p>Is there any way to force the second piece of code to work with matrices with entries in CC?</p>
<p>Thank you in advance.</p>
http://ask.sagemath.org/question/38403/check-if-a-finitely-generated-matrix-group-is-finite-works-with-qq-and-not-with-cc/?answer=38411#post-id-38411The problem is that a matrix (in characteristic 0, at least) has finite order if and only if it's diagonalizable and has roots of unity for eigenvalues. The latter is certainly not preserved under numerical pertubations, so cannot be determined for matrices with floating point entries.Wed, 26 Jul 2017 15:14:51 -0500http://ask.sagemath.org/question/38403/check-if-a-finitely-generated-matrix-group-is-finite-works-with-qq-and-not-with-cc/?answer=38411#post-id-38411