On Dec 4, 2008, at 4:33 PM, William Stein wrote:
On Tue, Dec 2, 2008 at 8:21 PM, Jason Grout <[EMAIL PROTECTED] > wrote:Tim Lahey wrote:Hi, Thanks. I was kind of hoping for something less drastic, but that works. In Maple there is just a variable you can set which controls things, so you can do it on a per script basis.This is something that has come up before too. I think it might make sense to make a module-level variable in the calculus file,sage.calculus.imaginary_i or something. Set it by default to "I", butlet people change it. Then the repr function for I could just return that variable. Then things won't be quite so invasive to change the printed representation.It's also invasive, since either way, all code in all of sage that prints "I" will print using what you change it to. However, an additional benefit to having a function like sage.calculus.imaginary_i is that it will work even if (in fact, when) the "I" constant gets rewritten in Cython, which would make changing the _repr_ function impossible.
However, during a worksheet/script, I'd want all Sage code to use the symbol I specified for sqrt(-1), both for display purposes and for specifying expressions. The reason I bring this up is that I is the symbol for moment of inertia in solid mechanics and i is the symbol for current in electrical engineering. Since I'm interested in both, I'd like to be able to use them in their normal engineering fashion. There's a reason why engineers use j for the imaginary unit. I happen to use _j in Maple so I can use j as a loop variable. Cheers, Tim.
smime.p7s
Description: S/MIME cryptographic signature