Skip to content

[fixed by #5508] __getitem__ for relative number field elements is ... now fixed #2551

@craigcitro

Description

@craigcitro

Indexing into a relative number field element does unexpected things:

sage: K
 Number Field in b with defining polynomial x^3 - 5 over its base field
sage: K([1,2,3])
 3*b^2 + (-6*a + 2)*b - 2*a + 7
sage: K([1,2,3])[0]
 1
sage: K([1,2,3])[1]
 2

sage: K([1,2,3]).list()
 [-2*a + 7, -6*a + 2, 3]
sage: K([1,2,3]).list()[0]
 -2*a + 7

sage: K([1,2,3]).polynomial()
 3*x^2 + 2*x + 1

The issue is that it's giving you the entries in the representation of the element as an absolute number field element. It should be fixed.

Component: number theory

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions