Opened 3 years ago
Last modified 3 years ago
#23593 new defect
absolute_norm not implemented for ideals over ZZ or QQ
Reported by: | edgarcosta | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | sage-8.1 |
Component: | number fields | Keywords: | |
Cc: | Merged in: | ||
Authors: | Reviewers: | ||
Report Upstream: | N/A | Work issues: | |
Branch: | Commit: | ||
Dependencies: | Stopgaps: |
Description
Trying
ZZ.ideal(2).absolute_norm()
raises a NotImplementedError
.
However,
NumberField(var('y'),"a").ring_of_integers().ideal(2).absolute_norm()
works fine.
This should be an easy fix, but I'm not sure where is the right place to do it.
Change History (5)
comment:1 Changed 3 years ago by
comment:2 follow-up: ↓ 4 Changed 3 years ago by
That could be a solution, but somewhat, to me seems that norm()
should also raise a NotImplementedError
.
I'm leaning more towards returning self.gen().norm()
and self.gen(). absolute_norm()
for ideals in a PID.
What do you think?
comment:3 Changed 3 years ago by
- Summary changed from absolute_norm not implemented for ZZ or QQ to absolute_norm not implemented for ideals over ZZ or QQ
comment:4 in reply to: ↑ 2 Changed 3 years ago by
Replying to edgarcosta:
That could be a solution, but somewhat, to me seems that
norm()
should also raise aNotImplementedError
.I'm leaning more towards returning
self.gen().norm()
andself.gen(). absolute_norm()
for ideals in a PID.What do you think?
That sounds reasonable to me. Do you also want to define relative_norm
to return self
?
comment:5 Changed 3 years ago by
Most likely...
Alternatively, we could create a new class for ZZ ideals and QQ fractional ideals, see #23595.
Interesting. In
sage.rings.ideal.Ideal_generic
,norm()
returnsself
whileabsolute_norm
raises aNotImplementedError
. Maybe just update that function to returnself
?