Esempio n. 1
0
def get_number_field_integral_basis(c_string):
    r"""Get the integral basis for the field specified by the string.

    INPUT:
        c_string -- string, a string of comma-separated coefficients with no spaces: the coefficients of the normalized (using gp.polredabs) defining polynomial

    OUTPUT:
        fld_bool -- bool, True if the number field has a page in the LMFDB, False otherwise
        K_new -- number field, the number field with defining polynomial that is the normalized version (given by gp.polredabs) of the one with coefficients specified by c_string
        a -- number field element, generator for K_new
        the integral basis for K_new recorded on its LMFDB page 
    """
    C = getDBconnection()
    c_hash = field_coeffs_string_to_hash(c_string)
    field = C.numberfields.fields.find_one({'coeffhash': c_hash})
    fld_bool = True
    try:
        field['degree']
    except TypeError:
        fld_bool = False
    if fld_bool:
        field_str = field['coeffs']
        int_basis_str = field['zk']
        poly = coeffs_to_poly(field_str)
        K_new = NumberField(poly, names=('a', ))
        (a, ) = K_new._first_ngens(1)
        return fld_bool, K_new, a, [
            K_new(eval(preparse(el))) for el in int_basis_str
        ]
    else:
        # could add polynomial to list of number fields missing from LMFDB here
        return fld_bool, None, None, None
Esempio n. 2
0
def get_number_field_integral_basis(c_string):
    r"""Get the integral basis for the field specified by the string.

    INPUT:
        c_string -- string, a string of comma-separated coefficients with no spaces: the coefficients of the normalized (using gp.polredabs) defining polynomial

    OUTPUT:
        fld_bool -- bool, True if the number field has a page in the LMFDB, False otherwise
        K_new -- number field, the number field with defining polynomial that is the normalized version (given by gp.polredabs) of the one with coefficients specified by c_string
        a -- number field element, generator for K_new
        the integral basis for K_new recorded on its LMFDB page 
    """
    C = getDBconnection()
    c_hash = field_coeffs_string_to_hash(c_string)
    field = C.numberfields.fields.find_one({'coeffhash':c_hash})
    fld_bool = True
    try:
        field['degree']
    except TypeError:
        fld_bool = False
    if fld_bool:
        field_str = field['coeffs']
        int_basis_str = field['zk']
        poly = coeffs_to_poly(field_str)
        K_new = NumberField(poly, names=('a',))
        (a,) = K_new._first_ngens(1)
        return fld_bool, K_new, a, [K_new(eval(preparse(el))) for el in int_basis_str]
    else:
        # could add polynomial to list of number fields missing from LMFDB here
        return fld_bool, None, None, None
Esempio n. 3
0
def get_hmfs_hecke_field_and_eigenvals(label):
    """Get the Hecke field and eigenvalues for the Hilbert modular form with given label.

    INPUT:
        label -- string, the label of the Hilbert modular form

    OUTPUT:
        K_old -- number field, the field containing the Hecke eigenvalues
        e -- number field element, a generator for K_old over QQ
        eigenvals -- list, a list of the Hecke eigenvalues
    """
    C = getDBconnection()
    # Should I use find_one, or something else?
    R = PolynomialRing(QQ, names=('x'))
    form = C.hmfs.forms.find_one({'label': label})
    poly = R(str(form['hecke_polynomial']))
    K_old = NumberField(poly, names=('e', ))
    (e, ) = K_old._first_ngens(1)
    eigenvals_str = form['hecke_eigenvalues']
    eigenvals = [K_old(eval(preparse(el))) for el in eigenvals_str]
    return K_old, e, eigenvals
Esempio n. 4
0
def get_hmfs_hecke_field_and_eigenvals(label):
    """Get the Hecke field and eigenvalues for the Hilbert modular form with given label.

    INPUT:
        label -- string, the label of the Hilbert modular form

    OUTPUT:
        K_old -- number field, the field containing the Hecke eigenvalues
        e -- number field element, a generator for K_old over QQ
        eigenvals -- list, a list of the Hecke eigenvalues
    """
    C = getDBconnection()
    # Should I use find_one, or something else?
    R = PolynomialRing(QQ,names=('x'))
    form = C.hmfs.forms.find_one({'label':label})
    poly = R(str(form['hecke_polynomial']))
    K_old = NumberField(poly, names=('e',))
    (e,) = K_old._first_ngens(1)
    eigenvals_str = form['hecke_eigenvalues']
    eigenvals = [K_old(eval(preparse(el))) for el in eigenvals_str]
    return K_old, e, eigenvals