sagemath / sage

Main repository of SageMath
https://www.sagemath.org
Other
1.31k stars 450 forks source link

Operation tables: multiline names for elements, latex names for elements #10787

Open jhpalmieri opened 13 years ago

jhpalmieri commented 13 years ago

In operation tables like Cayley tables, there are two problems right now:

sage: G=SL(2,ZZ)
sage: identity = matrix(ZZ, [[1,0], [0,1]])
sage: G.cayley_table(names='elements',elements=[identity, -identity])

CC: @rbeezer @nthiery @jhpalmieri @kcrisman

Component: group theory

Issue created by migration from https://trac.sagemath.org/ticket/10787

1d7ec08f-60ae-4512-91a6-8324c06eab9f commented 13 years ago
comment:2

Yes, lets close #10786 and work on this here.

John's answer on ask.sagemath.org is a good one, give the elements simple strings as names. Using the "real" elements was meant for things like integers mod n or short permutations, the alternate names were meant for big messes (like matrices). Maybe a documentation upgrade is in order. Or we could test for multiline names (look for \n) and fail gracefully. Getting the textual output to "work" with multiline elements would be a nightmare.

So, yes, this is a job for latex (and the _repr_ fix suggested. Right now this is also mildly broken in the notebook, since jsMath does not like the array environment (IIRC). I've been waiting for the MathJax upgrade to tackle that as well.

kcrisman commented 13 years ago
comment:3

Hilarious. Another reason not to like ask.sagemath.org. Yes, do close #10786 as long as you feel like this one's not too big.

Incidentally, +1 on finding a fix for arrays in the notebook!

1d7ec08f-60ae-4512-91a6-8324c06eab9f commented 13 years ago
comment:4

See related #11362 which could probably be fixed in the same pass (perhaps once MathJax is added into the notebook).