Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversion for residue fields of number fields does not use lift map #30100

Open
davidac897 opened this issue Jul 9, 2020 · 3 comments
Open

Comments

@davidac897
Copy link

When I do

ZZp = Zp(p=2,prec=10, type = 'fixed-mod')
PRZZp.<x> = ZZp[]
R.<pi> = ZZp.extension(x^2+x+1)
Fp = R.residue_field()
a = Fp(pi)
b = R(a); b

I get pi. Without 'fixed-mod', I get pi+O(2).

But when I do

PRZZ.<x> = ZZ[]
R.<pi> = ZZ.extension(x^2+x+1)
Fp = ResidueField(R.ideal(2))
a = Fp(pi)
b = R(a)

I get an error.

This can be solved with lift_map, but I feel like that should be in the conversion.

Furthermore, it would be nice to be able to lift polynomials with coefficients in the residue field. I made my own implementation of that as follows:

def polynomiallift(g,PR,PFp): #PFp is the ring of polynomials over the residue field, PR is the ring of polynomials over the integer ring, L is the lift map, and g is an element of PFp
    if g.parent() != PFp:
        raise Exception('first argument must be an element of the last argument')
    Fp = PFp.base_ring()
    L = Fp.lift_map()
    if L.codomain() != PR.base_ring():
        raise Exception('codomain of lift map must be base ring of PR')
    f = PR(0)
    var_str = PR.variable_name()
    exec('vari = ' + var_str)
    coeffs = g.coefficients(sparse=False)
    for i in range(g.degree()+1):
        f += L(coeffs[i])*vari^i
    return f


Component: number fields

Keywords: residue_field, lift_map

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

@davidac897 davidac897 added this to the sage-9.2 milestone Jul 9, 2020
@davidac897

This comment has been minimized.

@davidac897

This comment has been minimized.

@mkoeppe mkoeppe modified the milestones: sage-9.2, sage-9.3 Oct 24, 2020
@mkoeppe
Copy link
Member

mkoeppe commented May 10, 2021

comment:4

Moving to 9.4, as 9.3 has been released.

@mkoeppe mkoeppe modified the milestones: sage-9.3, sage-9.4 May 10, 2021
@mkoeppe mkoeppe modified the milestones: sage-9.4, sage-9.5 Aug 22, 2021
@mkoeppe mkoeppe modified the milestones: sage-9.5, sage-9.6 Dec 18, 2021
@mkoeppe mkoeppe modified the milestones: sage-9.6, sage-9.7 May 3, 2022
@mkoeppe mkoeppe modified the milestones: sage-9.7, sage-9.8 Sep 19, 2022
@mkoeppe mkoeppe removed this from the sage-9.8 milestone Jan 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants