def __add__(self, other): """ Return the sum of two subgroups. EXAMPLES:: sage: C = J0(22).cuspidal_subgroup() sage: C.gens() [[(1/5, 1/5, 4/5, 0)], [(0, 0, 0, 1/5)]] sage: A = C.subgroup([C.0]); B = C.subgroup([C.1]) sage: A + B == C True """ if not isinstance(other, FiniteSubgroup): raise TypeError, "only addition of two finite subgroups is defined" A = self.abelian_variety() B = other.abelian_variety() if not A.in_same_ambient_variety(B): raise ValueError( "self and other must be in the same ambient Jacobian") K = composite_field(self.field_of_definition(), other.field_of_definition()) lattice = self.lattice() + other.lattice() if A != B: lattice += C.lattice() return FiniteSubgroup_lattice(self.abelian_variety(), lattice, field_of_definition=K)
def __add__(self, other): """ Return the sum of two subgroups. EXAMPLES:: sage: C = J0(22).cuspidal_subgroup() sage: C.gens() [[(1/5, 1/5, 4/5, 0)], [(0, 0, 0, 1/5)]] sage: A = C.subgroup([C.0]); B = C.subgroup([C.1]) sage: A + B == C True """ if not isinstance(other, FiniteSubgroup): raise TypeError, "only addition of two finite subgroups is defined" A = self.abelian_variety() B = other.abelian_variety() if not A.in_same_ambient_variety(B): raise ValueError("self and other must be in the same ambient Jacobian") K = composite_field(self.field_of_definition(), other.field_of_definition()) lattice = self.lattice() + other.lattice() if A != B: lattice += C.lattice() return FiniteSubgroup_lattice(self.abelian_variety(), lattice, field_of_definition=K)
def intersection(self, other): """ Return the intersection of the finite subgroups self and other. INPUT: - ``other`` - a finite group OUTPUT: a finite group EXAMPLES:: sage: E11a0, E11a1, B = J0(33) sage: G = E11a0.torsion_subgroup(6); H = E11a0.torsion_subgroup(9) sage: G.intersection(H) Finite subgroup with invariants [3, 3] over QQ of Simple abelian subvariety 11a(1,33) of dimension 1 of J0(33) sage: W = E11a1.torsion_subgroup(15) sage: G.intersection(W) Finite subgroup with invariants [] over QQ of Simple abelian subvariety 11a(1,33) of dimension 1 of J0(33) sage: E11a0.intersection(E11a1)[0] Finite subgroup with invariants [5] over QQ of Simple abelian subvariety 11a(1,33) of dimension 1 of J0(33) We intersect subgroups of different abelian varieties. :: sage: E11a0, E11a1, B = J0(33) sage: G = E11a0.torsion_subgroup(5); H = E11a1.torsion_subgroup(5) sage: G.intersection(H) Finite subgroup with invariants [5] over QQ of Simple abelian subvariety 11a(1,33) of dimension 1 of J0(33) sage: E11a0.intersection(E11a1)[0] Finite subgroup with invariants [5] over QQ of Simple abelian subvariety 11a(1,33) of dimension 1 of J0(33) We intersect abelian varieties with subgroups:: sage: t = J0(33).hecke_operator(7) sage: G = t.kernel()[0]; G Finite subgroup with invariants [2, 2, 2, 2, 4, 4] over QQ of Abelian variety J0(33) of dimension 3 sage: A = J0(33).old_subvariety() sage: A.intersection(G) Finite subgroup with invariants [2, 2, 2, 2] over QQ of Abelian subvariety of dimension 2 of J0(33) sage: A.hecke_operator(7).kernel()[0] Finite subgroup with invariants [2, 2, 2, 2] over QQ of Abelian subvariety of dimension 2 of J0(33) sage: B = J0(33).new_subvariety() sage: B.intersection(G) Finite subgroup with invariants [4, 4] over QQ of Abelian subvariety of dimension 1 of J0(33) sage: B.hecke_operator(7).kernel()[0] Finite subgroup with invariants [4, 4] over QQ of Abelian subvariety of dimension 1 of J0(33) sage: A.intersection(B)[0] Finite subgroup with invariants [3, 3] over QQ of Abelian subvariety of dimension 2 of J0(33) """ A = self.abelian_variety() if abelian_variety.is_ModularAbelianVariety(other): amb = other B = other M = B.lattice().scale(Integer(1) / self.exponent()) K = composite_field(self.field_of_definition(), other.base_field()) else: amb = A if not isinstance(other, FiniteSubgroup): raise TypeError, "only addition of two finite subgroups is defined" B = other.abelian_variety() if A.ambient_variety() != B.ambient_variety(): raise TypeError, "finite subgroups must be in the same ambient product Jacobian" M = other.lattice() K = composite_field(self.field_of_definition(), other.field_of_definition()) L = self.lattice() if A != B: # TODO: This might be way slower than what we could do if # we think more carefully. C = A + B L = L + C.lattice() M = M + C.lattice() W = L.intersection(M).intersection(amb.vector_space()) return FiniteSubgroup_lattice(amb, W, field_of_definition=K)
def intersection(self, other): """ Return the intersection of the finite subgroups self and other. INPUT: - ``other`` - a finite group OUTPUT: a finite group EXAMPLES:: sage: E11a0, E11a1, B = J0(33) sage: G = E11a0.torsion_subgroup(6); H = E11a0.torsion_subgroup(9) sage: G.intersection(H) Finite subgroup with invariants [3, 3] over QQ of Simple abelian subvariety 11a(1,33) of dimension 1 of J0(33) sage: W = E11a1.torsion_subgroup(15) sage: G.intersection(W) Finite subgroup with invariants [] over QQ of Simple abelian subvariety 11a(1,33) of dimension 1 of J0(33) sage: E11a0.intersection(E11a1)[0] Finite subgroup with invariants [5] over QQ of Simple abelian subvariety 11a(1,33) of dimension 1 of J0(33) We intersect subgroups of different abelian varieties. :: sage: E11a0, E11a1, B = J0(33) sage: G = E11a0.torsion_subgroup(5); H = E11a1.torsion_subgroup(5) sage: G.intersection(H) Finite subgroup with invariants [5] over QQ of Simple abelian subvariety 11a(1,33) of dimension 1 of J0(33) sage: E11a0.intersection(E11a1)[0] Finite subgroup with invariants [5] over QQ of Simple abelian subvariety 11a(1,33) of dimension 1 of J0(33) We intersect abelian varieties with subgroups:: sage: t = J0(33).hecke_operator(7) sage: G = t.kernel()[0]; G Finite subgroup with invariants [2, 2, 2, 2, 4, 4] over QQ of Abelian variety J0(33) of dimension 3 sage: A = J0(33).old_subvariety() sage: A.intersection(G) Finite subgroup with invariants [2, 2, 2, 2] over QQ of Abelian subvariety of dimension 2 of J0(33) sage: A.hecke_operator(7).kernel()[0] Finite subgroup with invariants [2, 2, 2, 2] over QQ of Abelian subvariety of dimension 2 of J0(33) sage: B = J0(33).new_subvariety() sage: B.intersection(G) Finite subgroup with invariants [4, 4] over QQ of Abelian subvariety of dimension 1 of J0(33) sage: B.hecke_operator(7).kernel()[0] Finite subgroup with invariants [4, 4] over QQ of Abelian subvariety of dimension 1 of J0(33) sage: A.intersection(B)[0] Finite subgroup with invariants [3, 3] over QQ of Abelian subvariety of dimension 2 of J0(33) """ A = self.abelian_variety() if abelian_variety.is_ModularAbelianVariety(other): amb = other B = other M = B.lattice().scale(Integer(1)/self.exponent()) K = composite_field(self.field_of_definition(), other.base_field()) else: amb = A if not isinstance(other, FiniteSubgroup): raise TypeError, "only addition of two finite subgroups is defined" B = other.abelian_variety() if A.ambient_variety() != B.ambient_variety(): raise TypeError, "finite subgroups must be in the same ambient product Jacobian" M = other.lattice() K = composite_field(self.field_of_definition(), other.field_of_definition()) L = self.lattice() if A != B: # TODO: This might be way slower than what we could do if # we think more carefully. C = A + B L = L + C.lattice() M = M + C.lattice() W = L.intersection(M).intersection(amb.vector_space()) return FiniteSubgroup_lattice(amb, W, field_of_definition=K)