Example #1
0
 def _display_im(self, y, prec):
     if abs(y) < 10**(-prec):
         return ""
     res = display_float(y, prec)
     if res == '1':
         res = ''
     return r"%s<em>i</em>"%(res)
Example #2
0
    def embedding(self, m, n=None, prec=6, format='embed'):
        """
        Return the value of the ``m``th embedding on a specified input.
        Should only be used when all of the entries in this column are either real
        or imaginary.

        INPUT:

        - ``m`` -- an integer, specifying which embedding to use.
        - ``n`` -- a positive integer, specifying which a_n.  If None, returns the image of
            the generator of the field (i.e. the root corresponding to this embedding).
        - ``prec`` -- the precision to display floating point values
        - ``format`` -- either ``embed`` or ``analytic_embed``.  In the second case, divide by n^((k-1)/2).
        """
        if n is None:
            x = self.cc_data[m].get('embedding_root_real', None)
            y = self.cc_data[m].get('embedding_root_imag', None)
            if x is None or y is None:
                return '?' # we should never see this if we have an exact qexp
        else:
            x, y = self.cc_data[m]['an'][n]
            if format == 'analytic_embed':
                x *= self.analytic_shift[n]
                y *= self.analytic_shift[n]
        if self.cc_data[m]['real']:
            return display_float(x, prec)
        else:
            return display_complex(x, y, prec)
Example #3
0
 def _display_re(self, x, prec, method='round', extra_truncation_digits=3):
     res = display_float(x, prec,
             method=method,
             extra_truncation_digits=extra_truncation_digits,
             try_halfinteger=False)
     if res == "0":
         return ""
     else:
         return res.replace('-','&minus;')
Example #4
0
 def _display_im(self, y, prec, method='round', extra_truncation_digits=3):
     res = display_float(y, prec,
             method=method,
             extra_truncation_digits=extra_truncation_digits,
             try_halfinteger=False)
     if res == "0":
         return ""
     elif res == "1":
         res = ""
     return r"%s<em>i</em>"%(res)
Example #5
0
 def satake_angle(self, m, p, i, prec=6):
     theta = self._get_theta(m, p, i)
     s = display_float(2*theta, prec)
     if s == "1":
         s =  r'\pi'
     elif s== "-1":
         s =  r'-\pi'
     elif s != "0":
         s += r'\pi'
     return r'\(%s\)'%s
Example #6
0
 def frob_angles(self):
     ans = ""
     eps = 0.00000001
     for angle in self.angles:
         angstr = display_float(angle, 12, 'round')
         if ans != "":
             ans += ", "
         if abs(angle) > eps and abs(angle - 1) > eps:
             angle = r"$\pm" + angstr + "$"
         else:
             angle = "$" + angstr + "$"
         ans += angle
     return ans
Example #7
0
 def satake_angle(self, m, p, i, prec=6):
     if not self.character_values[p]:
         # bad prime
         return ''
     theta = self._get_theta(m, p, i)
     s = display_float(2*theta, prec, method='round')
     if s == "1":
         s =  r'\pi'
     elif s== "-1":
         s =  r'-\pi'
     elif s != "0":
         s += r'\pi'
     return r'\(%s\)'%s
Example #8
0
 def _display_re(self, x, prec):
     if abs(x) < 10**(-prec):
         return ""
     return r"%s"%(display_float(x, prec).replace('-','&minus;'))
Example #9
0
    def general_webpagedata(self):
        info = {}
        try:
            info['support'] = self.support
        except AttributeError:
            info['support'] = ''

        info['Ltype'] = self.Ltype()

        try:
            info['label'] = self.label
        except AttributeError:
            info['label'] = ""

        try:
            info['credit'] = self.credit
        except AttributeError:
            info['credit'] = ""

        info['degree'] = int(self.degree)
        info['conductor'] = self.level
        if not is_prime(int(self.level)) and int(self.level) != 1:
            if self.level >= 10**8:
                info['conductor'] = latex(self.level_factored)
            else:
                info['conductor_factored'] = latex(self.level_factored)
        if self.analytic_conductor:
            info['analytic_conductor'] = display_float(
                self.analytic_conductor,
                6,
                extra_truncation_digits=40,
                latex=True)
            info['root_analytic_conductor'] = display_float(
                self.root_analytic_conductor,
                6,
                extra_truncation_digits=40,
                latex=True)
        else:
            info['analytic_conductor'] = self.analytic_conductor
            info['root_analytic_conductor'] = self.root_analytic_conductor
        if self.rational is not None:
            info['rational'] = 'yes' if self.rational else 'no'

        info['sign'] = "$" + styleTheSign(self.sign) + "$"
        info['algebraic'] = self.algebraic
        info['arithmetic'] = 'yes' if self.arithmetic else 'no'
        if self.selfdual:
            info['selfdual'] = 'yes'
        else:
            info['selfdual'] = 'no'
        if self.primitive:
            info['primitive'] = 'yes'
        else:
            info['primitive'] = 'no'
        info['dirichlet'] = lfuncDShtml(self, "analytic")
        # Hack, fix this more general?
        info['dirichlet'] = info['dirichlet'].replace('*I', '<em>i</em>')

        info['eulerproduct'] = lfuncEPtex(self, "abstract")
        info['functionalequation'] = lfuncFEtex(self, "analytic")
        info['functionalequationSelberg'] = lfuncFEtex(self, "selberg")

        if hasattr(self, 'positive_zeros'):
            info['positive_zeros'] = self.positive_zeros
            info['negative_zeros'] = self.negative_zeros

        if hasattr(self, 'plot'):
            info['plot'] = self.plot

        if hasattr(self, 'factorization'):
            info['factorization'] = self.factorization

        if self.fromDB and self.algebraic:
            info['dirichlet_arithmetic'] = lfuncDShtml(self, "arithmetic")
            info['eulerproduct_arithmetic'] = lfuncEPtex(self, "arithmetic")
            info['functionalequation_arithmetic'] = lfuncFEtex(
                self, "arithmetic")

            if self.motivic_weight % 2 == 0:
                arith_center = "\\frac{" + str(1 +
                                               self.motivic_weight) + "}{2}"
            else:
                arith_center = str(ZZ(1) / 2 + self.motivic_weight / 2)
            svt_crit = specialValueTriple(self, 0.5, '\\frac12', arith_center)
            info['sv_critical'] = svt_crit[0] + "\\ =\\ " + svt_crit[2]
            info['sv_critical_analytic'] = [
                svt_crit[0],
                scientific_notation_helper(svt_crit[2])
            ]
            info['sv_critical_arithmetic'] = [
                svt_crit[1],
                scientific_notation_helper(svt_crit[2])
            ]

            if self.motivic_weight % 2 == 1:
                arith_edge = "\\frac{" + str(2 + self.motivic_weight) + "}{2}"
            else:
                arith_edge = str(ZZ(1) + self.motivic_weight / 2)

            svt_edge = specialValueTriple(self, 1, '1', arith_edge)
            info['sv_edge'] = svt_edge[0] + "\\ =\\ " + svt_edge[2]
            info['sv_edge_analytic'] = [
                svt_edge[0],
                scientific_notation_helper(svt_edge[2])
            ]
            info['sv_edge_arithmetic'] = [
                svt_edge[1],
                scientific_notation_helper(svt_edge[2])
            ]

            chilatex = r"$\chi_{" + str(self.charactermodulus) + "} (" + str(
                self.characternumber) + r", \cdot )$"
            info['chi'] = ''
            if self.charactermodulus != self.level:
                info['chi'] += "induced by "
            info['chi'] += '<a href="' + url_for(
                'characters.render_Dirichletwebpage',
                modulus=self.charactermodulus,
                number=self.characternumber)
            info['chi'] += '">' + chilatex + '</a>'

            info['st_group'] = self.st_group
            info['st_link'] = self.st_link
            info['rank'] = self.order_of_vanishing
            info['motivic_weight'] = r'\(%d\)' % self.motivic_weight

        elif self.Ltype() == "riemann":
            info['sv_edge'] = r"\[\zeta(1) \approx $\infty$\]"
            info['sv_critical'] = r"\[\zeta(1/2) \approx -1.460354508\]"

        elif self.Ltype() != "artin" or (self.Ltype() == "artin"
                                         and self.sign != 0):
            try:
                info['sv_edge'] = specialValueString(self, 1, '1')
                info['sv_critical'] = specialValueString(self, 0.5, '1/2')
            except Exception:
                info['sv_critical'] = "L(1/2): not computed"
                info['sv_edge'] = "L(1): not computed"

        return info