Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot compute p-adic absolute value of zero #11873

Closed
jdemeyer opened this issue Sep 29, 2011 · 6 comments
Closed

Cannot compute p-adic absolute value of zero #11873

jdemeyer opened this issue Sep 29, 2011 · 6 comments

Comments

@jdemeyer
Copy link

sage: Qp(7)(0).abs()
---------------------------------------------------------------------------
NotImplementedError                       Traceback (most recent call last)

/usr/local/src/sage-4.7.2.alpha2/<ipython console> in <module>()

/usr/local/src/sage-4.7.2.alpha2/local/lib/python2.6/site-packages/sage/rings/padics/padic_base_generic_element.so in sage.rings.padics.padic_base_generic_element.pAdicBaseGenericElement.abs (sage/rings/padics/padic_base_generic_element.c:2727)()

/usr/local/src/sage-4.7.2.alpha2/local/lib/python2.6/site-packages/sage/rings/padics/padic_base_generic_element.so in sage.rings.padics.padic_base_generic_element.pAdicBaseGenericElement.abs (sage/rings/padics/padic_base_generic_element.c:2580)()

/usr/local/src/sage-4.7.2.alpha2/local/lib/python2.6/site-packages/sage/rings/integer.so in sage.rings.integer.Integer.__pow__ (sage/rings/integer.c:12552)()

/usr/local/src/sage-4.7.2.alpha2/local/lib/python2.6/site-packages/sage/structure/element.so in sage.structure.element.RingElement.__pow__ (sage/structure/element.c:12576)()

/usr/local/src/sage-4.7.2.alpha2/local/lib/python2.6/site-packages/sage/structure/element.so in sage.structure.element.generic_power_c (sage/structure/element.c:22607)()

NotImplementedError: non-integral exponents not supported

Component: padics

Author: Jeroen Demeyer

Reviewer: Marco Streng

Merged: sage-4.7.2.alpha4

Issue created by migration from https://trac.sagemath.org/ticket/11873

@jdemeyer
Copy link
Author

Author: Jeroen Demeyer

@mstreng
Copy link

mstreng commented Sep 30, 2011

comment:2
sage: L.<a> = Qp(5).ext(x^2-5)
sage: L(5).abs()
0.200000000000000
sage: L(5).abs(prec=100)
0.20000000000000000000000000000
sage: L(5).abs(prec=0)
1/25
sage: L(5).abs(prec=False)
1/25

(yes, I deliberately tried to break it because I didn't understand the code at first)

Also: (why) is the code for pAdicExtElement a copy of the code for pAdicGenericElement? Why not remove the abs function for extension elements and move its examples to the generic one?

@jdemeyer
Copy link
Author

jdemeyer commented Oct 4, 2011

comment:3

Replying to @mstreng:

sage: L.<a> = Qp(5).ext(x^2-5)
sage: L(5).abs()
0.200000000000000
sage: L(5).abs(prec=100)
0.20000000000000000000000000000
sage: L(5).abs(prec=0)
1/25
sage: L(5).abs(prec=False)
1/25

(yes, I deliberately tried to break it because I didn't understand the code at first)

I changed if prec is None to if not prec. Do you prefer this?

Also: (why) is the code for pAdicExtElement a copy of the code for pAdicGenericElement? Why not remove the abs function for extension elements and move its examples to the generic one?

Done, moved all code to padic_generic_element.pyx

@mstreng
Copy link

mstreng commented Oct 5, 2011

Reviewer: Marco Streng

@mstreng
Copy link

mstreng commented Oct 5, 2011

comment:4

Attachment: 11873.patch.gz

@jdemeyer
Copy link
Author

jdemeyer commented Oct 6, 2011

Merged: sage-4.7.2.alpha4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants