Module: sage.modular.cusps
The set
of cusps
sage: Cusps Set P^1(QQ) of all cusps
sage: Cusp(oo) Infinity
Class: 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.
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
| self, a, [b=1], [construct=False], [parent=None]) |
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
Functions: apply,
denominator,
is_gamma0_equiv,
is_gamma1_equiv,
is_gamma_h_equiv,
is_infinity,
numerator
| self, g) |
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
| self) |
sage: x=Cusp(6,9); x 2/3 sage: x.denominator() 3 sage: Cusp(oo).denominator() 0 sage: Cusp(-5/10).denominator() 2
| self, other, N, [transformation=False]) |
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
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.
| self, other, N) |
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.
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)
| self, other, G) |
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
sage: G = GammaH(13,[2]) sage: x = Cusp(2,3) sage: y = Cusp(4,5) sage: x.is_gamma_h_equiv(y,G) (True, 1)
| self) |
sage: Cusp(3/5).is_infinity() False sage: Cusp(1,0).is_infinity() True sage: Cusp(0,1).is_infinity() False
| self) |
sage: x=Cusp(6,9); x 2/3 sage: x.numerator() 2 sage: Cusp(oo).numerator() 1 sage: Cusp(-5/10).numerator() -1
Special Functions: __cmp__,
__neg__,
_integer_,
_latex_,
_rational_,
_repr_
| self, right) |
The ordering in comparison is only really meaningful for infinity or elements that coerce to the rationals.
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
| self) |
sage: -Cusp(2/7) -2/7 sage: -Cusp(oo) Infinity
| self) |
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
| self) |
sage: latex(Cusp(-2/7))
\frac{-2}{7}
sage: latex(Cusp(oo))
\infty
| self) |
sage: QQ(Cusp(oo)) Traceback (most recent call last): ... TypeError: cusp Infinity is not a rational number sage: QQ(Cusp(-3,7)) -3/7
| self) |
sage: a = Cusp(2/3); a
2/3
sage: a.rename('2/3(cusp)'); a
2/3(cusp)
Class: Cusps_class
sage: C = Cusps; C Set P^1(QQ) of all cusps sage: loads(C.dumps()) == C True
| self) |
Special Functions: __call__,
__cmp__,
_coerce_impl,
_latex_,
_repr_
| self, x) |
sage: a = Cusps(-4/5); a -4/5 sage: Cusps(a) is a False sage: Cusps(1.5) 3/2 sage: Cusps(oo) Infinity sage: Cusps(I) Traceback (most recent call last): ... TypeError: Unable to coerce I (<class 'sage.functions.constants.I_class'>) to Rational
| self, right) |
sage: Cusps == Cusps True sage: Cusps == QQ False
| self, x) |
sage: Cusps._coerce_(7/13) 7/13 sage: Cusps._coerce_(GF(7)(3)) Traceback (most recent call last): ... TypeError: no canonical coercion of element into self sage: Cusps(GF(7)(3)) 3
| self) |
sage: latex(Cusps)
\mathbf{P}^1(\mathbf{Q})
| self) |
sage: Cusps
Set P^1(QQ) of all cusps
sage: Cusps.rename('CUSPS'); Cusps
CUSPS
sage: Cusps.rename(); Cusps
Set P^1(QQ) of all cusps
sage: Cusps
Set P^1(QQ) of all cusps