#4276: [with patch, needs review] move number fields to new coercion, implement
embeddings
----------------------+-----------------------------------------------------
Reporter: robertwb | Owner: robertwb
Type: defect | Status: new
Priority: major | Milestone: sage-3.2.1
Component: coercion | Resolution:
Keywords: |
----------------------+-----------------------------------------------------
Comment (by robertwb):
Yes, I explained this to some people at Sage Days 10, but it certainly
could use some explanation here.
These patches move coercion over to the new api, which is (hopefully)
easier to understand and use as well as being faster. As part of this
move, we also get the benefit of being able to specify embeddings at
creation time, into RR or CC being the most common. (The embeddings into
RR and CC are by default into "lazy" fields so the path can be followed to
a field of any precision.) Cyclotomic fields and fields created with the
"QuadraticField" command come with their standard embeddings.
A field with an embedding can do arithmetic with its ambient field, and if
two number fields have an embedding into a common field than elements can
be moved from one to the other as well. Here is a brief example (though
more can be found in the documentation):
{{{
sage: L.<a> = QuadraticField(-3)
sage: a + 1.5
1.50000000000000 + 1.73205080756888*I
sage: a + 1.50000000000000000000000000000000000000
1.50000000000000000000000000000000000000 +
1.73205080756887729352744634150587236694*I
sage: K.<zeta> = CyclotomicField(12)
sage: K(a)
2*zeta^7 + 1
sage: L.<b> = NumberField(x^5-x+1, embedding=-1.1)
sage: b in RR
True
sage: RR(b)
-1.16730397826142
sage: RealField(200)(b)
-1.1673039782614186842560458998548421807205603715254890391401
sage: RealField(200)(b^2-5)
-3.6374014223350653758204435726195439793325331732024834332371
sage: RealField(200)(b^5-b+1)
0.00000000000000000000000000000000000000000000000000000000000
}}}
This also paves the path for more sophisticated arithmetic, like automatic
compositums.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/4276#comment:3>
Sage <http://sagemath.org/>
Sage - Open Source Mathematical Software: Building the Car Instead of
Reinventing the Wheel
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en
-~----------~----~----~----~------~----~------~--~---