def _image_of_abvar(self, A): """ Compute the image of the abelian variety `A` under this morphism. INPUT: - ``A`` - an abelian variety OUTPUT an abelian variety EXAMPLES:: sage: t = J0(33).hecke_operator(2) sage: t._image_of_abvar(J0(33).new_subvariety()) Abelian subvariety of dimension 1 of J0(33) :: sage: t = J0(33).hecke_operator(3) sage: A = J0(33)[0] sage: B = t._image_of_abvar(A); B Abelian subvariety of dimension 1 of J0(33) sage: B == A False sage: A + B == J0(33).old_subvariety() True :: sage: J = J0(37) ; A, B = J.decomposition() sage: J.projection(A)._image_of_abvar(A) Abelian subvariety of dimension 1 of J0(37) sage: J.projection(A)._image_of_abvar(B) Abelian subvariety of dimension 0 of J0(37) sage: J.projection(B)._image_of_abvar(A) Abelian subvariety of dimension 0 of J0(37) sage: J.projection(B)._image_of_abvar(B) Abelian subvariety of dimension 1 of J0(37) sage: J.projection(B)._image_of_abvar(J) Abelian subvariety of dimension 1 of J0(37) """ D = self.domain() C = self.codomain() if A is D: B = self.matrix() else: if not A.is_subvariety(D): raise ValueError, "A must be an abelian subvariety of self." # Write the vector space corresponding to A in terms of self's # vector space, then take the image under self. B = D.vector_space().coordinate_module(A.vector_space()).basis_matrix() * self.matrix() V = (B * C.vector_space().basis_matrix()).row_module(QQ) lattice = V.intersection(C.lattice()) base_field = C.base_field() return abelian_variety.ModularAbelianVariety(C.groups(), lattice, base_field)
def AbelianVariety(X): """ Create the abelian variety corresponding to the given defining data. INPUT: - ``X`` - an integer, string, newform, modsym space, congruence subgroup or tuple of congruence subgroups OUTPUT: a modular abelian variety EXAMPLES:: sage: AbelianVariety(Gamma0(37)) Abelian variety J0(37) of dimension 2 sage: AbelianVariety('37a') Newform abelian subvariety 37a of dimension 1 of J0(37) sage: AbelianVariety(Newform('37a')) Newform abelian subvariety 37a of dimension 1 of J0(37) sage: AbelianVariety(ModularSymbols(37).cuspidal_submodule()) Abelian variety J0(37) of dimension 2 sage: AbelianVariety((Gamma0(37), Gamma0(11))) Abelian variety J0(37) x J0(11) of dimension 3 sage: AbelianVariety(37) Abelian variety J0(37) of dimension 2 sage: AbelianVariety([1,2,3]) Traceback (most recent call last): ... TypeError: X must be an integer, string, newform, modsym space, congruence subgroup or tuple of congruence subgroups """ if isinstance(X, (int, long, Integer)): X = Gamma0(X) if is_CongruenceSubgroup(X): X = X.modular_symbols().cuspidal_submodule() elif isinstance(X, str): from sage.modular.modform.constructor import Newform f = Newform(X, names='a') return ModularAbelianVariety_newform(f, internal_name=True) elif isinstance(X, sage.modular.modform.element.Newform): return ModularAbelianVariety_newform(X) if is_ModularSymbolsSpace(X): return abvar.ModularAbelianVariety_modsym(X) if isinstance(X, (tuple, list)) and all([is_CongruenceSubgroup(G) for G in X]): return abvar.ModularAbelianVariety(X) raise TypeError( "X must be an integer, string, newform, modsym space, congruence subgroup or tuple of congruence subgroups" )