Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
Rebase to 7.4beta0
Browse files Browse the repository at this point in the history
  • Loading branch information
kedlaya committed Aug 19, 2016
1 parent 0a80508 commit 1258047
Show file tree
Hide file tree
Showing 4 changed files with 410 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/sage/modular/all.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,5 @@
from .btquotients.all import *

from .pollack_stevens.all import *

from hecke.all import HeckeIdeal
2 changes: 2 additions & 0 deletions src/sage/modular/hecke/all.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,5 @@
from .submodule import HeckeSubmodule, is_HeckeSubmodule

from .ambient_module import AmbientHeckeModule, is_AmbientHeckeModule

from ideal import HeckeIdeal
69 changes: 68 additions & 1 deletion src/sage/modular/hecke/hecke_operator.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
from sage.categories.homset import End
import sage.arith.all as arith
from sage.rings.integer import Integer

from sage.matrix.matrix_space import MatrixSpace
from . import algebra
from . import morphism

Expand Down Expand Up @@ -59,6 +59,41 @@ def is_HeckeAlgebraElement(x):
"""
return isinstance(x, HeckeAlgebraElement)

def _heckecoords(M,t):
r"""
Gives the coordinates of t in the basis given by M.hecke_algebra().basis()
INPUT:
- ``M`` - hecke module
- ``t`` - an element of the hecke algebra, represented as a matrix
OUTPUT:
- a vector
"""
QQ=rings.QQ
d=M.rank()
VV=QQ**(d**2)
MM=MatrixSpace(QQ,d,d**2)
NN=MatrixSpace(QQ,1,d**2)
m=MM(0)
b=M.hecke_algebra().basis()
for i in xrange(0,d):
try:
vv=b[i].list()
except AttributeError:
vv=b[i].matrix().list()
m[i]=VV(vv)
try:
t1=t.matrix().list()
except AttributeError:
t1=t.list()
T=NN(t1)
c=m.solve_left(T)
return c[0]

class HeckeAlgebraElement(AlgebraElement):
r"""
Base class for elements of Hecke algebras.
Expand Down Expand Up @@ -403,6 +438,22 @@ def __getitem__(self, ij):
"""
return self.matrix()[ij]

def coordinates(self):
r"""
Gives the cooridinates of self in the hecke algebra. Uses the basis
given by self.domain().hecke_algebra().basis()
OUTPUT:
- a vector representing the coordinates of self
EXAMPLES::
sage: TT = ModularSymbols(11,2,1).hecke_algebra()
sage: (TT.7).coordinates()
(8, -2)
"""
return _heckecoords(self.domain(),self.matrix())

class HeckeAlgebraElement_matrix(HeckeAlgebraElement):
r"""
Expand Down Expand Up @@ -528,6 +579,22 @@ def _mul_(self, other):
"""
return self.parent()(other.matrix() * self.matrix(), check=False)

def coordinates(self):
r"""
Gives the cooridinates of self in the hecke algebra. Uses the basis
given by self.domain().hecke_algebra().basis()
OUTPUT:
- a vector representing the coordinates of self
EXAMPLES::
sage: TT = ModularSymbols(11,2,1).hecke_algebra()
sage: (TT.2 + TT.3).coordinates()
(7, -2)
"""
return _heckecoords(self.domain(),self)

class DiamondBracketOperator(HeckeAlgebraElement_matrix):
r"""
Expand Down
Loading

0 comments on commit 1258047

Please sign in to comment.