Skip to content

bug in new ring extension constructor #1040

Closed

Description

@williamstein

Now that we allow notation such as

QQ[2^(1/3)]

to create a number field, the following is totally wrong and
needs to be fixed ASAP:

sage: K.<a> = QQ[2^(1/3)]
sage: K
Univariate Polynomial Ring in a over Rational Field
sage: parent(a)
Univariate Polynomial Ring in a over Rational Field

Component: number theory

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

Activity

  1. added this to the sage-2.9.1 milestone on Oct 31, 2007
  2. self-assigned this
    on Oct 31, 2007
  3. williamstein commented on Nov 1, 2007

    @williamstein
    ContributorAuthor
    comment:1

    More:

    This is because the preparser is written stupidly in this case:

    sage: K.<a> = QQ[2^(1/3)]
    sage: preparse('K.<a> = QQ[2^(1/3)]')
    'K = QQ["a"]; (a,) = K._first_ngens(Integer(1))'
    

    I think this is what should happen:

    sage: K.<a> = QQ[2^(1/3)]
    sage: preparse('K.<a> = QQ[2^(1/3)]')
    'K = QQ["2^(1/3)"]; (a,) = K._first_ngens(Integer(1))'
    

    The previous behavior should only happen in the case when nothing is between brackets, as a sort of short cut:

    sage: K.<a> = QQ[2^(1/3)]
    sage: preparse('K.<a> = QQ[]')
    'K = QQ["a"]; (a,) = K._first_ngens(Integer(1))'
    
  4. ncalexan commented on Nov 3, 2007

    ncalexanmannequin
    Mannequin
  5. added a commit that references this issue on Aug 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    Sponsor
    SponsoredKunjungi sekarang
    Promo