当前位置: 首页>>代码示例>>Python>>正文


Python HilbertNumberField.degree方法代码示例

本文整理汇总了Python中lmfdb.hilbert_modular_forms.hilbert_field.HilbertNumberField.degree方法的典型用法代码示例。如果您正苦于以下问题:Python HilbertNumberField.degree方法的具体用法?Python HilbertNumberField.degree怎么用?Python HilbertNumberField.degree使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在lmfdb.hilbert_modular_forms.hilbert_field.HilbertNumberField的用法示例。


在下文中一共展示了HilbertNumberField.degree方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: create_from_data_string

# 需要导入模块: from lmfdb.hilbert_modular_forms.hilbert_field import HilbertNumberField [as 别名]
# 或者: from lmfdb.hilbert_modular_forms.hilbert_field.HilbertNumberField import degree [as 别名]
    def create_from_data_string(self, label_or_field, L):
        """Takes an input line L from a raw data file and constructs the
        associated HMF object with given base field.

        String sample:
        <[31, 31, w + 12], "a", [-3, -2, 2, 4, -4, ...]>,
        """
        data = self.dbdata = {}
        if isinstance(label_or_field, str):
            label = label_or_field
            data['field_label'] = label
            F = HilbertNumberField(label)
            if not F:
                raise ValueError("No Hilbert number field with label %s is in the database" % label)
        elif label_or_field == None:
            raise ValueError("Must specify a valid field label")
        else: # we were passed a HilbertNumberField already
            F = label_or_field
            data['field_label'] = F.label
        #print("data['field_label'] = %s" % data['field_label'])

        # The level

        i = L.find('[')
        j = L.find(']')
        data['level_ideal'] = L[i:j+1]
        #print("data['level_ideal'] = %s" % data['level_ideal'])
        N, n, alpha = data['level_ideal'][1:-1].split(',')
        data['level_norm'] = int(N)
        #print("data['level_norm'] = %s" % data['level_norm'])
        level = F.ideal_from_str(data['level_ideal'])[2]
        #print("level = %s" % level)
        data['level_label'] = F.ideal_label(level)
        #print("data['level_label'] = %s" % data['level_label'])

        # The weight

        data['parallel_weight'] = int(2)
        data['weight'] = str([data['parallel_weight']] * F.degree())
        weight = [2] * F.degree()

        # The label

        i = L.find('"')
        j = L.find('"', i+1)
        data['label_suffix'] = L[i+1:j].replace(" ","")

        data['label'] = construct_full_label(data['field_label'],
                                             weight,
                                             data['level_label'],
                                             data['label_suffix'])
        data['short_label'] = '-'.join([data['level_label'], data['label_suffix']])
        #print("data['label'] = %s" % data['label'] )
        #print("data['short_label'] = %s" % data['short_label'] )

        # The hecke polynomial and degree

        if 'x' in L:
            # non-rational
            i = L.find("x")
            j = L.find(i+1,",")
            data['hecke_polynomial'] = pol = L[i:j]
            data['dimension'] = int(1)
            x = polygen(QQ)
            hpol = x.parent()(str(pol))
            data['dimension'] = int(hpol.degree())
        else:
            # rational
            data['hecke_polynomial'] = 'x'
            data['dimension'] = int(1)

        i = L.rfind("[")
        j = L.rfind("]")
        data['hecke_eigenvalues'] = L[i+1:j].replace(" ","").split(",")
        data['hecke_eigenvalues'] = [unicode(s) for s in data['hecke_eigenvalues']]
        #print("hecke_eigenvalues = %s..." % data['hecke_eigenvalues'][:20])

        # Find (some of the) AL-eigenvalues

        BP = level.prime_factors()
        BP_indices = [F.prime_index(P) for P in BP]
        print("BP_indices = %s" % BP_indices)
        BP_exponents = [level.valuation(P) for P in BP]
        #print("BP_exponents = %s" % BP_exponents)
        AL_eigs = [int(data['hecke_eigenvalues'][k]) for k in BP_indices]
        #print("AL_eigs      = %s" % AL_eigs)
        if not all([(e==1 and eig in [-1,1]) or (eig==0)
                    for e,eig in zip(BP_exponents,AL_eigs)]):
            print("Some bad AL-eigenvalues found")
        # NB the following will put 0 for the eigenvalue for primes
        # whose quare divides the level; this will need fixing later.
        data['AL_eigenvalues'] = [[F.primes[k],data['hecke_eigenvalues'][k]] for k in BP_indices]

        data['is_CM'] = '?'
        data['is_base_change'] = '?'
开发者ID:koffie,项目名称:lmfdb,代码行数:97,代码来源:web_HMF.py


注:本文中的lmfdb.hilbert_modular_forms.hilbert_field.HilbertNumberField.degree方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。