On Fri, Mar 20, 2015 at 12:23 PM, Robert Bradshaw <[email protected]> wrote:
> On Thu, Mar 19, 2015 at 9:20 AM, William Stein <[email protected]> wrote:
>> On Thu, Mar 19, 2015 at 9:11 AM, Robert Bradshaw <[email protected]> wrote:
>>> On Thu, Mar 19, 2015 at 3:16 AM, Chris Wuthrich
>>> <[email protected]> wrote:
>>>>
>>>>> What about the quadratic case? Would you oppose change the print order
>>>>> just for quadratic number fields (note that we already have a separate 
>>>>> class
>>>>> QuadraticNumberField, so the change can easily be made).
>>>>
>>>> And a further subquestion: What about Q[i] ? It seems really strange that
>>>> sage decides to write 3*I + 1. But reverts it for CC(3*I+1).
>>>> No other cas does that, I would think.
>>>
>>> Yes, I was also referring specifically to to the special case of QQ[i],
>>>
>>>     sage: R.<I> = QQ[sqrt(-1)]
>>>     sage: 3 + R.gen()
>>>     I + 3
>>>     sage: CC(3 + R.gen())
>>>     3.00000000000000 + 1.00000000000000*I
>>>
>>> which Maple and Mathematica handle this case differently (better) than
>>> arbitrary number fields.
>>
>> Can you illustrate your claims about Maple and Mathematica with actual
>> Maple and Mathematica sessions?
>
> http://www.maplesoft.com/support/help/maple/view.aspx?path=complex

"The Maplesoft web site you are requesting is currently undergoing
scheduled maintenance. [...] To place or complete an order: ..."

> http://www.wolframalpha.com/input/?i=sqrt%28-1%29+%2B+2

That's Wolfram Alpha, not mathematica.  And that's also using sqrt(-1)
symbolically, rather than the number field QQ(sqrt(-1)).   But you're
right, it makes sense and it isn't what Sage does:

sage: sqrt(-1) + 1
I + 1

Maybe Pynac, which does Sage symbolics, should print that as 1+I... ?

Here's what Mathematica does  -- see attached screen shot, since cloud
Mathematica's copy/paste is broken, at least in Chrome.


>>> I actually don't think it'd be that bad to print out algebraic number
>>> representations in reverse order than polynomials; that's what we do
>>> for power series (for admittedly even more compelling reasons).
>>
>> I think every single math software system there is prints power series
>> from lowest to highest degree.
>
> Yes. My point was that while this is inconsistent with how polynomials
> print, it's still the right choice in that context.

I agree.  But I think there is a slightly more compelling mathematical
argument in the case of power series, which goes beyond just
habit/taste.

>>> But mine is just one of many opinions.
>>
>> I think a really compelling argument that is more than just an opinion
>> is really important when changing something that will be noticed.  For
>> example, this will break many of the doctests in my algebraic number
>> theory book...
>
> True, but people aren't generally testing the doctests in your book.
> The files we test would get changed, and people typing examples out of
> the book wouldn't be too weirded out getting 1 + I instead of I + 1.
> So I do think it largely (though not entirely) boils down to a matter
> of preference.
>
> If there's a lot of automatically-tested code out there that we don't
> have any visibility into, that'd be good to know.

I agree with the above; it wouldn't be difficult to fix.

>> You and I co-authored much of the algebraic number theory
>> functionality in the first place and _you_ implemented like 90% of
>> QuadraticField.  I wonder, did you think about this exact issue before
>> when we were implementing things in the first place?
>
> It bothered me a little when doing the quadratics, but not enough to
> change. In particular I was striving for a drop-in replacement for our
> generic number field elements (including all doctests passing as is).
> I also thought about it when implementing QQ[sqrt(2)], but changing
> printing was a bigger change than I wanted to make at the time.
>
> But if people are proposing such a change, I would be supportive. It
> doesn't seem many people like the "b*I + a" ordering despite the
> reasoning for why it happens to be that way.

I'm not sure, since we didn't have any real sort of pole, and I've
never heard this topic come up in the past...

My guess is that if we were to special case quadratic fields to use
the opposite order, then people would later come through and try to
"fix" this to make it consistent with higher degree fields.  And it
would be difficult to argue with them.  People all-to-often make
breaking changes in the name of consistency.


Another thing to discuss might be a technical mechanism for users to
easily customize how things print.   E.g., matrices hard code to not
print out much when they have more than 20 rows/columns -- but maybe
that 20 should be configurable.  A lot of output representations could
be uniformly configurable by users.   We could leave the defaults as
they are now, but have an easy-to-use global object (like David Roe's
"proof") that lets one customize a few things involving display
representations.   For example, there are a lot of ways to represent
p-adics; how is that configured?

Anyway, I would be very strongly supportive of making it very easy for
users to change number fields so they print in the reverse order
proposed above...

 -- William


-- 
William (http://wstein.org)

-- 
You received this message because you are subscribed to the Google Groups 
"sage-nt" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send an email to [email protected].
Visit this group at http://groups.google.com/group/sage-nt.
For more options, visit https://groups.google.com/d/optout.

Reply via email to