Opened 4 years ago

Closed 4 years ago

#24453 closed defect (fixed)

narrow_class_group: bug report

Reported by: kimball 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


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 4 years ago by 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 4 years ago by chapoton

  • Authors set to Frédéric Chapoton
  • Branch set to u/chapoton/24453
  • Commit set to 13f3864c0c0932cc2ee24bd49f38fdcb4207d79f
  • Status changed from new to needs_review

New commits:

13f3864trac 24453 fix narrow class field

comment:3 Changed 4 years ago by vdelecroix

Why did you make it a cached method?

comment:4 Changed 4 years ago by chapoton

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

comment:5 Changed 4 years ago by vdelecroix

  • Reviewers set to Vincent Delecroix
  • Status changed from needs_review to positive_review

Oh! I missed the old cache.

comment:6 Changed 4 years ago by vbraun

  • Branch changed from u/chapoton/24453 to 13f3864c0c0932cc2ee24bd49f38fdcb4207d79f
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.