Opened 5 years ago

Closed 5 years ago

#24453 closed defect (fixed)

narrow_class_group: bug report

Reported by: Kimball Martin Owned by:
Priority: major Milestone: sage-8.2
Component: number fields Keywords: narrow class group, quadratic field
Cc: Merged in:
Authors: Frédéric Chapoton Reviewers: Vincent Delecroix
Report Upstream: N/A Work issues:
Branch: 13f3864 (Commits, GitHub, GitLab) Commit: 13f3864c0c0932cc2ee24bd49f38fdcb4207d79f
Dependencies: Stopgaps:

Status badges

Description

The narrow_class_group function does not even work for some simple real quadratic fields. Specifically, while it works for Q(sqrt(2)), it does not for Q(sqrt(3)) (I have not tried other number fields). See snippet below.

sage: version()
'SageMath version 8.1, Release Date: 2017-12-07'
sage: F.<a> = QuadraticField(2)
sage: F.narrow_class_group()
Trivial Abelian group
sage: F.<a> = QuadraticField(3)
sage: F.narrow_class_group()
  File "<string>", line 1
    [2, [2], [[0, -1]~]]
                     ^
SyntaxError: invalid syntax

sage: NumberField(x^2-3,'a').narrow_class_group()
  File "<string>", line 1
    [2, [2], [[0, -1]~]]
                     ^
SyntaxError: invalid syntax

If it matters, I was using a pre-built Mac binary.

Change History (6)

comment:1 Changed 5 years ago by Frédéric Chapoton

Indeed, there is maybe something strange..

sage: F.<a> = QuadraticField(3)
sage: F.pari_bnf().bnfnarrow()
[2, [2], [[0, -1]~]]
sage: F.<a> = QuadraticField(2)
sage: F.pari_bnf().bnfnarrow()
[1, [], []]
sage: F.<a> = NumberField(x**3-7)
sage: F.pari_bnf().bnfnarrow()
[3, [3], [[2, 1, 1; 0, 1, 0; 0, 0, 1]]]

comment:2 Changed 5 years ago by Frédéric Chapoton

Authors: Frédéric Chapoton
Branch: u/chapoton/24453
Commit: 13f3864c0c0932cc2ee24bd49f38fdcb4207d79f
Status: newneeds_review

New commits:

13f3864trac 24453 fix narrow class field

comment:3 Changed 5 years ago by Vincent Delecroix

Why did you make it a cached method?

comment:4 Changed 5 years ago by Frédéric Chapoton

oh, well, I thought it would be a good idea to replace the custom cache by the usual decorator..

comment:5 Changed 5 years ago by Vincent Delecroix

Reviewers: Vincent Delecroix
Status: needs_reviewpositive_review

Oh! I missed the old cache.

comment:6 Changed 5 years ago by Volker Braun

Branch: u/chapoton/2445313f3864c0c0932cc2ee24bd49f38fdcb4207d79f
Resolution: fixed
Status: positive_reviewclosed
Note: See TracTickets for help on using tickets.