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.Tue, 15 Feb 2011 10:05:30 -0600Badly formatted Cayley Tablehttp://ask.sagemath.org/question/7945/badly-formatted-cayley-table/Hi,
I am completely new to Sage. To test the visualization of a subgroup of SL(2)a, I entered the following code:
G=SL(2,ZZ)
identity = matrix(ZZ, [[1,0], [0,1]])
G.cayley_table(names='elements',elements=[identity, -identity])
which outputs
* [1 0]
[0 1] [-1 0]
[ 0 -1]
+--------------------------------
[1 0]
[0 1]| [1 0]
[0 1] [-1 0]
[ 0 -1]
[-1 0]
[ 0 -1]| [-1 0]
[ 0 -1] [1 0]
[0 1]
Am I missing something to get a correctly displayed result ?
Thanks !Tue, 15 Feb 2011 08:23:02 -0600http://ask.sagemath.org/question/7945/badly-formatted-cayley-table/Comment by John Palmieri for <p>Hi,</p>
<p>I am completely new to Sage. To test the visualization of a subgroup of SL(2)a, I entered the following code:</p>
<pre><code>G=SL(2,ZZ)
identity = matrix(ZZ, [[1,0], [0,1]])
G.cayley_table(names='elements',elements=[identity, -identity])
</code></pre>
<p>which outputs</p>
<pre><code> * [1 0]
[0 1] [-1 0]
[ 0 -1]
+--------------------------------
[1 0]
[0 1]| [1 0]
[0 1] [-1 0]
[ 0 -1]
[-1 0]
[ 0 -1]| [-1 0]
[ 0 -1] [1 0]
[0 1]
</code></pre>
<p>Am I missing something to get a correctly displayed result ?</p>
<p>Thanks !</p>
http://ask.sagemath.org/question/7945/badly-formatted-cayley-table/?comment=22118#post-id-22118I'm not sure that Cayley tables work well when the string representations of elements have multiple lines. I'm reporting it as a bug: see http://trac.sagemath.org/sage_trac/ticket/10787.Tue, 15 Feb 2011 09:31:45 -0600http://ask.sagemath.org/question/7945/badly-formatted-cayley-table/?comment=22118#post-id-22118Answer by kcrisman for <p>Hi,</p>
<p>I am completely new to Sage. To test the visualization of a subgroup of SL(2)a, I entered the following code:</p>
<pre><code>G=SL(2,ZZ)
identity = matrix(ZZ, [[1,0], [0,1]])
G.cayley_table(names='elements',elements=[identity, -identity])
</code></pre>
<p>which outputs</p>
<pre><code> * [1 0]
[0 1] [-1 0]
[ 0 -1]
+--------------------------------
[1 0]
[0 1]| [1 0]
[0 1] [-1 0]
[ 0 -1]
[-1 0]
[ 0 -1]| [-1 0]
[ 0 -1] [1 0]
[0 1]
</code></pre>
<p>Am I missing something to get a correctly displayed result ?</p>
<p>Thanks !</p>
http://ask.sagemath.org/question/7945/badly-formatted-cayley-table/?answer=12105#post-id-12105I think you are right that Cayley tables aren't set up for members of matrix groups very well. I've made this [Trac 10786](http://trac.sagemath.org/sage_trac/ticket/10786) and cc:ed someone I know cares a lot about Cayley tables. I'm not sure whether the fix would be completely easy, though.Tue, 15 Feb 2011 09:26:41 -0600http://ask.sagemath.org/question/7945/badly-formatted-cayley-table/?answer=12105#post-id-12105Comment by John Palmieri for <p>I think you are right that Cayley tables aren't set up for members of matrix groups very well. I've made this <a href="http://trac.sagemath.org/sage_trac/ticket/10786">Trac 10786</a> and cc:ed someone I know cares a lot about Cayley tables. I'm not sure whether the fix would be completely easy, though.</p>
http://ask.sagemath.org/question/7945/badly-formatted-cayley-table/?comment=22117#post-id-22117@kcrisman: Sorry, I didn't see your answer when I posted my comment above...Tue, 15 Feb 2011 09:39:32 -0600http://ask.sagemath.org/question/7945/badly-formatted-cayley-table/?comment=22117#post-id-22117Answer by John Palmieri for <p>Hi,</p>
<p>I am completely new to Sage. To test the visualization of a subgroup of SL(2)a, I entered the following code:</p>
<pre><code>G=SL(2,ZZ)
identity = matrix(ZZ, [[1,0], [0,1]])
G.cayley_table(names='elements',elements=[identity, -identity])
</code></pre>
<p>which outputs</p>
<pre><code> * [1 0]
[0 1] [-1 0]
[ 0 -1]
+--------------------------------
[1 0]
[0 1]| [1 0]
[0 1] [-1 0]
[ 0 -1]
[-1 0]
[ 0 -1]| [-1 0]
[ 0 -1] [1 0]
[0 1]
</code></pre>
<p>Am I missing something to get a correctly displayed result ?</p>
<p>Thanks !</p>
http://ask.sagemath.org/question/7945/badly-formatted-cayley-table/?answer=12106#post-id-12106As I note in my comment, I think this is a bug. To get around it, you could instead use `G.cayley_table(elements=[identity, -identity])` and it should work fine. The output from `G.cayley_table(names=['I', '-I'], elements=[identity, -identity])` looks even better to me. (When you set `names` equal to a list, the entries of the list are the strings to use to name the elements, so this uses `'I'` for the identity matrix and `'-I'` for its negative.)Tue, 15 Feb 2011 09:37:26 -0600http://ask.sagemath.org/question/7945/badly-formatted-cayley-table/?answer=12106#post-id-12106Answer by staffan for <p>Hi,</p>
<p>I am completely new to Sage. To test the visualization of a subgroup of SL(2)a, I entered the following code:</p>
<pre><code>G=SL(2,ZZ)
identity = matrix(ZZ, [[1,0], [0,1]])
G.cayley_table(names='elements',elements=[identity, -identity])
</code></pre>
<p>which outputs</p>
<pre><code> * [1 0]
[0 1] [-1 0]
[ 0 -1]
+--------------------------------
[1 0]
[0 1]| [1 0]
[0 1] [-1 0]
[ 0 -1]
[-1 0]
[ 0 -1]| [-1 0]
[ 0 -1] [1 0]
[0 1]
</code></pre>
<p>Am I missing something to get a correctly displayed result ?</p>
<p>Thanks !</p>
http://ask.sagemath.org/question/7945/badly-formatted-cayley-table/?answer=12107#post-id-12107I think you need to either use default values for the first argument or specify a list of exactly two letters
here is the first way:
G=SL(2,ZZ)
identity = matrix(ZZ, [[1,0], [0,1]])
G.cayley_table(elements=[identity, -identity])
The other you can see by using ?, eg
`G.cayley_table?`
Question mark is your best friend when learning SageTue, 15 Feb 2011 10:05:30 -0600http://ask.sagemath.org/question/7945/badly-formatted-cayley-table/?answer=12107#post-id-12107