On 10/4/07, John Voight <[EMAIL PROTECTED]> wrote:
>
> OK, done.  I'll see if I can make any progress on it myself.

I've added that PARI function you want to Sage for the next release.
The patch is the following (just so you know).   The hardest part
was figuring out that the C library name of the function you
want is "rootsof1" -- I did that by poking around in the PARI source
code; one could also do it by reading the PARI user's guide.

# HG changeset patch
# User William Stein <[EMAIL PROTECTED]>
# Date 1191556261 25200
# Node ID 0e8bb6f4816b48335b54b9ffed575f67e6d6aa80
# Parent  638d1bf0fe74f616f300638b576a7a7656666a36
Add a function for John Voight.

diff -r 638d1bf0fe74 -r 0e8bb6f4816b sage/libs/pari/gen.pyx
--- a/sage/libs/pari/gen.pyx    Thu Oct 04 19:46:31 2007 -0700
+++ b/sage/libs/pari/gen.pyx    Thu Oct 04 20:51:01 2007 -0700
@@ -4353,6 +4353,21 @@ cdef class gen(sage.structure.element.Ri
         _sig_on
         return P.new_gen(nfisisom(self.g, other.g))

+    def nfrootsof1(self):
+        """
+        nf.nfrootsof1()
+
+        number of roots of unity and primitive root of unity in the
+        number field nf.
+
+        EXAMPLES:
+            sage: nf = pari('x^2 + 1').nfinit()
+            sage: nf.nfrootsof1()
+            [4, [0, 1]~]
+        """
+        _sig_on
+        return P.new_gen(rootsof1(self.g))
+
     def nfsubfields(self, d=0):
         """
         Find all subfields of degree d of number field nf (all

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~----------~----~----~----~------~----~------~--~---

Reply via email to