Skip to content

Simplify matrix construction in btquotient #40239

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 5 additions & 9 deletions src/sage/modular/btquotients/btquotient.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
from sage.interfaces.magma import magma
from sage.matrix.constructor import Matrix
from sage.matrix.matrix_space import MatrixSpace
from sage.matrix.special import column_matrix
from sage.misc.cachefunc import cached_method
from sage.misc.latex import latex
from sage.misc.lazy_attribute import lazy_attribute
Expand Down Expand Up @@ -2273,9 +2274,7 @@ def _compute_embedding_matrix(self, prec, force_computation=False):
else:
phi = self._local_splitting_map(prec)
B = self.get_eichler_order_basis()
return Matrix(Zmod(self._p ** prec), 4, 4,
[phi(B[kk])[ii, jj] for ii in range(2)
for jj in range(2) for kk in range(4)])
return column_matrix(Zmod(self._p ** prec), 4, 4, [phi(b).list() for b in B])

@cached_method
def get_extra_embedding_matrices(self):
Expand Down Expand Up @@ -2441,12 +2440,10 @@ def get_embedding_matrix(self, prec=None, exact=False):
verbose('self._prec = %s, prec = %s' % (self._prec, prec))
Iotamod = self._compute_embedding_matrix(prec)
self._Iotainv_lift = Iotamod.inverse().lift()
self._Iota = Matrix(self._R, 4, 4, [Iotamod[ii, jj]
for ii in range(4)
for jj in range(4)])
self._Iota = Matrix(self._R, Iotamod)

self._prec = prec
self._Iotainv = self._Mat_44([self._Iotainv_lift[ii, jj] % self._pN for ii in range(4) for jj in range(4)])
self._Iotainv = self._Mat_44(self._Iotainv_lift.apply_map(lambda x: x % self._pN))
return self._Iota

def embed_quaternion(self, g, exact=False, prec=None):
Expand Down Expand Up @@ -3153,8 +3150,7 @@ def _find_lattice(self, v1, v2, as_edges, m):
v1adj = v1.adjugate()
R = self._Mat_44
vecM = [v2 * X[ii] * v1adj for ii in range(4)]
M = self._Iotainv * R([[vecM[ii][jj, kk] for ii in range(4)]
for jj in range(2) for kk in range(2)])
M = self._Iotainv * column_matrix(4, 4, [m.list() for m in vecM])
M = M.augment(R(self._pN)).transpose()
E = M.echelon_form().submatrix(0, 0, 4, 4)
Et = E.transpose()
Expand Down
Loading