Skip to content

Unexpected KeyError and "PariError: the PARI stack overflows" while computing UnitGroup #36386

@maxale

Description

@maxale

Steps To Reproduce

The issue is illustrated with the following code:

d = 12936642
K = QuadraticField(d)
K.unit_group(proof=False)

Expected Behavior

The code should compute the unit group without an issue, since directly calling pari.bnfinit(f'x^2 - {d}', 1) computes the unit group structure in a fraction of second.

Actual Behavior

Instead, the code produces a bunch of errors including:

KeyError: ((<class 'sage.rings.number_field.unit_group.UnitGroup'>, Number Field in a with defining polynomial x^2 - 12936642 with a = 3596.754370262167?, False), ())

and

PariError: the PARI stack overflows (current size: 1024000000; maximum size: 1073741824)

Additional Information

The "PariError: the PARI stack overflows" appears to be quite irrelevant to computing the unit group since

  • direct call to pari.bnfinit(f'x^2 - {d}', 1) runs fine with the same size of PARI stack;
  • increasing PARI stack even to 2GB does not help here as the same errors show up.

Environment

- **OS**: Ubuntu 22.04.3 LTS
- **Sage Version**: 10.2.beta5

Checklist

  • I have searched the existing issues for a bug report that matches the one I want to file, without success.
  • I have read the documentation and troubleshoot guide

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions