From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Sho Takemori Newsgroups: gmane.emacs.bugs Subject: bug#24117: 25.1; url-http-create-request: Multibyte text in HTTP request Date: Sun, 31 Jul 2016 17:26:37 +0900 Message-ID: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a1134e8d40621d60538ea3e48 X-Trace: blaine.gmane.org 1469953725 9907 80.91.229.8 (31 Jul 2016 08:28:45 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 31 Jul 2016 08:28:45 +0000 (UTC) To: 24117@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Jul 31 10:28:27 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bTm6k-0002Ux-Am for geb-bug-gnu-emacs@m.gmane.org; Sun, 31 Jul 2016 10:28:27 +0200 Original-Received: from localhost ([::1]:38794 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bTm6g-0007Pl-Dl for geb-bug-gnu-emacs@m.gmane.org; Sun, 31 Jul 2016 04:28:22 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48148) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bTm6T-0007Pb-VQ for bug-gnu-emacs@gnu.org; Sun, 31 Jul 2016 04:28:15 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bTm6N-0007U1-1i for bug-gnu-emacs@gnu.org; Sun, 31 Jul 2016 04:28:08 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:54634) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bTm6M-0007Tx-Sl for bug-gnu-emacs@gnu.org; Sun, 31 Jul 2016 04:28:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bTm6M-0007K8-Lr for bug-gnu-emacs@gnu.org; Sun, 31 Jul 2016 04:28:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Sho Takemori Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 31 Jul 2016 08:28:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 24117 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.146995362828071 (code B ref -1); Sun, 31 Jul 2016 08:28:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 31 Jul 2016 08:27:08 +0000 Original-Received: from localhost ([127.0.0.1]:51931 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bTm5S-0007Ig-EA for submit@debbugs.gnu.org; Sun, 31 Jul 2016 04:27:08 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:57124) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bTm5P-0007IB-Gf for submit@debbugs.gnu.org; Sun, 31 Jul 2016 04:27:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bTm5E-0007RR-2i for submit@debbugs.gnu.org; Sun, 31 Jul 2016 04:26:58 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:35247) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bTm5D-0007RN-Ut for submit@debbugs.gnu.org; Sun, 31 Jul 2016 04:26:52 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48093) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bTm57-0006oK-Ds for bug-gnu-emacs@gnu.org; Sun, 31 Jul 2016 04:26:50 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bTm51-0007Qy-A7 for bug-gnu-emacs@gnu.org; Sun, 31 Jul 2016 04:26:44 -0400 Original-Received: from mail-oi0-x234.google.com ([2607:f8b0:4003:c06::234]:34913) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bTm50-0007Qs-W4 for bug-gnu-emacs@gnu.org; Sun, 31 Jul 2016 04:26:39 -0400 Original-Received: by mail-oi0-x234.google.com with SMTP id l72so157984024oig.2 for ; Sun, 31 Jul 2016 01:26:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to; bh=1cStMDGtB3epXJphuMAUB2z4hBtl9c/shE20mHdre2k=; b=Nm+z3js403WybuskhmtzZO4H7/8JwVrSuw6NNR6LJkspxTod8EHQYX5CuK0ThJkayz +u62WanPBYmmQgfujfszN9gx6cucCc735ZY+lL62FjBYyX/w3xzXFwf3ijqFn4NKAkC8 zs5lffe2eqUdnQmaGEVdRQ2P+1JHeyyZcZWnBN1rbKHlwocZgiCyigWdGWYlbV3tyL4N dQYMSnbZJks6gJHaOgs/di9hFBMQSJbaJDDJx24QoiAZQut2Ks2nLpRnpQUOp8cbFbvh BulT/XS6T/k08JgdpX/UlhQ5IsgPeZXQRQJeGhOEevXG+mXIOL3cgE9SB47Z1DBDD/v0 IeJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=1cStMDGtB3epXJphuMAUB2z4hBtl9c/shE20mHdre2k=; b=mHXzEioO+lJWuJwT9wSqyLZHpP7rK8J5GCDH0G1guwPcvqO8NVjmbNpXiS+3LhnoW3 6ww8WfUUcrW76Q2ZgSLCtaTuXbvdNSS+JItu54qFb+jda8hu8nW+g0G2ThAPchE/z+Zm uYM91sTtMzT0kQLaD6daCX9sjA82P+zaVLuSUVv/E3xEGh9XA6wgUsPnjLBi6kU72JrB AkUuu5e5GaSYFa7JBwAKL41BAoiTaHaU2X/V3HRccPxbT4+E7YqBK5aMvZMqPVohHWea bLwBnNMYtmI8Ys4rgfWvEzhjrLBA2HoXd9HHcc4cku0o5flOoffvyf5U1QoPfWjDKZfs qBcg== X-Gm-Message-State: AEkoouvOokfyJHfFZUI29uWX78ZvHeNoM4Hy9IxspM55U/dCU7SfRS+PjmryrXj9+/WUERYjGJBlcITQa4ue2Q== X-Received: by 10.202.236.71 with SMTP id k68mr27411857oih.162.1469953597642; Sun, 31 Jul 2016 01:26:37 -0700 (PDT) Original-Received: by 10.157.33.77 with HTTP; Sun, 31 Jul 2016 01:26:37 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:121731 Archived-At: --001a1134e8d40621d60538ea3e48 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable I got an error "error in process sentinel: url-http-create-request: Multibyte text in HTTP request" when I visited a Python file which contains a multibyte character with `anaconda-eldoc-mode' turned on. At first, I thought this was a bug of anaconda-mode. So I opened an issue in github (https://github.com/proofit404/anaconda-mode/issues/189). I guess `(=3D (string-bytes request) (length request))` in `url-http-create-request' should be `(=3D (string-bytes url-http-data) (length url-http-data))`, because `(=3D (string-bytes request) (length request))` may be `nil' even if `(=3D (string-bytes url-http-data) (length url-http-data))` is `t'. Sho Takemori In GNU Emacs 25.1.1 (x86_64-pc-linux-gnu, GTK+ Version 3.18.9) of 2016-07-26 built on HP-500-270jp Repository revision: 0f0b191a5324115fe9e8c438eceef4043decf209 Windowing system distributor 'The X.Org Foundation', version 11.0.11803000 System Description: Ubuntu 16.04.1 LTS Configured using: 'configure --with-sound=3Dno --with-modules' Configured features: XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK GPM DBUS GCONF GSETTINGS NOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 MODULES Important settings: value of $LC_MONETARY: ja_JP.UTF-8 value of $LC_NUMERIC: ja_JP.UTF-8 value of $LC_TIME: ja_JP.UTF-8 value of $LANG: ja_JP.UTF-8 value of $XMODIFIERS: @im=3Dibus locale-coding-system: utf-8-unix Major mode: Lisp Interaction Minor modes in effect: diff-auto-refine-mode: t shell-dirtrack-mode: t tooltip-mode: t global-eldoc-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Recent messages: MIME-Version: 1.0 Connection: keep-alive Extension: Security/Digest Security/SSL Host: 127.0.0.1:9001 Accept-encoding: gzip Accept: */* User-Agent: URL/Emacs Content-length: 20552 {"jsonrpc":"2.0","id":1,"method":"eldoc","params":{"source":"# -*- coding: utf-8 -*-\nimport itertools\nfrom itertools import groupby\n\nfrom sage.all import mul\nfrom sage.arith.all import kronecker_symbol\nfrom sage.functions.all import ceil, floor, sgn\nfrom sage.matrix.all import (block_diagonal_matrix, block_matrix,\n diagonal_matrix, identity_matrix, matrix)\nfrom sage.misc.all import cached_function\nfrom sage.quadratic_forms.all import QuadraticForm, least_quadratic_nonresidue\nfrom sage.rings.all import QQ, ZZ, CyclotomicField, FiniteField, PolynomialRing\n\n\ndef _index_of_gamma_0_gl_n(alpha, p):\n =E2=80=99=E2=80=99=E2=80=99\n Ret= urns delta(a1, ..., an) defined in Shimura, Euler products and Eisenstein\n series, pp 118, (15.1.7).\n =E2=80=99=E2=80=99=E2=80=99\n if p in ZZ:\n p =3D = ZZ(p)\n\n def _bn(n):\n return mul(1 - p ** (-i) for i in xrange(1, n + 1))\n\n e_r_ls = =3D [(k, len(list(v)))\n for k, v in groupby(sorted(alpha), lambda x: x)]\n res =3D _bn(len(alpha)) / mul(_bn(r) for _, r in e_r_ls)\n f= or i, (ei, ri) in enumerate(e_r_ls):\n for j, (ej, rj) in enumerate(e_r_ls):\n if i < j:\n res *=3D p ** ((= ej - ei) * ri * rj)\n return res\n\n\ndef _gl2_coset_gamma0(a, p):\n w = =3D matrix([[0, -1],\n [1, 0]])\n for m12 in range(p ** a):\n yield matrix([[1, m12],\n [0, 1]])\n for m21 in range(p ** (a - 1)):\n m =3D matrix([[1, 0],\n [p * m21, 1]])\n yield w * m\n\n\ndef _gl3_coset_gamma0(alpha, p):\n r=E2=80=99=E2=80=99=E2=80=99\n Let alpha =3D [a0, a1, a2] with = a0 <=3D a1 <=3D a2,\n g =3D diag([p^a0, p^a1, p^a2]), and Gamma0 =3D g^(-1) GL3(Z) g =E2=88=A7 GL3(Z).\= n Return a complete set Gamma0 \\ GL3(Z).\n =E2=80=99=E2=80=99=E2=80=99\n= if p in ZZ:\n p =3D ZZ(p)\n a0, a1, a2 =3D alpha\n if a0 < a1 < a2:\n retur= n list(__gl3_coset_gamma0_distinct(a0, a1, a2, p))\n elif a0 =3D=3D a1 and= a1 < a2:\n return list(__gl3_coset_gamma0_2_1(a0, a2, p))\n elif a0 < a1 and a1 =3D=3D a2:\n return list(__gl3_coset_gamma0_1_2(a0, a2, p))\n elif a0 =3D=3D a1 =3D=3D a2:\n return [identity_matrix(ZZ, = 3)]\n else:\n raise ValueError\n\n\ndef __gl3_coset_gamma0_2_1(a1, a3, p):\n w23 =3D matrix([[1, 0, 0],\n [0, 0, 1],\n [0, 1, 0]])\n for m13 in range(p ** (a3 - a1 - 1)):\n for m23 in range(p ** (a3 - a1 - 1)):\n m =3D matrix([[1, 0, p * m13],\n [0, 1, p * m23],\n [0, 0, 1]])\n yield m\n\n for m32 in range(p ** (a3 - a1)):\n m =3D matrix([[1, 0, 0],\n [0, 1, 0],\n [0, m32, 1]])\n for g in _gl2_coset_gamma0(a3 - a1, p):\n n =3D block_diagonal_matrix(g, matrix([[1]]))\n yield w23 * m * n\n\n\ndef __gl3_coset_gamma0_1_2(a1, a2, p):\n w12 =3D matrix([[0, 1, 0],\n [1, 0, 0],\n [0, 0, 1]])\n\n for m12 in range(p ** (a2 - a1 - 1)):\n for m13 in range(p ** (a2 - a1 - 1)):\n m =3D matrix([[1, p * m12, p * m13],\n [0, 1, 0],\n [0, 0, 1]])\n yield m\n for m21 in range(p ** (a2 - a1)):\n m =3D matrix([[1, 0, 0],\n [m21, 1, 0],\n [0, 0, 1]])\n for g in _gl2_coset_gamma0(a2 - a1, p):\n n =3D block_diagonal_matrix(matrix([[1]]), g)\n yield w12 * m * n\n\n\ndef __gl3_coset_gamma0_distinct(a1, a2, a3, p):\n\n w12 =3D matrix([[0, 1, 0],\n [1, 0, 0],\n [0, 0, 1]])\n\n w23 =3D matrix([[1, 0, 0],\n [0, 0, 1],\n [0, 1, 0]])\n\n w13 =3D matrix([[0, 0, 1],\n [0, 1, 0],\n [1, 0, 0]])\n\n w123 =3D matrix([[0, 1, 0],\n [0, 0, 1],\n [1, 0, 0]])\n\n w132 =3D matrix([[0, 0, 1],\n [1, 0, 0],\n [0, 1, 0]])\n\n # w =3D 1\n for m12 in range(p ** (a2 - a1 - 1)):\n for m13 in range(p ** (a3 - a1 - 1)):\n for m23 in range(p ** (a3 - a2 - 1)):\n yield matrix([[1, p * m12, p * m13],\n [0, 1, p * m23],\n [0, 0, 1]])\n # w =3D (12)\n for m13 in range(p ** (a3 - a2 - 1)):\n for m21 in range(p ** (a2 - a1)):\n for m23 in range(p ** (a3 - a1 - 1)):\n m =3D matrix([[1, 0, p * m13],\n [m21, 1, p * m23],\n [0, 0, 1]])\n yield w12 * m\n # w =3D (23)\n for m12 in range= (p ** (a3 - a1 - 1)):\n for m13 in range(p ** (a2 - a1 - 1)):\n for m32 in range(p ** (a3 - a2)):\n m =3D matrix([[1, p * m12, p * m13],\n [0, 1, 0],\n [0, m32, 1]])\n yield w23 * m\n\n # w =3D (13)\n for m21 in range(p ** (a3 - a2)):\n for m31 in range(p ** (a3 - a1)):\n for m32 in range(p ** (a2 - a1)):\n m =3D matrix([[1, 0, 0],\n [m21, 1, 0],\n [m31, m32, 1]])\n yield w13 * m\n\n # w = =3D (123)\n for m21 in range(p ** (a3 - a1)):\n for m23 in range(p ** (a2 - a1 - 1)):\n for m31 in range(p ** (a3 - a2)):\n m =3D matrix([[1, 0, 0],\n [m21, 1, p * m23],\n [m31, 0, 1]])\n yield w123 * m\n # w =3D (132)\n for m12 in range(p ** (a3 - a2 - 1)):\n for m31 in range(p ** (a2 - a1)):\n for m32 in range(p ** (a3 - a1)):\n m =3D matrix([[1, p * m12, 0],\n [0, 1, 0],\n [m31, m32, 1]])\n yield w132 * m\n\n\nclass HalfIntMatElement(object):\n\n def __init__(self, T):\n =E2=80=99=E2=80=99=E2=80=99\n :params T:= half integral matrix of size 3 or a list\n =E2=80=99=E2=80=99=E2=80=99\n if isinstanc= e(T, list):\n a, b, c, d, e, f =3D [ZZ(x) for x in T]\n mat =3D matrix([[a, f= / 2, e / 2],\n [f / 2, b, d / 2],\n [e / 2, d / 2, c]])\n else:\n mat =3D T\n self.__entries =3D tuple(mat.list())\n\n def __eq__(self, other):\n if isinstance(other, HalfIntMatElement):\n return self.__entries =3D=3D other.__entries\n else:\n raise NotImplementedError\n\n def __repr__(self):\n return self.T.__repr__()\n\n def __hash__(self):\n return hash(self.__entries)\n\n @property\n def T(self):\n return matrix(3, self.__entries)\n\n def right_action(self, g):\n =E2=80= =99=E2=80=99=E2=80=99\n :param g: matrix of size n\n return self[g] (Siegel=E2=80=99s notation)\n =E2=80=99=E2=80=99=E2=80=99\n S =3D g.transpose()= * self.T * g\n return HalfIntMatElement(S)\n\n def satisfy_cong_condition_tp(self, p, alpha):\n =E2=80=99=E2=80=99=E2=80=99\n Test if sum_{B mod D}= exp(2pi T B D^(-1)) is zero, where D =3D diag(p^a1, p^a2, a^a3),\n a1, a2, a3 =3D alpha.\n =E2=80=99=E2=80=99=E2=80=99\n return (all(ZZ(self.T[i, i]) % p **= alpha[i] =3D=3D 0 for i in range(3)) and\n all(ZZ(self.T[i, j] * 2) % p ** alpha[i] =3D= =3D 0\n for i in range(3) for j in range(i + 1, 3)))\n\n def is_divisible_by(self, m):\n =E2=80=99=E2=80=99=E2=80=99\n = Test if self is divisible by m\n :param m: integer\n =E2=80=99=E2=80=99=E2=80= =99\n return _half_int_mat_is_div_by(self.T, m)\n\n def __floordiv__(self, other):\n S =3D matrix(QQ, 3)\n for i in range(3):\n S[i, i]= =3D ZZ(self.T[i, i]) // other\n for i in range(3):\n for j in range(i + 1, 3):\n S[i, j] =3D S[j, i] =3D (ZZ(self.T[i, j] = * 2) // other) / 2\n return HalfIntMatElement(S)\n\n\ndef alpha_list(dl):\n =E2=80=99=E2=80=99=E2=80=99\n Return a list of (a0,= a1, a2) with 0 <=3D a0 <=3D a1 <=3D a2 <=3D dl\n =E2=80=99=E2=80=99=E2=80=99\n return [(a0, a1, a= 2) for a0 in range(dl + 1)\n for a1 in range(a0, dl + 1) for a2 in range(a1, dl + 1)]\n\n\ndef tp_action_fourier_coeff(p, T, F):\n =E2=80=99=E2=80=99=E2= =80=99\n Return the Tth Fourier coefficient of F|T(p), where F is a modular form.\n :param p: a prime number\n :param T: a half integral matrix or an instance of HalfIntMatElement\n :param F: a dictionary or a Siegel modular form of degree 3\n =E2=80=99=E2=80=99=E2=80=99\n p =3D ZZ(p)\n return _action_fc_base(tp_action_fc_alist(p, T), F, T)\n\n\ndef tp2_action_fourier_coeff(p, i, T, F):\n =E2=80=99=E2=80=99=E2=80=99\n = Similar to tp_action_fourier_coeff for T_i(p^2).\n =E2=80=99=E2=80=99=E2=80=99\n = p =3D ZZ(p)\n return _action_fc_base(tp2_action_fc_alist(p, T, i), F, T)\n\n\ndef _action_fc_base(ls, F, T):\n if not isinstance(T, HalfIntMatElement):\n T =3D HalfIntMatElement(T)\n res =3D 0\n for s, a, g in ls:\n res =3D a * F[s].left_action(g) + res\n return res\n\n\ndef hecke_eigenvalue_tp(p, F, T=3DNone):\n =E2=80=99=E2=80=99=E2=80=99\n = p, F, T: same as aruments of tp_action_fourier_coeff.\n Assuming F is an eigenform, return the eigenvalue for T(p),\n T is used for the computation of Fourier coefficients.\n If T is omitted, T will be set to\n matrix([[1, 1/2, 1/2], [1/2, 1, 1/2], [1/2, 1/2, 1]]).\n =E2=80=99=E2=80=99=E2=80=99\n = return _hecke_eigenvalue_base(lambda s: tp_action_fourier_coeff(p, s, F), F, T=3DT)\n\n\ndef hecke_eigenvalue_tp2(p, i, F, T=3DNone):\n =E2=80=99=E2= =80=99=E2=80=99\n Similar to hecke_eigenvalue_tp for T(p^2).\n =E2=80=99=E2=80=99=E2=80=99\n re= turn _hecke_eigenvalue_base(lambda s: tp2_action_fourier_coeff(p, i, s, F), F, T=3DT)\n\n\ndef spinor_l_euler_factor(p, F, t=3DNone, T=3DNone):\n =E2= =80=99=E2=80=99=E2=80=99\n F: a dict or Siegel modular form of degree 3.\n Return a polynomial G(t) of degree 8, s.t.\n G(p^(-s))^(-1) is the p-Euler factor of the spinor L function of F.\n =E2=80=99=E2=80=99=E2=80=99\n p =3D ZZ(p)\n if t = is None:\n t =3D PolynomialRing(QQ, 1, names=3D=E2=80=99t=E2=80=99, order=3D\"neglex\").gens= ()[0]\n c =3D {}\n tp =3D hecke_eigenvalue_tp(p, F, T=3DT)\n tpp1, tpp2, tpp3 =3D [hecke_eigenvalue_tp2(p, i, F, T=3DT) for i in [1, 2, 3]]\n c[0] =3D ZZ(= 1)\n c[1] =3D tp\n c[2] =3D p * (tpp1 + (p**2 + 1) * tpp2 + (p**2 + 1)**2 = * tpp3)\n c[3] =3D p**3 * tp * (tpp2 + tpp3)\n c[4] =3D p**6 * (tp**2 * tpp3 + tpp2**2 - 2 * p * tpp1 * tpp3 -\n 2 * (p - 1) * tpp2 * tpp3 -\n (p**6 + 2 * p**5 + 2 * p**3 + 2 * p - 1) * tpp3**2)\n c[5] =3D p**6 * tpp3 * c[3]\n c[6] =3D p**12 * tpp3 ** 2= * c[2]\n c[7] =3D p**18 * tpp3 ** 3 * c[1]\n c[8] =3D p**24 * tpp3 ** 4= \n return sum((-1)**k * v * t**k for k, v in c.items())\n\n\ndef rankin_convolution_degree1(f, g, p, name=3DNone):\n u=E2=80=99=E2=80=99= =E2=80=99\n f, g: primitive forms of degree 1 and level 1.\n Return p-euler factor of the Rankin convolution of f and g as\n a polynomial.\n =E2=80=99=E2=80=99= =E2=80=99\n k1 =3D f.weight()\n k2 =3D g.weight()\n ap =3D f[p]\n bp =3D g[p]\n t = =3D PolynomialRing(QQ, 1, names=3D=E2=80=99t=E2=80=99 if name is None else name= ,\n order=3D\"neglex\").gens()[0]\n return (1 - ap * bp * t +\n (ap**2 * p**(k2 - 1) + bp**2 * p**(k1 - 1) - 2 * p**(k1 + k2 - 2)) * t**2 -\n ap * bp * p**(k1 + k2 - 2) * t**3 + p**(2 * (k1 + k2 - 2)) * t**4)\n\n\ndef _hecke_eigenvalue_base(fc_func, F, T=3DNone):\n if = T is None:\n T =3D HalfIntMatElement(matrix([[ZZ(1), ZZ(1) / ZZ(2), ZZ(1) / ZZ(2)],\n [ZZ(1) / ZZ(2), ZZ(1), ZZ(1) / ZZ(2)],\n [ZZ(1) / ZZ(2), ZZ(1) / ZZ(2), ZZ(1)]]))\n if not isinstance(T, HalfIntMatElement):\n T =3D HalfIntMatElement(T)\n v1 =3D fc_func(T).vector\n v =3D F[T].vector\n if v =3D=3D 0:\n raise ZeroDivisionError\n else:\n i =3D next(i for i in range(len(v)) i= f v[i] !=3D 0)\n return v1[i] / v[i]\n\n\n@cached_function\ndef tp_action_fc_alist(p, T):\n =E2=80=99=E2=80=99=E2=80=99\n return a li= st of tuples (S, a, g) s.t.\n S: an instance of HalfIntMatElement\n a: integer\n g: 3 by 3 matrix s.t.\n F|T(p) =3D sum(a rho(g) F[S] | (a, g, S)).\n =E2=80= =99=E2=80=99=E2=80=99\n res1 =3D []\n for alpha in alpha_list(1):\n D =3D diagonal_matri= x([p ** a for a in alpha])\n for V in _gl3_coset_gamma0(alpha, p):\n M =3D D * V\n S =3D T.right_action(M.transpose())\n if S.is_divisible_by(p):\n S =3D S // p\n if S.satisfy_cong_condition_tp(p, alpha):\n # p**(-6) and p in the third item are for normalization.\n res1.append(\n (S, p ** (-6) * mul(p ** alpha[i] for i in range(3) for j in range(i, 3)),\n M ** (-1) * p))\n return __convert_reduced_nonisom_matrices(res1)\n\n\ndef __convert_reduced_nonisom_matrices(alst):\n red_res =3D []\n for s, a= , g in alst:\n u =3D _minkowski_reduction_transform_matrix(s.T)\n t =3D s.right_action(u)\n red_res.append((t, a, g * u.transpose() *= * (-1)))\n\n non_isoms =3D []\n\n for s, a, g in red_res:\n q = =3D QuadraticForm(ZZ, 2 * s.T)\n u =3D None\n for t, _, _ in non_isoms:\n q1 =3D QuadraticForm(ZZ, 2 * t.T)\n if q.det() =3D=3D q1.det():\n u =3D q.is_globally_equivalent_to= (q1, return_matrix=3DTrue)\n if u and u.transpose() * q.Gram_matrix_rational() * u =3D=3D q1.Gram_matrix_rational():\n break\n if u:\n non_isoms.append((s.right_action(u), a, g * u.transpose() ** (-1)))\n else:\n non_isoms.append((s, a, g))\n return non_isoms\n\n\n@cached_function\nd= ef tp2_action_fc_alist(p, T, i):\n =E2=80=99=E2=80=99=E2=80=99\n similar= to tp_action_fc_alist for T_i(p^2) for i =3D 0, 1, 2, 3.\n =E2=80=99=E2=80=99=E2=80=99\n re= s1 =3D []\n\n for alpha in alpha_list(2):\n D =3D diagonal_matrix([p ** a for a in alpha])\n for V in _gl3_coset_gamma0(alpha, p):\n M =3D D * V\n S =3D T.right_action(M.transpose())\n if S.is_divisible_by(p = ** 2):\n S =3D S // (p ** 2)\n res1.append((S, p ** (-12) * _expt_sum(S, p, alpha, i),\n M ** (-1) * p ** 2))\n\n return __convert_reduced_nonisom_matrices([(a, b, c) for a, b, c in res1 if b !=3D 0])\n\n\ndef _nearest_integer(x):\n r =3D floor(x)\n if x - r > 0.5:\n return r + 1\n else:\n return r\n\n\ndef _gaussian_reduction(b1, b2, S):\n =E2=80=99=E2=80=99= =E2=80=99\n b1, b2: vectors of length 3\n S: symmetric matrix of size 3\n =E2=80=99=E2=80= =99=E2=80=99\n while True:\n nb1 =3D b1 * S * b1\n nb2 =3D b2 * S * b2\n if= nb2 < nb1:\n b1, b2 =3D b2, b1\n x =3D (b2 * S * b1) / (b1 * = S * b1)\n r =3D _nearest_integer(x)\n a =3D b2 - r * b1\n = if a * S * a >=3D b2 * S * b2:\n return (b1, b2)\n else:\n b1, b2 =3D a, b1\n\n\ndef _sym_mat_gen(p, n):\n if n =3D=3D 1:\n for a in range(p):\n yield matrix([[a]])\n else:\n for s in _sym_mat_gen(p, n - 1):\n ls =3D [range(p) for _ in range(n)]\n for a in itertools.product(*ls):\n v =3D matrix([a[:-1]])\n yield block_matrix([[s, v.transpose()= ], [v, matrix([[a[-1]]])]])\n\n\ndef _gen_gauss_sum_direct_way(N, p, r):\n res =3D 0\n K =3D CyclotomicField(p)\n zeta =3D K.gen()\n for S i= n _sym_mat_gen(p, N.ncols()):\n if S.change_ring(FiniteField(p)).rank() =3D=3D r:\n res +=3D zeta *= * ((N * S).trace())\n try:\n return QQ(res)\n except TypeError:\n return res\n\n\ndef _generalized_gauss_sum(N, p, r):\n if r =3D=3D = 0:\n return 1\n if p =3D=3D 2:\n return _gen_gauss_sum_direct_way(N, p, r)\n else:\n N_mp =3D N.change_ring(FiniteField(p))\n d, _, v =3D N_mp.smith_form()\n t =3D d.rank()\n N1 =3D (v.transpose() * N_mp *\n v).matrix_from_rows_and_columns(range(t), range(t))\n eps =3D kronecker_symbol(N1.det(), p)\n return _gen_gauss_sum_non_dyadic(p, eps, N.ncols(), t, r)\n\n\ndef _half_int_mat_is_div_by(S, m):\n n =3D S.ncols()\n return (all(ZZ(S[i, i]) % m =3D=3D 0 for i in range(n)) and\= n all(ZZ(2 * S[i, j]) % m =3D=3D 0 for i in range(n) for j in range(= i + 1, n)))\n\n\n@cached_function\ndef _gen_gauss_sum_non_dyadic(p, eps, n, t, r):\n =E2=80=99=E2=80=99=E2=80=99\n cf. H. Saito, a generalization of= Gauss sums\n =E2=80=99=E2=80=99=E2=80=99\n\n def parenthesis_prod(a, b, m):\n if m =3D=3D 0:\n retu= rn 1\n else:\n return mul(1 - a * b ** i for i in range(m))\n\n if (n - t) % 2 =3D=3D 0:\n m =3D (n - t) // 2\n else:\n m =3D (n - t + 1) // 2\n\n if n =3D=3D r:\n if n = % 2 =3D=3D 1:\n return ((-1) ** ((n - 2 * m + 1) // 2) * p ** ((n ** 2 + (2 * m) ** 2 - 1) // 4) *\n parenthesis_prod(p ** (-1), p ** (-2), m))\n elif n % 2 =3D=3D t % 2 =3D=3D 0:\n return ((-kronecker_symbol(-1, p)) ** ((n - 2 * m) // 2) *\n eps * p ** ((n ** 2 + (2 * m + 1) ** 2 - 1) // 4) *\n parenthesis_prod(p ** (-1), p ** (-2), m))\n else:\n return 0\n else:\n diag =3D [1 for _ in range(t)]\n if ep= s =3D=3D -1:\n diag[-1] =3D least_quadratic_nonresidue(p)\n = diag =3D diag + [0 for _ in range(n - t)]\n N =3D diagonal_matrix(diag).change_ring(FiniteField(p))\n return _gen_gauss_sum_direct_way(N, p, r)\n\n\ndef _expt_sum(S, p, alpha, i):\n =E2=80=99=E2=80=99=E2=80=99\n Return the exponential sum in Miyawaki=E2= =80=99s paper, where alpha[-1] <=3D 2, for T_i(p^2).\n =E2=80=99=E2=80=99=E2=80=99\n a, b, c =3D [al= pha.count(_i) for _i in range(3)]\n S33 =3D S.T.matrix_from_rows_and_columns(range(a + b, 3), range(a + b, 3))\n S22 =3D S.T.matrix_from_rows_and_columns(range(a, a + b), range(a, a + b))\n S32 =3D S.T.matrix_from_rows_and_columns(range(a = + b, 3), range(a))\n\n if c > 0 and not _half_int_mat_is_div_by(S33, p ** 2):\n return 0\n if c > 0 and b > 0 and any(x % p !=3D 0 for x in (S32 * ZZ(2)).change_ring(ZZ).list()):\n return 0\n\n if b =3D=3D= 0 and a + c =3D=3D 3 - i:\n return p ** (c * (c + 1))\n elif b =3D= =3D 0:\n return 0\n else:\n return p ** (c * (c + 1)) * p ** (b * c) * _generalized_gauss_sum(S22, p, b - i)\n\n\ndef _minkowski_reduction(b1, b2, b3, S):\n\n def inner_prod(x, y):\n return x * S * y\n\n while True:\n b1, b2, b3 =3D sorted([b1, b2= , b3], key=3Dlambda b: b * S * b)\n\n b1, b2 =3D _gaussian_reduction(b= 1, b2, S)\n\n b11 =3D inner_prod(b1, b1)\n b12 =3D inner_prod(b1= , b2)\n b13 =3D inner_prod(b1, b3)\n b22 =3D inner_prod(b2, b2)= \n b23 =3D inner_prod(b2, b3)\n b33 =3D inner_prod(b3, b3)\n\n y1 =3D - (b13 / b11 - b12 * b23 / (b11 * b22)) / \\\n (1 - b12 = ** 2 / (b11 * b22))\n y2 =3D - (b23 / b22 - b12 * b13 / (b11 * b22)) / \\\n (1 - b12 ** 2 / (b11 * b22))\n\n # Find integers x1, x2 so that norm(b3 + x2 * b2 + x1 * b1) is minimal.\n a_norms_alst = =3D []\n\n for x1 in [floor(y1), ceil(y1)]:\n for x2 in [floor(y2), ceil(y2)]:\n a =3D b3 + x2 * b2 + x1 * b1\n a_norms_alst.append((x1, x2, a, inner_prod(a, a)))\n _inner_prod_a =3D min(x[-1] for x in a_norms_alst)\n x1, x2, a, _ = =3D next(x for x in a_norms_alst if x[-1] =3D=3D _inner_prod_a)\n\n if _inner_prod_a >=3D b33:\n # Change sings of b1, b2, b3 and terminate the alogrithm\n sngs =3D [sgn(b12), sgn(b13), sgn(b23)]\n bs =3D [b1, b2, b3]\n try:\n # If b12, b13 or b23 is zero, change sgns of b1, b2, b3 so that\n # b12, b13, b23 >=3D 0.\n zero_i =3D sngs.index(0)\n set_ls =3D [set([1, 2]), set([1, 3]), set([2, 3])]\n t =3D set_ls[zero_i]\n _other =3D [x for x in [1, 2, 3] if = x not in t][0]\n for x in t:\n i =3D set_ls.index(set([x, _other]))\n if sngs[i] < 0:\n bs[x - 1] *=3D -1\n b1, b2, b3 =3D bs\n except ValueError:\n # Else change sgns so that b12, b13 > 0\n if b12 < 0:\n b2 =3D -b2\n if b13 < 0:\n b3 =3D -b3\n return (b1, b= 2, b3)\n else:\n b3 =3D a\n\n\ndef _minkowski_reduction_transform_matrix(S):\n =E2=80=99=E2=80=99=E2=80=99\= n Return a unimodular matrix u such that u^t * S * u is reduced in Minkowski=E2=80=99s sense.\n = =E2=80=99=E2=80=99=E2=80=99\n b1, b2, b3 =3D identity_matrix(QQ, 3).columns()\n c1, c2, c3 =3D _minkowski_reduction(b1, b2, b3, S)\n return matrix([c1, c2, c3]).transpose()\n","line":10,"column":0,"path":"/home/sho/work/sage_packag= es/e8theta_degree3/hecke_module.py"}} Quit [2 times] Load-path shadows: /home/sho/.emacs.d/elpa/helm-20160723.2238/helm-multi-match hides /home/sho/.emacs.d/elpa/helm-core-20160723.944/helm-multi-match /home/sho/.emacs.d/elpa/scala-mode-20160519.731/ob-scala hides /usr/local/share/emacs/25.1/lisp/org/ob-scala /home/sho/.emacs.d/elpa/seq-2.16/seq hides /usr/local/share/emacs/25.1/lisp/emacs-lisp/seq Features: (shadow sort mail-extr emacsbug message dired rfc822 mml mml-sec epg mm-decode mm-bodies mm-encode mailabbrev gmm-utils mailheader sendmail mail-utils network-stream nsm starttls url-cache url-http tls gnutls mail-parse rfc2231 rfc2047 rfc2045 ietf-drums url-gw url-auth anaconda-mode pythonic f url url-proxy url-privacy url-expand url-methods url-history url-cookie url-domsuf url-util mailcap vc-git diff-mode easy-mmode python tramp-sh tramp tramp-compat tramp-loaddefs trampver shell pcomplete format-spec comint ring ansi-color finder-inf tex-site advice edmacro kmacro gh-common gh-profile url-parse auth-source gnus-util mm-util help-fns mail-prsvr password-cache url-vars s ucs-normalize marshal eieio-compat cl-seq json map dash eieio eieio-core cl-macs go-mode-autoloads rx info package epg-config seq byte-opt gv bytecomp byte-compile cl-extra help-mode easymenu cconv cl-loaddefs pcase cl-lib time-date mule-util japan-util tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment elisp-mode lisp-mode prog-mode register page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese charscript case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer cl-preloaded nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote dbusbind inotify dynamic-setting system-font-setting font-render-setting move-toolbar gtk x-toolkit x multi-tty make-network-process emacs) Memory information: ((conses 16 279045 5729) (symbols 48 28763 0) (miscs 40 591 109) (strings 32 47201 10304) (string-bytes 1 1610049) (vectors 16 45065) (vector-slots 8 885950 3678) (floats 8 389 220) (intervals 56 445 0) (buffers 976 23) (heap 1024 44595 2062)) --001a1134e8d40621d60538ea3e48 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
I got an error "error in process sentinel: url-h= ttp-create-request: Multibyte text in HTTP request" when I visited a P= ython file which contains a multibyte character with `anaconda-eldoc-mode&#= 39; turned on.

At first, I thought this was a bug = of anaconda-mode. So I opened an issue in github (https://github.com/proofit404/ana= conda-mode/issues/189).

I guess `(=3D (string-= bytes request) (length request))` in `url-http-create-request' should b= e `(=3D (string-bytes url-http-data) (length url-http-data))`, because `(= =3D (string-bytes request) (length request))` may be `nil' even if `(= =3D (string-bytes url-http-data) (length url-http-data))` is `t'.
=

Sho Takemori

In GNU Emacs 25.1= .1 (x86_64-pc-linux-gnu, GTK+ Version 3.18.9)
=C2=A0of 2016-07-26= built on HP-500-270jp
Repository revision: 0f0b191a5324115fe9e8c= 438eceef4043decf209
Windowing system distributor 'The X.Org F= oundation', version 11.0.11803000
System Description: Ubuntu 16.04= .1 LTS

Configured using:
=C2=A0'conf= igure --with-sound=3Dno --with-modules'

Config= ured features:
XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK GPM DBUS GC= ONF GSETTINGS NOTIFY
ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_= FLT LIBOTF XFT ZLIB
TOOLKIT_SCROLL_BARS GTK3 X11 MODULES

Important settings:
=C2=A0 value of $LC_MONETARY= : ja_JP.UTF-8
=C2=A0 value of $LC_NUMERIC: ja_JP.UTF-8
= =C2=A0 value of $LC_TIME: ja_JP.UTF-8
=C2=A0 value of $LANG: ja_J= P.UTF-8
=C2=A0 value of $XMODIFIERS: @im=3Dibus
=C2=A0 = locale-coding-system: utf-8-unix

Major mode: Lisp = Interaction

Minor modes in effect:
=C2= =A0 diff-auto-refine-mode: t
=C2=A0 shell-dirtrack-mode: t
<= div>=C2=A0 tooltip-mode: t
=C2=A0 global-eldoc-mode: t
= =C2=A0 electric-indent-mode: t
=C2=A0 mouse-wheel-mode: t
=C2=A0 tool-bar-mode: t
=C2=A0 menu-bar-mode: t
=C2= =A0 file-name-shadow-mode: t
=C2=A0 global-font-lock-mode: t
=C2=A0 font-lock-mode: t
=C2=A0 blink-cursor-mode: t
<= div>=C2=A0 auto-composition-mode: t
=C2=A0 auto-encryption-mode: = t
=C2=A0 auto-compression-mode: t
=C2=A0 line-number-mo= de: t
=C2=A0 transient-mark-mode: t

Rece= nt messages:
MIME-Version: 1.0
Connection: keep-alive
Extension: Security/Digest Security/SSL
Accept-encoding: gzip<= /div>
Accept: */*
User-Agent: URL/Emacs
Content-len= gth: 20552

{"jsonrpc":"2.0",&q= uot;id":1,"method":"eldoc","params":{&qu= ot;source":"# -*- coding: utf-8 -*-\nimport itertools\nfrom itert= ools import groupby\n\nfrom sage.all import mul\nfrom sage.arith.all import= kronecker_symbol\nfrom sage.functions.all import ceil, floor, sgn\nfrom sa= ge.matrix.all import (block_diagonal_matrix, block_matrix,\n =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 diagonal_matrix, identity_matrix, matrix)\nfrom sage.misc.all im= port cached_function\nfrom sage.quadratic_forms.all import QuadraticForm, l= east_quadratic_nonresidue\nfrom sage.rings.all import QQ, ZZ, CyclotomicFie= ld, FiniteField, PolynomialRing\n\n\ndef _index_of_gamma_0_gl_n(alpha, p):\= n =C2=A0 =C2=A0=E2=80=99=E2=80=99=E2=80=99\n =C2=A0 =C2=A0Returns delta(a1,= ..., an) defined in Shimura, Euler products and Eisenstein\n =C2=A0 =C2=A0= series, pp 118, (15.1.7).\n =C2=A0 =C2=A0=E2=80=99=E2=80=99=E2=80=99\n =C2= =A0 =C2=A0if p in ZZ:\n =C2=A0 =C2=A0 =C2=A0 =C2=A0p =3D ZZ(p)\n\n =C2=A0 = =C2=A0def _bn(n):\n =C2=A0 =C2=A0 =C2=A0 =C2=A0return mul(1 - p ** (-i) for= i in xrange(1, n + 1))\n\n =C2=A0 =C2=A0e_r_ls =3D [(k, len(list(v)))\n = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0for k, v in groupby(sorted(= alpha), lambda x: x)]\n =C2=A0 =C2=A0res =3D _bn(len(alpha)) / mul(_bn(r) f= or _, r in e_r_ls)\n =C2=A0 =C2=A0for i, (ei, ri) in enumerate(e_r_ls):\n = =C2=A0 =C2=A0 =C2=A0 =C2=A0for j, (ej, rj) in enumerate(e_r_ls):\n =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if i < j:\n =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0res *=3D p ** ((ej - ei) * ri * rj)\n =C2=A0= =C2=A0return res\n\n\ndef _gl2_coset_gamma0(a, p):\n =C2=A0 =C2=A0w =3D ma= trix([[0, -1],\n =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0[1,= 0]])\n =C2=A0 =C2=A0for m12 in range(p ** a):\n =C2=A0 =C2=A0 =C2=A0 =C2= =A0yield matrix([[1, m12],\n =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0[0, 1]])\n =C2=A0 =C2=A0for m21 in range(p *= * (a - 1)):\n =C2=A0 =C2=A0 =C2=A0 =C2=A0m =3D matrix([[1, 0],\n =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0[p * m21, 1]])\n= =C2=A0 =C2=A0 =C2=A0 =C2=A0yield w * m\n\n\ndef _gl3_coset_gamma0(alpha, p= ):\n =C2=A0 =C2=A0r=E2=80=99=E2=80=99=E2=80=99\n =C2=A0 =C2=A0Let alpha =3D= [a0, a1, a2] with a0 <=3D a1 <=3D a2,\n =C2=A0 =C2=A0g =3D diag([p^a= 0, p^a1, p^a2]), and Gamma0 =3D g^(-1) GL3(Z) g =E2=88=A7 GL3(Z).\n =C2=A0 = =C2=A0Return a complete set Gamma0 \\ GL3(Z).\n =C2=A0 =C2=A0=E2=80=99=E2= =80=99=E2=80=99\n =C2=A0 =C2=A0if p in ZZ:\n =C2=A0 =C2=A0 =C2=A0 =C2=A0p = =3D ZZ(p)\n =C2=A0 =C2=A0a0, a1, a2 =3D alpha\n =C2=A0 =C2=A0if a0 < a1 = < a2:\n =C2=A0 =C2=A0 =C2=A0 =C2=A0return list(__gl3_coset_gamma0_distin= ct(a0, a1, a2, p))\n =C2=A0 =C2=A0elif a0 =3D=3D a1 and a1 < a2:\n =C2= =A0 =C2=A0 =C2=A0 =C2=A0return list(__gl3_coset_gamma0_2_1(a0, a2, p))\n = =C2=A0 =C2=A0elif a0 < a1 and a1 =3D=3D a2:\n =C2=A0 =C2=A0 =C2=A0 =C2= =A0return list(__gl3_coset_gamma0_1_2(a0, a2, p))\n =C2=A0 =C2=A0elif a0 = =3D=3D a1 =3D=3D a2:\n =C2=A0 =C2=A0 =C2=A0 =C2=A0return [identity_matrix(Z= Z, 3)]\n =C2=A0 =C2=A0else:\n =C2=A0 =C2=A0 =C2=A0 =C2=A0raise ValueError\n= \n\ndef __gl3_coset_gamma0_2_1(a1, a3, p):\n =C2=A0 =C2=A0w23 =3D matrix([[= 1, 0, 0],\n =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0[= 0, 0, 1],\n =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0[= 0, 1, 0]])\n =C2=A0 =C2=A0for m13 in range(p ** (a3 - a1 - 1)):\n =C2=A0 = =C2=A0 =C2=A0 =C2=A0for m23 in range(p ** (a3 - a1 - 1)):\n =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0m =3D matrix([[1, 0, p * m13],\n =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0[0, 1,= p * m23],\n =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0[0, 0, 1]])\n =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0yield m\n\n =C2=A0 =C2=A0for m32 in range(p ** (a3 - a1)):\n =C2=A0 =C2= =A0 =C2=A0 =C2=A0m =3D matrix([[1, 0, 0],\n =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0[0, 1, 0],\n =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0[0, m32, 1]])\n =C2=A0 =C2=A0 = =C2=A0 =C2=A0for g in _gl2_coset_gamma0(a3 - a1, p):\n =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0n =3D block_diagonal_matrix(g, matrix([[1]]))\n =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0yield w23 * m * n\n\n\ndef __gl3_coset_g= amma0_1_2(a1, a2, p):\n =C2=A0 =C2=A0w12 =3D matrix([[0, 1, 0],\n =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0[1, 0, 0],\n =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0[0, 0, 1]])\n\n =C2= =A0 =C2=A0for m12 in range(p ** (a2 - a1 - 1)):\n =C2=A0 =C2=A0 =C2=A0 =C2= =A0for m13 in range(p ** (a2 - a1 - 1)):\n =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0m =3D matrix([[1, p * m12, p * m13],\n =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0[0, 1, 0],\n =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0[0, 0, 1]])\n =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0yield m\n =C2= =A0 =C2=A0for m21 in range(p ** (a2 - a1)):\n =C2=A0 =C2=A0 =C2=A0 =C2=A0m = =3D matrix([[1, 0, 0],\n =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0[m21, 1, 0],\n =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0[0, 0, 1]])\n =C2=A0 =C2=A0 =C2=A0 =C2=A0for= g in _gl2_coset_gamma0(a2 - a1, p):\n =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0n =3D block_diagonal_matrix(matrix([[1]]), g)\n =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0yield w12 * m * n\n\n\ndef __gl3_coset_gamma0_distinct(= a1, a2, a3, p):\n\n =C2=A0 =C2=A0w12 =3D matrix([[0, 1, 0],\n =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0[1, 0, 0],\n =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0[0, 0, 1]])\n\n =C2=A0 =C2= =A0w23 =3D matrix([[1, 0, 0],\n =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0[0, 0, 1],\n =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0[0, 1, 0]])\n\n =C2=A0 =C2=A0w13 =3D matrix([[0, 0, 1],= \n =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0[0, 1, 0],= \n =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0[1, 0, 0]]= )\n\n =C2=A0 =C2=A0w123 =3D matrix([[0, 1, 0],\n =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 [0, 0, 1],\n =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 [1, 0, 0]])\n\n =C2=A0 =C2=A0w132= =3D matrix([[0, 0, 1],\n =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 [1, 0, 0],\n =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 [0, 1, 0]])\n\n =C2=A0 =C2=A0# w =3D 1\n =C2=A0 =C2=A0for m1= 2 in range(p ** (a2 - a1 - 1)):\n =C2=A0 =C2=A0 =C2=A0 =C2=A0for m13 in ran= ge(p ** (a3 - a1 - 1)):\n =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0for m23 = in range(p ** (a3 - a2 - 1)):\n =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0yield matrix([[1, p * m12, p * m13],\n =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0[0, 1, p * m23],\n =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0[0, 0, 1]])\n = =C2=A0 =C2=A0# w =3D (12)\n =C2=A0 =C2=A0for m13 in range(p ** (a3 - a2 - 1= )):\n =C2=A0 =C2=A0 =C2=A0 =C2=A0for m21 in range(p ** (a2 - a1)):\n =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0for m23 in range(p ** (a3 - a1 - 1)):\n = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0m =3D matrix([[1, 0,= p * m13],\n =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0[m21, 1, p * m23],\n =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0[0, 0, 1]])\n =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= yield w12 * m\n =C2=A0 =C2=A0# w =3D (23)\n =C2=A0 =C2=A0for m12 in range(p= ** (a3 - a1 - 1)):\n =C2=A0 =C2=A0 =C2=A0 =C2=A0for m13 in range(p ** (a2 = - a1 - 1)):\n =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0for m32 in range(p *= * (a3 - a2)):\n =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0m = =3D matrix([[1, p * m12, p * m13],\n =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0[0, 1, 0],\n =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0[0, m32, 1]])\n =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0yield w23 * m\n\n =C2=A0 =C2=A0# w =3D (13)\n =C2=A0 =C2= =A0for m21 in range(p ** (a3 - a2)):\n =C2=A0 =C2=A0 =C2=A0 =C2=A0for m31 i= n range(p ** (a3 - a1)):\n =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0for m32= in range(p ** (a2 - a1)):\n =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0m =3D matrix([[1, 0, 0],\n =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0[m21, 1, 0],\n = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0[m31, m32, 1]])\n =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0yield w13 * m\n\n =C2=A0 =C2=A0# w =3D (123)\n =C2= =A0 =C2=A0for m21 in range(p ** (a3 - a1)):\n =C2=A0 =C2=A0 =C2=A0 =C2=A0fo= r m23 in range(p ** (a2 - a1 - 1)):\n =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0for m31 in range(p ** (a3 - a2)):\n =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0m =3D matrix([[1, 0, 0],\n =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0[m= 21, 1, p * m23],\n =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0[m31, 0, 1]])\n =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0yield w123 * m\n =C2=A0 =C2=A0# w =3D= (132)\n =C2=A0 =C2=A0for m12 in range(p ** (a3 - a2 - 1)):\n =C2=A0 =C2=A0= =C2=A0 =C2=A0for m31 in range(p ** (a2 - a1)):\n =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0for m32 in range(p ** (a3 - a1)):\n =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0m =3D matrix([[1, p * m12, 0],\n =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0[0, 1, 0],\n =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0[m31, m32, 1]])\n =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0yield w132 * m\n\n\ncla= ss HalfIntMatElement(object):\n\n =C2=A0 =C2=A0def __init__(self, T):\n =C2= =A0 =C2=A0 =C2=A0 =C2=A0=E2=80=99=E2=80=99=E2=80=99\n =C2=A0 =C2=A0 =C2=A0 = =C2=A0:params T: half integral matrix of size 3 or a list\n =C2=A0 =C2=A0 = =C2=A0 =C2=A0=E2=80=99=E2=80=99=E2=80=99\n =C2=A0 =C2=A0 =C2=A0 =C2=A0if is= instance(T, list):\n =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0a, b, c, d, e= , f =3D [ZZ(x) for x in T]\n =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0mat = =3D matrix([[a, f / 2, e / 2],\n =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0[f / 2, b, d / 2],\n =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0[e / 2, d / 2, c]])\n =C2=A0 =C2=A0 =C2=A0 =C2=A0else:\n =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0mat =3D T\n =C2=A0 =C2=A0 =C2=A0 =C2=A0se= lf.__entries =3D tuple(mat.list())\n\n =C2=A0 =C2=A0def __eq__(self, other)= :\n =C2=A0 =C2=A0 =C2=A0 =C2=A0if isinstance(other, HalfIntMatElement):\n = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return self.__entries =3D=3D other= .__entries\n =C2=A0 =C2=A0 =C2=A0 =C2=A0else:\n =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0raise NotImplementedError\n\n =C2=A0 =C2=A0def __repr__(self)= :\n =C2=A0 =C2=A0 =C2=A0 =C2=A0return self.T.__repr__()\n\n =C2=A0 =C2=A0de= f __hash__(self):\n =C2=A0 =C2=A0 =C2=A0 =C2=A0return hash(self.__entries)\= n\n =C2=A0 =C2=A0@property\n =C2=A0 =C2=A0def T(self):\n =C2=A0 =C2=A0 =C2= =A0 =C2=A0return matrix(3, self.__entries)\n\n =C2=A0 =C2=A0def right_actio= n(self, g):\n =C2=A0 =C2=A0 =C2=A0 =C2=A0=E2=80=99=E2=80=99=E2=80=99\n =C2= =A0 =C2=A0 =C2=A0 =C2=A0:param g: matrix of size n\n =C2=A0 =C2=A0 =C2=A0 = =C2=A0return self[g] (Siegel=E2=80=99s notation)\n =C2=A0 =C2=A0 =C2=A0 =C2= =A0=E2=80=99=E2=80=99=E2=80=99\n =C2=A0 =C2=A0 =C2=A0 =C2=A0S =3D g.transpo= se() * self.T * g\n =C2=A0 =C2=A0 =C2=A0 =C2=A0return HalfIntMatElement(S)\= n\n =C2=A0 =C2=A0def satisfy_cong_condition_tp(self, p, alpha):\n =C2=A0 = =C2=A0 =C2=A0 =C2=A0=E2=80=99=E2=80=99=E2=80=99\n =C2=A0 =C2=A0 =C2=A0 =C2= =A0Test if sum_{B mod D} exp(2pi T B D^(-1)) is zero, where D =3D diag(p^a1= , p^a2, a^a3),\n =C2=A0 =C2=A0 =C2=A0 =C2=A0a1, a2, a3 =3D alpha.\n =C2=A0 = =C2=A0 =C2=A0 =C2=A0=E2=80=99=E2=80=99=E2=80=99\n =C2=A0 =C2=A0 =C2=A0 =C2= =A0return (all(ZZ(self.T[i, i]) % p ** alpha[i] =3D=3D 0 for i in range(3))= and\n =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0all(ZZ(self.T= [i, j] * 2) % p ** alpha[i] =3D=3D 0\n =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0for i in range(3) for j in range(i + 1, 3= )))\n\n =C2=A0 =C2=A0def is_divisible_by(self, m):\n =C2=A0 =C2=A0 =C2=A0 = =C2=A0=E2=80=99=E2=80=99=E2=80=99\n =C2=A0 =C2=A0 =C2=A0 =C2=A0Test if self= is divisible by m\n =C2=A0 =C2=A0 =C2=A0 =C2=A0:param m: integer\n =C2=A0 = =C2=A0 =C2=A0 =C2=A0=E2=80=99=E2=80=99=E2=80=99\n =C2=A0 =C2=A0 =C2=A0 =C2= =A0return _half_int_mat_is_div_by(self.T, m)\n\n =C2=A0 =C2=A0def __floordi= v__(self, other):\n =C2=A0 =C2=A0 =C2=A0 =C2=A0S =3D matrix(QQ, 3)\n =C2=A0= =C2=A0 =C2=A0 =C2=A0for i in range(3):\n =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0S[i, i] =3D ZZ(self.T[i, i]) // other\n =C2=A0 =C2=A0 =C2=A0 =C2= =A0for i in range(3):\n =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0for j in r= ange(i + 1, 3):\n =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0S[= i, j] =3D S[j, i] =3D (ZZ(self.T[i, j] * 2) // other) / 2\n =C2=A0 =C2=A0 = =C2=A0 =C2=A0return HalfIntMatElement(S)\n\n\ndef alpha_list(dl):\n =C2=A0 = =C2=A0=E2=80=99=E2=80=99=E2=80=99\n =C2=A0 =C2=A0Return a list of (a0, a1, = a2) with 0 <=3D a0 <=3D a1 <=3D a2 <=3D dl\n =C2=A0 =C2=A0=E2= =80=99=E2=80=99=E2=80=99\n =C2=A0 =C2=A0return [(a0, a1, a2) for a0 in rang= e(dl + 1)\n =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0for a1 in range(a0, dl= + 1) for a2 in range(a1, dl + 1)]\n\n\ndef tp_action_fourier_coeff(p, T, F= ):\n =C2=A0 =C2=A0=E2=80=99=E2=80=99=E2=80=99\n =C2=A0 =C2=A0Return the Tth= Fourier coefficient of F|T(p), where F is a modular form.\n =C2=A0 =C2=A0:= param p: a prime number\n =C2=A0 =C2=A0:param T: a half integral matrix or = an instance of HalfIntMatElement\n =C2=A0 =C2=A0:param F: a dictionary or a= Siegel modular form of degree 3\n =C2=A0 =C2=A0=E2=80=99=E2=80=99=E2=80=99= \n =C2=A0 =C2=A0p =3D ZZ(p)\n =C2=A0 =C2=A0return _action_fc_base(tp_action= _fc_alist(p, T), F, T)\n\n\ndef tp2_action_fourier_coeff(p, i, T, F):\n =C2= =A0 =C2=A0=E2=80=99=E2=80=99=E2=80=99\n =C2=A0 =C2=A0Similar to tp_action_f= ourier_coeff for T_i(p^2).\n =C2=A0 =C2=A0=E2=80=99=E2=80=99=E2=80=99\n =C2= =A0 =C2=A0p =3D ZZ(p)\n =C2=A0 =C2=A0return _action_fc_base(tp2_action_fc_a= list(p, T, i), F, T)\n\n\ndef _action_fc_base(ls, F, T):\n =C2=A0 =C2=A0if = not isinstance(T, HalfIntMatElement):\n =C2=A0 =C2=A0 =C2=A0 =C2=A0T =3D Ha= lfIntMatElement(T)\n =C2=A0 =C2=A0res =3D 0\n =C2=A0 =C2=A0for s, a, g in l= s:\n =C2=A0 =C2=A0 =C2=A0 =C2=A0res =3D a * F[s].left_action(g) + res\n =C2= =A0 =C2=A0return res\n\n\ndef hecke_eigenvalue_tp(p, F, T=3DNone):\n =C2=A0= =C2=A0=E2=80=99=E2=80=99=E2=80=99\n =C2=A0 =C2=A0p, F, T: same as aruments= of tp_action_fourier_coeff.\n =C2=A0 =C2=A0Assuming F is an eigenform, ret= urn the eigenvalue for T(p),\n =C2=A0 =C2=A0T is used for the computation o= f Fourier coefficients.\n =C2=A0 =C2=A0If T is omitted, T will be set to\n = =C2=A0 =C2=A0matrix([[1, 1/2, 1/2], [1/2, 1, 1/2], [1/2, 1/2, 1]]).\n =C2= =A0 =C2=A0=E2=80=99=E2=80=99=E2=80=99\n =C2=A0 =C2=A0return _hecke_eigenval= ue_base(lambda s: tp_action_fourier_coeff(p, s, F), F, T=3DT)\n\n\ndef heck= e_eigenvalue_tp2(p, i, F, T=3DNone):\n =C2=A0 =C2=A0=E2=80=99=E2=80=99=E2= =80=99\n =C2=A0 =C2=A0Similar to hecke_eigenvalue_tp for T(p^2).\n =C2=A0 = =C2=A0=E2=80=99=E2=80=99=E2=80=99\n =C2=A0 =C2=A0return _hecke_eigenvalue_b= ase(lambda s: tp2_action_fourier_coeff(p, i, s, F), F, T=3DT)\n\n\ndef spin= or_l_euler_factor(p, F, t=3DNone, T=3DNone):\n =C2=A0 =C2=A0=E2=80=99=E2=80= =99=E2=80=99\n =C2=A0 =C2=A0F: a dict or Siegel modular form of degree 3.\n= =C2=A0 =C2=A0Return a polynomial G(t) of degree 8, s.t.\n =C2=A0 =C2=A0G(p= ^(-s))^(-1) is the p-Euler factor of the spinor L function of F.\n =C2=A0 = =C2=A0=E2=80=99=E2=80=99=E2=80=99\n =C2=A0 =C2=A0p =3D ZZ(p)\n =C2=A0 =C2= =A0if t is None:\n =C2=A0 =C2=A0 =C2=A0 =C2=A0t =3D PolynomialRing(QQ, 1, n= ames=3D=E2=80=99t=E2=80=99, order=3D\"neglex\").gens()[0]\n =C2= =A0 =C2=A0c =3D {}\n =C2=A0 =C2=A0tp =3D hecke_eigenvalue_tp(p, F, T=3DT)\n= =C2=A0 =C2=A0tpp1, tpp2, tpp3 =3D [hecke_eigenvalue_tp2(p, i, F, T=3DT) fo= r i in [1, 2, 3]]\n =C2=A0 =C2=A0c[0] =3D ZZ(1)\n =C2=A0 =C2=A0c[1] =3D tp\= n =C2=A0 =C2=A0c[2] =3D p * (tpp1 + (p**2 + 1) * tpp2 + (p**2 + 1)**2 * tpp= 3)\n =C2=A0 =C2=A0c[3] =3D p**3 * tp * (tpp2 + tpp3)\n =C2=A0 =C2=A0c[4] = =3D p**6 * (tp**2 * tpp3 + tpp2**2 - 2 * p * tpp1 * tpp3 -\n =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 2 * (p - 1) * tpp2 * tpp3 = -\n =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (p**6 + = 2 * p**5 + 2 * p**3 + 2 * p - 1) * tpp3**2)\n =C2=A0 =C2=A0c[5] =3D p**6 * = tpp3 * c[3]\n =C2=A0 =C2=A0c[6] =3D p**12 * tpp3 ** 2 * c[2]\n =C2=A0 =C2= =A0c[7] =3D p**18 * tpp3 ** 3 * c[1]\n =C2=A0 =C2=A0c[8] =3D p**24 * tpp3 *= * 4\n =C2=A0 =C2=A0return sum((-1)**k * v * t**k for k, v in c.items())\n\n= \ndef rankin_convolution_degree1(f, g, p, name=3DNone):\n =C2=A0 =C2=A0u=E2= =80=99=E2=80=99=E2=80=99\n =C2=A0 =C2=A0f, g: primitive forms of degree 1 a= nd level 1.\n =C2=A0 =C2=A0Return p-euler factor of the Rankin convolution = of f and g as\n =C2=A0 =C2=A0a polynomial.\n =C2=A0 =C2=A0=E2=80=99=E2=80= =99=E2=80=99\n =C2=A0 =C2=A0k1 =3D f.weight()\n =C2=A0 =C2=A0k2 =3D g.weigh= t()\n =C2=A0 =C2=A0ap =3D f[p]\n =C2=A0 =C2=A0bp =3D g[p]\n =C2=A0 =C2=A0t = =3D PolynomialRing(QQ, 1, names=3D=E2=80=99t=E2=80=99 if name is None else = name,\n =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 order=3D\"neglex\").gens()[0]\n =C2=A0 =C2=A0return (1= - ap * bp * t +\n =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(ap**2 * p**(k2= - 1) + bp**2 * p**(k1 - 1) - 2 * p**(k1 + k2 - 2)) * t**2 -\n =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0ap * bp * p**(k1 + k2 - 2) * t**3 + p**(2 * = (k1 + k2 - 2)) * t**4)\n\n\ndef _hecke_eigenvalue_base(fc_func, F, T=3DNone= ):\n =C2=A0 =C2=A0if T is None:\n =C2=A0 =C2=A0 =C2=A0 =C2=A0T =3D HalfIntM= atElement(matrix([[ZZ(1), ZZ(1) / ZZ(2), ZZ(1) / ZZ(2)],\n =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0[ZZ(1) / ZZ(2), ZZ(1), ZZ(1) /= ZZ(2)],\n =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0[ZZ(1)= / ZZ(2), ZZ(1) / ZZ(2), ZZ(1)]]))\n =C2=A0 =C2=A0if not isinstance(T, Half= IntMatElement):\n =C2=A0 =C2=A0 =C2=A0 =C2=A0T =3D HalfIntMatElement(T)\n = =C2=A0 =C2=A0v1 =3D fc_func(T).vector\n =C2=A0 =C2=A0v =3D F[T].vector\n = =C2=A0 =C2=A0if v =3D=3D 0:\n =C2=A0 =C2=A0 =C2=A0 =C2=A0raise ZeroDivision= Error\n =C2=A0 =C2=A0else:\n =C2=A0 =C2=A0 =C2=A0 =C2=A0i =3D next(i for i = in range(len(v)) if v[i] !=3D 0)\n =C2=A0 =C2=A0 =C2=A0 =C2=A0return v1[i] = / v[i]\n\n\n@cached_function\ndef tp_action_fc_alist(p, T):\n =C2=A0 =C2=A0= =E2=80=99=E2=80=99=E2=80=99\n =C2=A0 =C2=A0return a list of tuples (S, a, g= ) s.t.\n =C2=A0 =C2=A0S: an instance of HalfIntMatElement\n =C2=A0 =C2=A0a:= integer\n =C2=A0 =C2=A0g: 3 by 3 matrix s.t.\n =C2=A0 =C2=A0F|T(p) =3D sum= (a rho(g) F[S] | (a, g, S)).\n =C2=A0 =C2=A0=E2=80=99=E2=80=99=E2=80=99\n = =C2=A0 =C2=A0res1 =3D []\n =C2=A0 =C2=A0for alpha in alpha_list(1):\n =C2= =A0 =C2=A0 =C2=A0 =C2=A0D =3D diagonal_matrix([p ** a for a in alpha])\n = =C2=A0 =C2=A0 =C2=A0 =C2=A0for V in _gl3_coset_gamma0(alpha, p):\n =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0M =3D D * V\n =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0S =3D T.right_action(M.transpose())\n =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0if S.is_divisible_by(p):\n =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0S =3D S // p\n =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0if S.satisfy_cong_condition_tp(p, alpha):\n =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0# p**(-6) and= p in the third item are for normalization.\n =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0res1.append(\n =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(S, p ** = (-6) * mul(p ** alpha[i] for i in range(3) for j in range(i, 3)),\n =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 M ** (-1) * p))\n =C2=A0 =C2=A0return __convert_reduced_nonisom_matrice= s(res1)\n\n\ndef __convert_reduced_nonisom_matrices(alst):\n =C2=A0 =C2=A0r= ed_res =3D []\n =C2=A0 =C2=A0for s, a, g in alst:\n =C2=A0 =C2=A0 =C2=A0 = =C2=A0u =3D _minkowski_reduction_transform_matrix(s.T)\n =C2=A0 =C2=A0 =C2= =A0 =C2=A0t =3D s.right_action(u)\n =C2=A0 =C2=A0 =C2=A0 =C2=A0red_res.appe= nd((t, a, g * u.transpose() ** (-1)))\n\n =C2=A0 =C2=A0non_isoms =3D []\n\n= =C2=A0 =C2=A0for s, a, g in red_res:\n =C2=A0 =C2=A0 =C2=A0 =C2=A0q =3D Qu= adraticForm(ZZ, 2 * s.T)\n =C2=A0 =C2=A0 =C2=A0 =C2=A0u =3D None\n =C2=A0 = =C2=A0 =C2=A0 =C2=A0for t, _, _ in non_isoms:\n =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0q1 =3D QuadraticForm(ZZ, 2 * t.T)\n =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0if q.det() =3D=3D q1.det():\n =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0u =3D q.is_globally_equivalent_to(q1, return_mat= rix=3DTrue)\n =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if u a= nd u.transpose() * q.Gram_matrix_rational() * u =3D=3D q1.Gram_matrix_ratio= nal():\n =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0break\n =C2=A0 =C2=A0 =C2=A0 =C2=A0if u:\n =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0non_isoms.append((s.right_action(u), a, g * u.transpose() ** (= -1)))\n =C2=A0 =C2=A0 =C2=A0 =C2=A0else:\n =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0non_isoms.append((s, a, g))\n =C2=A0 =C2=A0return non_isoms\n\n\n= @cached_function\ndef tp2_action_fc_alist(p, T, i):\n =C2=A0 =C2=A0=E2=80= =99=E2=80=99=E2=80=99\n =C2=A0 =C2=A0similar to tp_action_fc_alist for T_i(= p^2) for i =3D 0, 1, 2, 3.\n =C2=A0 =C2=A0=E2=80=99=E2=80=99=E2=80=99\n =C2= =A0 =C2=A0res1 =3D []\n\n =C2=A0 =C2=A0for alpha in alpha_list(2):\n =C2=A0= =C2=A0 =C2=A0 =C2=A0D =3D diagonal_matrix([p ** a for a in alpha])\n =C2= =A0 =C2=A0 =C2=A0 =C2=A0for V in _gl3_coset_gamma0(alpha, p):\n =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0M =3D D * V\n =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0S =3D T.right_action(M.transpose())\n =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0if S.is_divisible_by(p ** 2):\n =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0S =3D S // (p ** 2)\n =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0res1.append((S, p ** (-12) * _expt_sum(S,= p, alpha, i),\n =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 M ** (-1) * p ** 2))\n\n =C2=A0 = =C2=A0return __convert_reduced_nonisom_matrices([(a, b, c) for a, b, c in r= es1 if b !=3D 0])\n\n\ndef _nearest_integer(x):\n =C2=A0 =C2=A0r =3D floor(= x)\n =C2=A0 =C2=A0if x - r > 0.5:\n =C2=A0 =C2=A0 =C2=A0 =C2=A0return r = + 1\n =C2=A0 =C2=A0else:\n =C2=A0 =C2=A0 =C2=A0 =C2=A0return r\n\n\ndef _ga= ussian_reduction(b1, b2, S):\n =C2=A0 =C2=A0=E2=80=99=E2=80=99=E2=80=99\n = =C2=A0 =C2=A0b1, b2: vectors of length 3\n =C2=A0 =C2=A0S: symmetric matrix= of size 3\n =C2=A0 =C2=A0=E2=80=99=E2=80=99=E2=80=99\n =C2=A0 =C2=A0while = True:\n =C2=A0 =C2=A0 =C2=A0 =C2=A0nb1 =3D b1 * S * b1\n =C2=A0 =C2=A0 =C2= =A0 =C2=A0nb2 =3D b2 * S * b2\n =C2=A0 =C2=A0 =C2=A0 =C2=A0if nb2 < nb1:= \n =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0b1, b2 =3D b2, b1\n =C2=A0 =C2= =A0 =C2=A0 =C2=A0x =3D (b2 * S * b1) / (b1 * S * b1)\n =C2=A0 =C2=A0 =C2=A0= =C2=A0r =3D _nearest_integer(x)\n =C2=A0 =C2=A0 =C2=A0 =C2=A0a =3D b2 - r = * b1\n =C2=A0 =C2=A0 =C2=A0 =C2=A0if a * S * a >=3D b2 * S * b2:\n =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return (b1, b2)\n =C2=A0 =C2=A0 =C2= =A0 =C2=A0else:\n =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0b1, b2 =3D a, b1= \n\n\ndef _sym_mat_gen(p, n):\n =C2=A0 =C2=A0if n =3D=3D 1:\n =C2=A0 =C2=A0= =C2=A0 =C2=A0for a in range(p):\n =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0yield matrix([[a]])\n =C2=A0 =C2=A0else:\n =C2=A0 =C2=A0 =C2=A0 =C2=A0fo= r s in _sym_mat_gen(p, n - 1):\n =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0l= s =3D [range(p) for _ in range(n)]\n =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0for a in itertools.product(*ls):\n =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0v =3D matrix([a[:-1]])\n =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0yield block_matrix([[s, v.transpose()], [v, matr= ix([[a[-1]]])]])\n\n\ndef _gen_gauss_sum_direct_way(N, p, r):\n =C2=A0 =C2= =A0res =3D 0\n =C2=A0 =C2=A0K =3D CyclotomicField(p)\n =C2=A0 =C2=A0zeta = =3D K.gen()\n =C2=A0 =C2=A0for S in _sym_mat_gen(p, N.ncols()):\n =C2=A0 = =C2=A0 =C2=A0 =C2=A0if S.change_ring(FiniteField(p)).rank() =3D=3D r:\n =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0res +=3D zeta ** ((N * S).trace())\n = =C2=A0 =C2=A0try:\n =C2=A0 =C2=A0 =C2=A0 =C2=A0return QQ(res)\n =C2=A0 =C2= =A0except TypeError:\n =C2=A0 =C2=A0 =C2=A0 =C2=A0return res\n\n\ndef _gene= ralized_gauss_sum(N, p, r):\n =C2=A0 =C2=A0if r =3D=3D 0:\n =C2=A0 =C2=A0 = =C2=A0 =C2=A0return 1\n =C2=A0 =C2=A0if p =3D=3D 2:\n =C2=A0 =C2=A0 =C2=A0 = =C2=A0return _gen_gauss_sum_direct_way(N, p, r)\n =C2=A0 =C2=A0else:\n =C2= =A0 =C2=A0 =C2=A0 =C2=A0N_mp =3D N.change_ring(FiniteField(p))\n =C2=A0 =C2= =A0 =C2=A0 =C2=A0d, _, v =3D N_mp.smith_form()\n =C2=A0 =C2=A0 =C2=A0 =C2= =A0t =3D d.rank()\n =C2=A0 =C2=A0 =C2=A0 =C2=A0N1 =3D (v.transpose() * N_mp= *\n =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0v).matrix_from_rows_an= d_columns(range(t), range(t))\n =C2=A0 =C2=A0 =C2=A0 =C2=A0eps =3D kronecke= r_symbol(N1.det(), p)\n =C2=A0 =C2=A0 =C2=A0 =C2=A0return _gen_gauss_sum_no= n_dyadic(p, eps, N.ncols(), t, r)\n\n\ndef _half_int_mat_is_div_by(S, m):\n= =C2=A0 =C2=A0n =3D S.ncols()\n =C2=A0 =C2=A0return (all(ZZ(S[i, i]) % m = =3D=3D 0 for i in range(n)) and\n =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= all(ZZ(2 * S[i, j]) % m =3D=3D 0 for i in range(n) for j in range(i + 1, n)= ))\n\n\n@cached_function\ndef _gen_gauss_sum_non_dyadic(p, eps, n, t, r):\n= =C2=A0 =C2=A0=E2=80=99=E2=80=99=E2=80=99\n =C2=A0 =C2=A0cf. H. Saito, a ge= neralization of Gauss sums\n =C2=A0 =C2=A0=E2=80=99=E2=80=99=E2=80=99\n\n = =C2=A0 =C2=A0def parenthesis_prod(a, b, m):\n =C2=A0 =C2=A0 =C2=A0 =C2=A0if= m =3D=3D 0:\n =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return 1\n =C2=A0 = =C2=A0 =C2=A0 =C2=A0else:\n =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return= mul(1 - a * b ** i for i in range(m))\n\n =C2=A0 =C2=A0if (n - t) % 2 =3D= =3D 0:\n =C2=A0 =C2=A0 =C2=A0 =C2=A0m =3D (n - t) // 2\n =C2=A0 =C2=A0else:= \n =C2=A0 =C2=A0 =C2=A0 =C2=A0m =3D (n - t + 1) // 2\n\n =C2=A0 =C2=A0if n = =3D=3D r:\n =C2=A0 =C2=A0 =C2=A0 =C2=A0if n % 2 =3D=3D 1:\n =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0return ((-1) ** ((n - 2 * m + 1) // 2) * p ** ((= n ** 2 + (2 * m) ** 2 - 1) // 4) *\n =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0parenthesis_prod(p ** (-1), p ** (-2), m))\n= =C2=A0 =C2=A0 =C2=A0 =C2=A0elif n % 2 =3D=3D t % 2 =3D=3D 0:\n =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return ((-kronecker_symbol(-1, p)) ** ((n - = 2 * m) // 2) *\n =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0eps * p ** ((n ** 2 + (2 * m + 1) ** 2 - 1) // 4) *\n =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0parenthesis_p= rod(p ** (-1), p ** (-2), m))\n =C2=A0 =C2=A0 =C2=A0 =C2=A0else:\n =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return 0\n =C2=A0 =C2=A0else:\n =C2=A0 = =C2=A0 =C2=A0 =C2=A0diag =3D [1 for _ in range(t)]\n =C2=A0 =C2=A0 =C2=A0 = =C2=A0if eps =3D=3D -1:\n =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0diag[-1]= =3D least_quadratic_nonresidue(p)\n =C2=A0 =C2=A0 =C2=A0 =C2=A0diag =3D di= ag + [0 for _ in range(n - t)]\n =C2=A0 =C2=A0 =C2=A0 =C2=A0N =3D diagonal_= matrix(diag).change_ring(FiniteField(p))\n =C2=A0 =C2=A0 =C2=A0 =C2=A0retur= n _gen_gauss_sum_direct_way(N, p, r)\n\n\ndef _expt_sum(S, p, alpha, i):\n = =C2=A0 =C2=A0=E2=80=99=E2=80=99=E2=80=99\n =C2=A0 =C2=A0Return the exponent= ial sum in Miyawaki=E2=80=99s paper, where alpha[-1] <=3D 2, for T_i(p^2= ).\n =C2=A0 =C2=A0=E2=80=99=E2=80=99=E2=80=99\n =C2=A0 =C2=A0a, b, c =3D [a= lpha.count(_i) for _i in range(3)]\n =C2=A0 =C2=A0S33 =3D S.T.matrix_from_r= ows_and_columns(range(a + b, 3), range(a + b, 3))\n =C2=A0 =C2=A0S22 =3D S.= T.matrix_from_rows_and_columns(range(a, a + b), range(a, a + b))\n =C2=A0 = =C2=A0S32 =3D S.T.matrix_from_rows_and_columns(range(a + b, 3), range(a))\n= \n =C2=A0 =C2=A0if c > 0 and not _half_int_mat_is_div_by(S33, p ** 2):\n= =C2=A0 =C2=A0 =C2=A0 =C2=A0return 0\n =C2=A0 =C2=A0if c > 0 and b > = 0 and any(x % p !=3D 0 for x in (S32 * ZZ(2)).change_ring(ZZ).list()):\n = =C2=A0 =C2=A0 =C2=A0 =C2=A0return 0\n\n =C2=A0 =C2=A0if b =3D=3D 0 and a + = c =3D=3D 3 - i:\n =C2=A0 =C2=A0 =C2=A0 =C2=A0return p ** (c * (c + 1))\n = =C2=A0 =C2=A0elif b =3D=3D 0:\n =C2=A0 =C2=A0 =C2=A0 =C2=A0return 0\n =C2= =A0 =C2=A0else:\n =C2=A0 =C2=A0 =C2=A0 =C2=A0return p ** (c * (c + 1)) * p = ** (b * c) * _generalized_gauss_sum(S22, p, b - i)\n\n\ndef _minkowski_redu= ction(b1, b2, b3, S):\n\n =C2=A0 =C2=A0def inner_prod(x, y):\n =C2=A0 =C2= =A0 =C2=A0 =C2=A0return x * S * y\n\n =C2=A0 =C2=A0while True:\n =C2=A0 =C2= =A0 =C2=A0 =C2=A0b1, b2, b3 =3D sorted([b1, b2, b3], key=3Dlambda b: b * S = * b)\n\n =C2=A0 =C2=A0 =C2=A0 =C2=A0b1, b2 =3D _gaussian_reduction(b1, b2, = S)\n\n =C2=A0 =C2=A0 =C2=A0 =C2=A0b11 =3D inner_prod(b1, b1)\n =C2=A0 =C2= =A0 =C2=A0 =C2=A0b12 =3D inner_prod(b1, b2)\n =C2=A0 =C2=A0 =C2=A0 =C2=A0b1= 3 =3D inner_prod(b1, b3)\n =C2=A0 =C2=A0 =C2=A0 =C2=A0b22 =3D inner_prod(b2= , b2)\n =C2=A0 =C2=A0 =C2=A0 =C2=A0b23 =3D inner_prod(b2, b3)\n =C2=A0 =C2= =A0 =C2=A0 =C2=A0b33 =3D inner_prod(b3, b3)\n\n =C2=A0 =C2=A0 =C2=A0 =C2=A0= y1 =3D - (b13 / b11 - b12 * b23 / (b11 * b22)) / \\\n =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0(1 - b12 ** 2 / (b11 * b22))\n =C2=A0 =C2=A0 =C2=A0 =C2= =A0y2 =3D - (b23 / b22 - b12 * b13 / (b11 * b22)) / \\\n =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0(1 - b12 ** 2 / (b11 * b22))\n\n =C2=A0 =C2=A0 =C2= =A0 =C2=A0# Find integers x1, x2 so that norm(b3 + x2 * b2 + x1 * b1) is mi= nimal.\n =C2=A0 =C2=A0 =C2=A0 =C2=A0a_norms_alst =3D []\n\n =C2=A0 =C2=A0 = =C2=A0 =C2=A0for x1 in [floor(y1), ceil(y1)]:\n =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0for x2 in [floor(y2), ceil(y2)]:\n =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0a =3D b3 + x2 * b2 + x1 * b1\n =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0a_norms_alst.append((x1, x2, a, i= nner_prod(a, a)))\n =C2=A0 =C2=A0 =C2=A0 =C2=A0_inner_prod_a =3D min(x[-1] = for x in a_norms_alst)\n =C2=A0 =C2=A0 =C2=A0 =C2=A0x1, x2, a, _ =3D next(x= for x in a_norms_alst if x[-1] =3D=3D _inner_prod_a)\n\n =C2=A0 =C2=A0 =C2= =A0 =C2=A0if _inner_prod_a >=3D b33:\n =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0# Change sings of b1, b2, b3 and terminate the alogrithm\n =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0sngs =3D [sgn(b12), sgn(b13), sgn(b23)]\= n =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0bs =3D [b1, b2, b3]\n =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0try:\n =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0# If b12, b13 or b23 is zero, change sgns of b1, b2, b3= so that\n =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0# b12, b1= 3, b23 >=3D 0.\n =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= zero_i =3D sngs.index(0)\n =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0set_ls =3D [set([1, 2]), set([1, 3]), set([2, 3])]\n =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0t =3D set_ls[zero_i]\n =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0_other =3D [x for x in [1, 2, = 3] if x not in t][0]\n =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0for x in t:\n =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0i =3D set_ls.index(set([x, _other]))\n =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if sngs[i] < 0:\n =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0bs[x - 1] *=3D -1\n =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0b1, b2, b3 =3D bs\n =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0except Valu= eError:\n =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0# Else cha= nge sgns so that b12, b13 > 0\n =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0if b12 < 0:\n =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0b2 =3D -b2\n =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0if b13 < 0:\n =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0b3 =3D -b3\n =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0return (b1, b2, b3)\n =C2=A0 =C2=A0 =C2=A0 =C2=A0else:\n =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0b3 =3D a\n\n\ndef _minkowski_reductio= n_transform_matrix(S):\n =C2=A0 =C2=A0=E2=80=99=E2=80=99=E2=80=99\n =C2=A0 = =C2=A0Return a unimodular matrix u such that u^t * S * u is reduced in Mink= owski=E2=80=99s sense.\n =C2=A0 =C2=A0=E2=80=99=E2=80=99=E2=80=99\n =C2=A0 = =C2=A0b1, b2, b3 =3D identity_matrix(QQ, 3).columns()\n =C2=A0 =C2=A0c1, c2= , c3 =3D _minkowski_reduction(b1, b2, b3, S)\n =C2=A0 =C2=A0return matrix([= c1, c2, c3]).transpose()\n","line":10,"column":0,&= quot;path":"/home/sho/work/sage_packages/e8theta_degree3/hecke_mo= dule.py"}}
Quit [2 times]

Load-path= shadows:
/home/sho/.emacs.d/elpa/helm-20160723.2238/helm-multi-m= atch hides /home/sho/.emacs.d/elpa/helm-core-20160723.944/helm-multi-match<= /div>
/home/sho/.emacs.d/elpa/scala-mode-20160519.731/ob-scala hides /u= sr/local/share/emacs/25.1/lisp/org/ob-scala
/home/sho/.emacs.d/el= pa/seq-2.16/seq hides /usr/local/share/emacs/25.1/lisp/emacs-lisp/seq
=

Features:
(shadow sort mail-extr emacsbug mes= sage dired rfc822 mml mml-sec epg
mm-decode mm-bodies mm-encode m= ailabbrev gmm-utils mailheader sendmail
mail-utils network-stream= nsm starttls url-cache url-http tls gnutls
mail-parse rfc2231 rf= c2047 rfc2045 ietf-drums url-gw url-auth
anaconda-mode pythonic f= url url-proxy url-privacy url-expand
url-methods url-history url= -cookie url-domsuf url-util mailcap vc-git
diff-mode easy-mmode p= ython tramp-sh tramp tramp-compat tramp-loaddefs
trampver shell p= complete format-spec comint ring ansi-color finder-inf
tex-site a= dvice edmacro kmacro gh-common gh-profile url-parse
auth-source g= nus-util mm-util help-fns mail-prsvr password-cache
url-vars s uc= s-normalize marshal eieio-compat cl-seq json map dash eieio
eieio= -core cl-macs go-mode-autoloads rx info package epg-config seq
by= te-opt gv bytecomp byte-compile cl-extra help-mode easymenu cconv
cl-loaddefs pcase cl-lib time-date mule-util japan-util tooltip eldoc
electric uniquify ediff-hook vc-hooks lisp-float-type mwheel x-win
term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe<= /div>
tabulated-list newcomment elisp-mode lisp-mode prog-mode register= page
menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock= font-lock
syntax facemenu font-core frame cl-generic cham georgi= an utf-8-lang
misc-lang vietnamese tibetan thai tai-viet lao kore= an japanese eucjp-ms
cp51932 hebrew greek romanian slovak czech e= uropean ethiopic indian
cyrillic chinese charscript case-table ep= a-hook jka-cmpr-hook help
simple abbrev minibuffer cl-preloaded n= advice loaddefs button faces
cus-face macroexp files text-propert= ies overlay sha1 md5 base64 format
env code-pages mule custom wid= get hashtable-print-readable backquote
dbusbind inotify dynamic-s= etting system-font-setting font-render-setting
move-toolbar gtk x= -toolkit x multi-tty make-network-process emacs)

M= emory information:
((conses 16 279045 5729)
=C2=A0(symb= ols 48 28763 0)
=C2=A0(miscs 40 591 109)
=C2=A0(strings= 32 47201 10304)
=C2=A0(string-bytes 1 1610049)
=C2=A0(= vectors 16 45065)
=C2=A0(vector-slots 8 885950 3678)
= =C2=A0(floats 8 389 220)
=C2=A0(intervals 56 445 0)
=C2= =A0(buffers 976 23)
=C2=A0(heap 1024 44595 2062))

<= /div>
--001a1134e8d40621d60538ea3e48--