コード例 #1
0
    def __init__(self,
                 hecke_orbit_label,
                 prec=10,
                 update_from_db=True,
                 auto_update=True,
                 init_dynamic_properties=True,
                 **kwargs):
        self._properties = WebProperties(
            WebSageObject('E', None, Matrix),
            WebSageObject('v', None, vector),
            WebDict('meta', value={}),
            WebStr('hecke_orbit_label', value=hecke_orbit_label),
            WebInt('prec', value=prec, save_to_db=False, save_to_fs=True),
            WebFloat('version',
                     value=float(emf_version),
                     save_to_fs=True,
                     save_to_db=True),
        )

        self.auto_update = True
        self._ap = {}
        self._add_to_fs_query = {'prec': {'$gt': int(prec - 1)}}
        super(WebEigenvalues,
              self).__init__(use_gridfs=True,
                             use_separate_db=False,
                             update_from_db=update_from_db,
                             init_dynamic_properties=init_dynamic_properties,
                             **kwargs)
        #remember the precision we got after updating for every query (not only update_from_db uses this)
        self._add_to_fs_query = {'prec': {'$gt': int(self.prec - 1)}}
コード例 #2
0
    def __init__(self,
                 modulus=1,
                 number=1,
                 update_from_db=True,
                 compute_values=False,
                 init_dynamic_properties=True):
        r"""
        Init self.

        """
        emf_logger.debug("In WebChar {0}".format(
            (modulus, number, update_from_db, compute_values)))
        if isinstance(modulus, basestring):
            try:
                m, n = modulus.split('.')
                modulus = int(m)
                number = int(n)
            except:
                raise ValueError, "{0} does not correspond to the label of a WebChar".format(
                    modulus)
        if not gcd(number, modulus) == 1:
            raise ValueError, "Character number {0} of modulus {1} does not exist!".format(
                number, modulus)
        if number > modulus:
            number = number % modulus
        self._properties = WebProperties(
            WebInt('conductor'), WebInt('modulus', value=modulus),
            WebInt('number', value=number), WebInt('modulus_euler_phi'),
            WebInt('order'), WebStr('latex_name'),
            WebStr('label', value="{0}.{1}".format(modulus, number)),
            WebNoStoreObject('sage_character', type(trivial_character(1))),
            WebDict('_values_algebraic'), WebDict('_values_float'),
            WebDict('_embeddings'),
            WebFloat('version', value=float(emf_version)))
        emf_logger.debug('Set properties in WebChar!')
        super(WebChar,
              self).__init__(update_from_db=update_from_db,
                             init_dynamic_properties=init_dynamic_properties)
        #if not self.has_updated_from_db():
        #    self.init_dynamic_properties() # this was not done if we exited early
        #    compute = True
        if compute_values:
            self.compute_values()

        #emf_logger.debug('In WebChar, self.__dict__ = {0}'.format(self.__dict__))
        emf_logger.debug('In WebChar, self.number = {0}'.format(self.number))
コード例 #3
0
    def __init__(self, level=1, weight=12, character=1,cuspidal=True, new=True, prec=0, bitprec=53, update_from_db=True, update_hecke_orbits=True, **kwargs):

        # I added this reduction since otherwise there is a problem with
        # caching the hecke orbits (since they have self as  parent)
        self._reduction = (type(self),(level,weight,character),
                           {'cuspidal':cuspidal, 'prec':prec, 'bitprec':bitprec, 'update_from_db':update_from_db,'update_hecke_orbits':update_hecke_orbits})
        if isinstance(character, WebChar):
            character_number = character.number
        else:
            character_number = character
        emf_logger.debug("level={0}".format(level))
        emf_logger.debug("character={0},type={1}".format(character,type(character)))         
        emf_logger.debug("character_number={0}".format(character_number))         
        self._properties = WebProperties(
            WebInt('level', value=level),
            WebInt('weight', value=weight),
            WebCharProperty('character', modulus=level, number=character_number),
            WebStr('character_naming_scheme', value='Conrey', save_to_fs=True),
            WebList('_character_galois_orbit', default_value=[character]),
            WebDict('_character_galois_orbit_embeddings', default_value={}),
            WebCharProperty('character_orbit_rep', modulus=level, save_to_fs=True),
            #WebCharProperty('character_used_in_computation', modulus=level, save_to_fs=True),
            WebStr('space_label', default_value=space_label(level=level, weight=weight, character=character), save_to_fs=True),
            WebStr('space_orbit_label', value='', save_to_db=True),            
            #WebStr('galois_orbit_name', value='', save_to_fs=True),
            WebInt('dimension'),
            WebInt('dimension_cusp_forms'),
            WebInt('dimension_modular_forms'),
            WebInt('dimension_new_cusp_forms'),
            WebBool('cuspidal', value=cuspidal),
            WebBool('new', value=new),
            #WebInt('prec', value=int(prec)), #precision of q-expansions -- removed, does not make much sense for the space here
            WebSageObject('group'),
            WebInt('sturm_bound'),
            WebHeckeOrbits('hecke_orbits', level, weight,
                           character, self,  prec=prec, include_in_update=update_hecke_orbits),
            WebList('oldspace_decomposition', required=False),
            WebInt('bitprec', value=bitprec),
            WebFloat('version', value=float(emf_version), save_to_fs=True),
            WebList('zeta_orders',value=[],save_to_db=True),
            WebDate('creation_date',value=None,save_to_db=True)
                    )

        self.make_code_snippets()
            
        emf_logger.debug("Have set properties of space 1 !!")
        super(WebModFormSpace, self).__init__(update_from_db=update_from_db, **kwargs)
        emf_logger.debug("Have set properties of space 2 !!")
        emf_logger.debug("orbits={0}".format(self.hecke_orbits))                
コード例 #4
0
ファイル: web_character.py プロジェクト: sibilant/lmfdb
    def __init__(self,
                 modulus=1,
                 number=1,
                 update_from_db=True,
                 compute=False):
        r"""
        Init self.

        """
        emf_logger.critical("In WebChar {0}".format(
            (modulus, number, update_from_db, compute)))
        if not gcd(number, modulus) == 1:
            raise ValueError, "Character number {0} of modulus {1} does not exist!".format(
                number, modulus)
        if number > modulus:
            number = number % modulus
        self._properties = WebProperties(
            WebInt('conductor'), WebInt('modulus', value=modulus),
            WebInt('number', value=number), WebInt('modulus_euler_phi'),
            WebInt('order'), WebStr('latex_name'),
            WebStr('label', value="{0}.{1}".format(modulus, number)),
            WebNoStoreObject('sage_character', type(trivial_character(1))),
            WebDict('_values_algebraic'), WebDict('_values_float'),
            WebDict('_embeddings'),
            WebFloat('version', value=float(emf_version)))
        emf_logger.debug('Set properties in WebChar!')
        super(WebChar, self).__init__(update_from_db=update_from_db)
        if self._has_updated_from_db is False:
            self.init_dynamic_properties(
            )  # this was not done if we exited early
            compute = True
        if compute:
            self.compute(save=True)

        #emf_logger.debug('In WebChar, self.__dict__ = {0}'.format(self.__dict__))
        emf_logger.debug('In WebChar, self.number = {0}'.format(self.number))
コード例 #5
0
ファイル: web_newforms.py プロジェクト: sibilant/lmfdb
    def __init__(self,
                 hecke_orbit_label,
                 prec=10,
                 update_from_db=True,
                 auto_update=True,
                 init_dynamic_properties=True):
        self._properties = WebProperties(
            WebSageObject('E', None, Matrix), WebSageObject('v', None, vector),
            WebDict('meta', value={}),
            WebStr('hecke_orbit_label', value=hecke_orbit_label),
            WebInt('prec', value=prec))

        self.auto_update = True
        self._ap = {}
        super(WebEigenvalues,
              self).__init__(use_gridfs=True,
                             use_separate_db=False,
                             update_from_db=update_from_db,
                             init_dynamic_properties=init_dynamic_properties)
コード例 #6
0
ファイル: web_newforms.py プロジェクト: sibilant/lmfdb
    def __init__(self,
                 level=1,
                 weight=12,
                 character=1,
                 label='a',
                 prec=None,
                 parent=None,
                 update_from_db=True):
        emf_logger.critical("In WebNewForm {0}".format(
            (level, weight, character, label, parent, update_from_db)))
        self._reduction = (type(self), (level, weight, character, label), {
            'parent': parent,
            'update_from_db': update_from_db
        })
        if isinstance(character, WebChar):
            character_number = character.number
        else:
            character_number = character
            character = None if parent is None else parent.character
            if not isinstance(label, basestring):
                if isinstance(label, (int, Integer)):
                    label = orbit_label(label)
                else:
                    raise ValueError, "Need label either string or integer! We got:{0}".format(
                        label)

        emf_logger.critical("Before init properties 0")
        self._properties = WebProperties(
            WebInt('level', value=level), WebInt('weight', value=weight),
            WebCharProperty(
                'character',
                modulus=level,
                number=character_number,
                value=character,
                include_in_update=True if character is None else False),
            WebStr('character_naming_scheme', value='Conrey'),
            WebStr('hecke_orbit_label',
                   default_value=newform_label(level, weight, character_number,
                                               label)),
            WebStr('label', default_value=label), WebInt('dimension'),
            WebqExp('q_expansion'), WebDict('_coefficients'),
            WebDict('_embeddings'), WebInt('prec', value=0),
            WebNumberField('base_ring'), WebNumberField('coefficient_field'),
            WebInt('coefficient_field_degree'),
            WebList('twist_info', required=False),
            WebBool('is_cm', required=False),
            WebDict('_cm_values', required=False),
            WebBool('is_cuspidal', default_value=True),
            WebDict('satake', required=False),
            WebDict('_atkin_lehner_eigenvalues', required=False),
            WebBool('is_rational'), WebPoly('absolute_polynomial'),
            WebFloat('version', value=float(emf_version), save_to_fs=True),
            WebDict('explicit_formulas', required=False),
            WebModFormSpaceProperty('parent',
                                    value=parent,
                                    level=level,
                                    weight=weight,
                                    character=character_number,
                                    update_hecke_orbits=False)
            #                                    include_in_update = True if parent is None
            #                                    else False),
        )
        emf_logger.critical("After init properties 1")
        super(WebNewForm, self).__init__(update_from_db=update_from_db)
        emf_logger.critical("After init properties 2 prec={0}".format(
            self.prec))
        # We're setting the WebEigenvalues property after calling __init__ of the base class
        # because it will set hecke_orbit_label from the db first

        ##
        ## We don't init the eigenvalues (since E*v is slow)
        ## unless we (later) request a coefficient which is not
        ## in self._coefficients

        self.eigenvalues = WebEigenvalues(self.hecke_orbit_label,
                                          prec=self.prec,
                                          init_dynamic_properties=False)
        emf_logger.critical("After init properties 3")