Algebraic Field or Symbolic Ring ?

31 views
Skip to first unread message

Thierry Dumont

unread,
Jun 30, 2015, 7:24:23 AM6/30/15
to sage-s...@googlegroups.com

I have found something a bit strange for me:

sage: xx=QQ(2)
sage: xx.parent()
Rational Field

ok...

sage: xxc=xx.sqrt()
sage: xxc.parent()
Symbolic Ring


Why not, but now:

sage: M1=matrix(QQ,1,1,[2])

sage: M1.parent()
Full MatrixSpace of 1 by 1 dense matrices over Rational Field


sage: M1C=M1.cholesky()
sage: M1C
[1.414213562373095?]
sage: M1C.parent()
Full MatrixSpace of 1 by 1 dense matrices over Algebraic Field

So, we have:

xxc: Symbolic Ring
M1C: Full MatrixSpace of 1 by 1 dense matrices over Algebraic Field

and also:
sage: mxx=M1C.row(0)[0]
sage: mxx.parent()
Algebraic Field
sage: mxx==xxc
True

Why is xxc in Symbolic Ring and not in Algebraic Field?
mxx and xxc are essentialy the same thing, no ?

A bit strange for me...

Yours
t.d.
tdumont.vcf

Ralf Stephan

unread,
Jul 1, 2015, 2:23:03 AM7/1/15
to sage-s...@googlegroups.com
On Tuesday, June 30, 2015 at 1:24:23 PM UTC+2, tdumont wrote:
Why is xxc in Symbolic Ring and not in Algebraic Field?
mxx and xxc are essentialy the same thing, no ?

When you input sqrt(2) it is not clear which object you want,
Sage traditionally decides in favor of a symbolic. If you specifically
need the number field element you must say so with

sage: K.<sqrt2> = QuadraticField(2)
sage: sqrt2^5
4*sqrt2

That said, I think the sqrt function of Rational (which is called here)
could be enhanced with an option to return a number field element
for convenience.

Regards,  

Thierry Dumont

unread,
Jul 1, 2015, 3:23:42 AM7/1/15
to sage-s...@googlegroups.com
Thanks,
But this is not what I do!
I do
xx=QQ(2)
xxc=xx.sqrt()
xxc.parent()
Symbolic Ring

It should not be the same thing as xxc=sqrt(2)...

Yours
t.


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

tdumont.vcf
Reply all
Reply to author
Forward
0 new messages