Package sage :: Package modular :: Module cusps :: Class Cusp
[hide private]
[frames] | no frames]

Class Cusp

source code

                      object --+        
                               |        
structure.sage_object.SageObject --+    
                                   |    
           structure.element.Element --+
                                       |
                                      Cusp


A cusp.

A cusp is either a rational number or infinity, i.e., an element
of the projective line over Q.  A Cusp is stored as a pair (a,b),
where gcd(a,b)=1 and a,b are of type Integer.

EXAMPLES:
    sage: a = Cusp(2/3); b = Cusp(oo)
    sage: a.parent()
    Set P^1(QQ) of all cusps
    sage: a.parent() is b.parent()
    True        



Instance Methods [hide private]
 
__init__(self, a, b=1, construct=False, parent=['4ti2-20061025', 'R-2.6.0', 'atlas-3.7.37', 'atlas-3.8.1', 'a...)
Create the cusp a/b in $\PP^1(\Q)$, where if b=0 this is the cusp at infinity.
source code
 
__cmp__(self, right)
Compare the cusps self and right.
source code
 
is_infinity(self)
Returns True if this is the cusp infinity.
source code
 
numerator(self)
Return the numerator of the cusp a/b.
source code
 
denominator(self)
Return the denominator of the cusp a/b.
source code
 
_rational_(self)
Coerce to a rational number.
source code
 
_integer_(self)
Coerce to an integer.
source code
 
_repr_(self)
String representation of this cusp.
source code
 
_latex_(self)
Latex representation of this cusp.
source code
 
__neg__(self)
The negative of this cusp.
source code
 
is_gamma0_equiv(self, other, N, transformation=False)
Return whether self and other are equivalent modulo the action of $\Gamma_0(N)$ via linear fractional transformations.
source code
 
is_gamma1_equiv(self, other, N)
Return whether self and other are equivalent modulo the action of Gamma_1(N) via linear fractional transformations.
source code
 
is_gamma_h_equiv(self, other, G)
Return a pair (b, t), where b is True or False as self and other are equivalent under the action of G, and t is 1 or -1, as described below.
source code
 
apply(self, g)
Return g(self), where g=[a,b,c,d] is a list of length 4, which we view as a linear fractional transformation.
source code

Inherited from structure.element.Element: __eq__, __ge__, __gt__, __hash__, __le__, __lt__, __ne__, __new__, __nonzero__, __reduce__, __rxor__, __xor__, _cmp_, _im_gens_, _richcmp_, base_base_extend, base_base_extend_canonical_sym, base_extend, base_extend_canonical, base_extend_canonical_sym, base_extend_recursive, base_ring, category, is_zero, n, parent, subs, substitute

Inherited from structure.sage_object.SageObject: __repr__, _axiom_, _axiom_init_, _gap_, _gap_init_, _gp_, _gp_init_, _interface_, _interface_init_, _interface_is_cached_, _kash_, _kash_init_, _macaulay2_, _macaulay2_init_, _magma_, _magma_init_, _maple_, _maple_init_, _mathematica_, _mathematica_init_, _maxima_, _maxima_init_, _octave_, _octave_init_, _pari_, _pari_init_, _r_init_, _sage_, _singular_, _singular_init_, db, dump, dumps, plot, rename, reset_name, save, version

Inherited from object: __delattr__, __getattribute__, __reduce_ex__, __setattr__, __str__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, a, b=1, construct=False, parent=['4ti2-20061025', 'R-2.6.0', 'atlas-3.7.37', 'atlas-3.8.1', 'a...)
(Constructor)

source code 

Create the cusp a/b in $\PP^1(\Q)$, where if b=0 this is the
cusp at infinity.

EXAMPLES:
    sage: Cusp(2,3)
    2/3
    sage: Cusp(3,6)
    1/2
    sage: Cusp(1,0)
    Infinity
    sage: Cusp(infinity)
    Infinity
    sage: Cusp(5)
    5
    sage: Cusp(1/2)             # rational number
    1/2
    sage: Cusp(1.5)
    3/2

    sage: Cusp(sqrt(-1))
    Traceback (most recent call last):
    ...
    TypeError: unable to convert I to a rational

    sage: a = Cusp(2,3)
    sage: loads(a.dumps()) == a
    True

Overrides: structure.element.Element.__init__

__cmp__(self, right)
(Comparison operator)

source code 

Compare the cusps self and right.  Comparison is as for
rational numbers, except with the cusp oo greater than
everything but itself.

The ordering in comparison is only really meaningful
for infinity or elements that coerce to the rationals.

EXAMPLES:
    sage: Cusp(2/3) == Cusp(oo)
    False

    sage: Cusp(2/3) < Cusp(oo)
    True

    sage: Cusp(2/3)> Cusp(oo)
    False

    sage: Cusp(2/3) > Cusp(5/2)
    False

    sage: Cusp(2/3) < Cusp(5/2)
    True

    sage: Cusp(2/3) == Cusp(5/2)
    False

    sage: Cusp(oo) == Cusp(oo)
    True

    sage: 19/3 < Cusp(oo)
    True

    sage: Cusp(oo) < 19/3
    False

    sage: Cusp(2/3) < Cusp(11/7)
    True

    sage: Cusp(11/7) < Cusp(2/3)
    False

    sage: 2 < Cusp(3)
    True        

Overrides: structure.element.Element.__cmp__

is_infinity(self)

source code 

Returns True if this is the cusp infinity.

EXAMPLES:
    sage: Cusp(3/5).is_infinity()
    False
    sage: Cusp(1,0).is_infinity()
    True
    sage: Cusp(0,1).is_infinity()
    False        

numerator(self)

source code 

Return the numerator of the cusp a/b.

EXAMPLES:
    sage: x=Cusp(6,9); x
    2/3
    sage: x.numerator()
    2
    sage: Cusp(oo).numerator()
    1
    sage: Cusp(-5/10).numerator()
    -1

denominator(self)

source code 

Return the denominator of the cusp a/b.

EXAMPLES:
    sage: x=Cusp(6,9); x
    2/3
    sage: x.denominator()
    3
    sage: Cusp(oo).denominator()
    0
    sage: Cusp(-5/10).denominator()
    2        

_rational_(self)

source code 

Coerce to a rational number.

EXAMPLES:
    sage: QQ(Cusp(oo))
    Traceback (most recent call last):
    ...
    TypeError: cusp Infinity is not a rational number
    sage: QQ(Cusp(-3,7))
    -3/7

_integer_(self)

source code 

Coerce to an integer.

EXAMPLES:
    sage: ZZ(Cusp(-19))
    -19

    sage: ZZ(Cusp(oo))
    Traceback (most recent call last):
    ...
    TypeError: cusp Infinity is not an integer
    sage: ZZ(Cusp(-3,7))
    Traceback (most recent call last):
    ...
    TypeError: cusp -3/7 is not an integer

_repr_(self)

source code 

String representation of this cusp.

EXAMPLES:
    sage: a = Cusp(2/3); a
    2/3
    sage: a.rename('2/3(cusp)'); a
    2/3(cusp)

Overrides: structure.element.Element._repr_

_latex_(self)

source code 

Latex representation of this cusp.

EXAMPLES:
    sage: latex(Cusp(-2/7))
    \frac{-2}{7}
    sage: latex(Cusp(oo))
    \infty        

__neg__(self)

source code 

The negative of this cusp.

EXAMPLES:
    sage: -Cusp(2/7)
    -2/7
    sage: -Cusp(oo)
    Infinity        

is_gamma0_equiv(self, other, N, transformation=False)

source code 

Return whether self and other are equivalent modulo the action
of $\Gamma_0(N)$ via linear fractional transformations.

INPUT:
    other -- Cusp
    N -- an integer (specifies the group Gamma_0(N))
    transformation -- bool (default: False), if True, also
                      return upper left entry of a matrix in
                      Gamma_0(N) that sends self to other.

OUTPUT:
    bool -- True if self and other are equivalent
    integer -- returned only if transformation is True

EXAMPLES:
    sage: x = Cusp(2,3)
    sage: y = Cusp(4,5)
    sage: x.is_gamma0_equiv(y, 2)
    True
    sage: x.is_gamma0_equiv(y, 2, True)
    (True, 1)
    sage: x.is_gamma0_equiv(y, 3)
    False
    sage: x.is_gamma0_equiv(y, 3, True)
    (False, None)
    sage: Cusp(1,0)
    Infinity
    sage: z = Cusp(1,0)
    sage: x.is_gamma0_equiv(z, 3, True)
    (True, 2)

ALGORITHM:
    See Proposition 2.2.3 of Cremona's book "Algorithms for Modular
    Elliptic Curves", or Prop 2.27 of Stein's Ph.D. thesis. 

is_gamma1_equiv(self, other, N)

source code 

Return whether self and other are equivalent modulo the action
of Gamma_1(N) via linear fractional transformations.

INPUT:
    other -- Cusp
    N -- an integer (specifies the group Gamma_1(N))

OUTPUT:
    bool -- True if self and other are equivalent
    int -- 0, 1 or -1, gives further information
           about the equivalence:  If the two cusps
           are u1/v1 and u2/v2, then they are equivalent
           if and only if
                v1 = v2 (mod N) and u1 = u2 (mod gcd(v1,N))
           or
                v1 = -v2 (mod N) and u1 = -u2 (mod gcd(v1,N))
           The sign is +1 for the first and -1 for the second.
           If the two cusps are not equivalent then 0 is returned.
           
EXAMPLES:
    sage: x = Cusp(2,3)
    sage: y = Cusp(4,5)
    sage: x.is_gamma1_equiv(y,2)
    (True, 1)
    sage: x.is_gamma1_equiv(y,3)
    (False, 0)
    sage: z = Cusp(QQ(x) + 10)
    sage: x.is_gamma1_equiv(z,10)
    (True, 1)
    sage: z = Cusp(1,0)
    sage: x.is_gamma1_equiv(z, 3)
    (True, -1)
    sage: Cusp(0).is_gamma1_equiv(oo, 1)
    (True, 1)
    sage: Cusp(0).is_gamma1_equiv(oo, 3)
    (False, 0)

is_gamma_h_equiv(self, other, G)

source code 

Return a pair (b, t), where b is True or False as self
and other are equivalent under the action of G, and t
is 1 or -1, as described below.

Two cusps $u1/v1$ and $u2/v2$ are equivalent modulo Gamma_H(N)
if and only if
    $v1 =  h*v2 (mod N)$ and $u1 =  h^(-1)*u2 (mod gcd(v1,N))$
or
    $v1 = -h*v2 (mod N)$ and $u1 = -h^(-1)*u2 (mod gcd(v1,N))$
for some $h \in H$. Then t is 1 or -1 as c and c' fall into
the first or second case, respectively.

INPUT:
    other -- Cusp
    G -- a congruence subgroup Gamma_H(N)

OUTPUT:
    bool -- True if self and other are equivalent
    int -- -1, 0, 1; extra info
           
EXAMPLES:
    sage: x = Cusp(2,3)
    sage: y = Cusp(4,5)
    sage: x.is_gamma_h_equiv(y,GammaH(13,[2]))
    (True, 1)
    sage: x.is_gamma_h_equiv(y,GammaH(13,[5]))
    (False, 0)
    sage: x.is_gamma_h_equiv(y,GammaH(5,[]))
    (False, 0)
    sage: x.is_gamma_h_equiv(y,GammaH(23,[4]))
    (True, -1)

Enumerating the cusps for a space of modular symbols uses this
function.
    sage: G = GammaH(25,[6]) ; M = G.modular_symbols() ; M
    Modular Symbols space of dimension 11 for Congruence Subgroup Gamma_H(25) with H generated by [6] of weight 2 with sign 0 and over Rational Field
    sage: M.cusps()
    [37/75, 1/2, 31/125, 1/4, -2/5, -3/5, -1/5, -9/10, -3/10, -14/15, 7/15, 9/20]
    sage: len(M.cusps())
    12
    
This is always one more than the associated space of Eisenstein
series.
    sage: sage.modular.dims.dimension_eis_H(G,2)
    11
    sage: M.cuspidal_subspace()
    Modular Symbols subspace of dimension 0 of Modular Symbols space of dimension 11 for Congruence Subgroup Gamma_H(25) with H generated by [6] of weight 2 with sign 0 and over Rational Field
    sage: sage.modular.dims.dimension_cusp_forms_H(G,2)
    0

apply(self, g)

source code 

Return g(self), where g=[a,b,c,d] is a list of length 4, which
we view as a linear fractional transformation.

EXAMPLES:
    Apply the identity matrix:
    sage: Cusp(0).apply([1,0,0,1])
    0
    sage: Cusp(0).apply([0,-1,1,0])
    Infinity
    sage: Cusp(0).apply([1,-3,0,1])
    -3