non conventional displays of sage objects

232 views
Skip to first unread message

Oscar Gerardo Lazo Arjona

unread,
Jan 15, 2010, 8:57:14 PM1/15/10
to sage-s...@googlegroups.com
When sage has to display a variable whose name is a greek letter it
shows the
corresponding greek letter. For example

sage: show(var('alpha,beta,gamma'))

will show the simbols for this letters, instead of

(alpha,beta,gamma)

This sort of association is what I think sage should use with the
imaginary "I" and "i".
Complex expressions include "I" which is not conventional. I understand
that using I
is safer given the common use of this letter as an index (in for loops
for example), but
it would be good if it was associated to "i" in the same way as greek
letters are to
their symbols.

wstein mentioned in a different post
http://groups.google.com/group/sage-support/browse_thread/thread/f7aafa5611e72df4/5dbba0ca80ee97ec?lnk=raot&pli=1
, that an option to forbid the use of certain
variable names as forbidden given their common use as mathematical
quantities. If
such an option is created, then I think it would be good to include the
possibility to
define this kind of associations.

A related issue is the imposibility of using variable name 'lambda' due
to it being a
python keyword. That variable name is very often needed. But then, if the
variable name-display association option was implemented, it would be
possible to
associate the greek letter lambda to lets say, "llamda"

what do you think?

John H Palmieri

unread,
Jan 15, 2010, 10:07:20 PM1/15/10
to sage-support

On Jan 15, 5:57 pm, Oscar Gerardo Lazo Arjona
<algebraicame...@gmail.com> wrote:

[snip]

> A related issue is the imposibility of using variable name 'lambda' due
> to it being a
> python keyword. That variable name is very often needed. But then, if the
> variable name-display association option was implemented, it would be
> possible to
> associate the greek letter lambda to lets say, "llamda"

See <http://trac.sagemath.org/sage_trac/ticket/6403> for customization
which would allow this sort of thing.

--
John

William Stein

unread,
Jan 15, 2010, 10:28:45 PM1/15/10
to sage-support
On Fri, Jan 15, 2010 at 5:57 PM, Oscar Gerardo Lazo Arjona
<algebra...@gmail.com> wrote:
> When sage has to display a variable whose name is a greek letter it shows
> the
> corresponding greek letter. For example
>
> sage: show(var('alpha,beta,gamma'))
>
> will show the simbols for this letters, instead of
>
> (alpha,beta,gamma)
>
> This sort of association is what I think sage should use with the imaginary
> "I" and "i".
> Complex expressions include "I" which is not conventional. I understand that
> using I
> is safer given the common use of this letter as an index (in for loops for
> example), but
> it would be good if it was associated to "i" in the same way as greek
> letters are to
> their symbols.

That is dumb and should be fixed!

sage: latex(I)
I
sage: latex(i)
I

It should output "i" not "I".

This is now http://trac.sagemath.org/sage_trac/ticket/7942

> wstein mentioned in a different post
> http://groups.google.com/group/sage-support/browse_thread/thread/f7aafa5611e72df4/5dbba0ca80ee97ec?lnk=raot&pli=1
> , that an option to forbid the use of certain
> variable names as forbidden given their common use as mathematical
> quantities. If
> such an option is created, then I think it would be good to include the
> possibility to
> define this kind of associations.
>
> A related issue is the imposibility of using variable name 'lambda' due to
> it being a
> python keyword. That variable name is very often needed. But then, if the
> variable name-display association option was implemented, it would be
> possible to
> associate the greek letter lambda to lets say, "llamda"

FYI, in fact you can make the variable "lambda" in Sage:

sage: llambda = var('lamba')
sage: latex(llambda)
\mbox{lamba}
sage: latex(llambda^3 -2/7*sqrt(llambda))
\mbox{lamba}^{3} - \frac{2}{7} \, \sqrt{\mbox{lamba}}
sage: llambda^3 -2/7*sqrt(llambda)
lamba^3 - 2/7*sqrt(lamba)

William

Reply all
Reply to author
Forward
0 new messages