def _element_constructor_(self, x, check=True): r""" Construct a :class:`ChowCycle`. INPUT: - ``x`` -- a cone of the fan, a toric divisor, or a valid input for :class:sage.modules.fg_pid.fgp_module.FGP_Module_class`. - ``check`` -- bool (default: ``True``). See :class:sage.modules.fg_pid.fgp_module.FGP_Module_class`. EXAMPLES:: sage: dP6 = toric_varieties.dP6() sage: A = dP6.Chow_group() sage: cone = dP6.fan(dim=1)[4] sage: A(cone) ( 0 | 0, 1, 0, 0 | 0 ) sage: A(Cone(cone)) # isomorphic but not identical to a cone of the fan! ( 0 | 0, 1, 0, 0 | 0 ) sage: A( dP6.K() ) ( 0 | -1, -2, -2, -1 | 0 ) """ fan = self._variety.fan() if is_Cone(x): cone = fan.embed(x) return self.element_class(self, self._cone_to_V(cone), False) if is_ToricDivisor(x): v = sum(x.coefficient(i)*self._cone_to_V(onecone) for i,onecone in enumerate(fan(1))) return self.element_class(self, v, False) return super(ChowGroup_class,self)._element_constructor_(x, check)
def intersection_with_divisor(self, divisor): """ Intersect the Chow cycle with ``divisor``. See [FultonChow]_ for a description of the toric algorithm. INPUT: - ``divisor`` -- a :class:`ToricDivisor <sage.schemes.toric.divisor.ToricDivisor_generic>` that can be moved away from the Chow cycle. For example, any Cartier divisor. See also :meth:`ToricDivisor.move_away_from <sage.schemes.toric.divisor.ToricDivisor_generic.move_away_from>`. OUTPUT: A new :class:`ChowCycle`. If the divisor is not Cartier then this method potentially raises a ``ValueError``, indicating that the divisor cannot be made transversal to the Chow cycle. EXAMPLES:: sage: dP6 = toric_varieties.dP6() sage: cone = dP6.fan().cone_containing(2); cone 1-d cone of Rational polyhedral fan in 2-d lattice N sage: D = dP6.divisor(cone); D V(y) sage: A = dP6.Chow_group() sage: A(cone) ( 0 | 0, 0, 0, 1 | 0 ) sage: intersection = A(cone).intersection_with_divisor(D); intersection ( -1 | 0, 0, 0, 0 | 0 ) sage: intersection.count_points() -1 You can do the same computation over the rational Chow group since there is no torsion in this case:: sage: A_QQ = dP6.Chow_group(base_ring=QQ) sage: A_QQ(cone) ( 0 | 0, 0, 0, 1 | 0 ) sage: intersection_QQ = A_QQ(cone).intersection_with_divisor(D); intersection ( -1 | 0, 0, 0, 0 | 0 ) sage: intersection_QQ.count_points() -1 sage: type(intersection_QQ.count_points()) <type 'sage.rings.rational.Rational'> sage: type(intersection.count_points()) <type 'sage.rings.integer.Integer'> TESTS: The relations are the Chow cycles rationally equivalent to the zero cycle. Their intersection with any divisor must be the zero cycle:: sage: [ r.intersection_with_divisor(D) for r in dP6.Chow_group().relation_gens() ] [( 0 | 0, 0, 0, 0 | 0 ), ( 0 | 0, 0, 0, 0 | 0 ), ( 0 | 0, 0, 0, 0 | 0 ), ( 0 | 0, 0, 0, 0 | 0 ), ( 0 | 0, 0, 0, 0 | 0 ), ( 0 | 0, 0, 0, 0 | 0 ), ( 0 | 0, 0, 0, 0 | 0 )] sage: [ r.intersection_with_divisor(D).lift() for r in dP6.Chow_group().relation_gens() ] [(0, 0, 0, 0, 0, 0, 0, 0, 1, -1, 0, 0, 0), (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)] """ assert is_ToricDivisor(divisor), str(divisor)+' is not a toric divisor.' A = self.parent() # the Chow group X = A._variety # the toric variety intersection = A(0) coefficients = self.lift() for sigma_idx, sigma in enumerate(A._cones): if sigma.dim()==X.dimension(): # full-dimensional cone = degree-0 Chow cycle continue coefficient = coefficients[sigma_idx] if coefficient==0: continue D = divisor.move_away_from(sigma) for gamma in sigma.facet_of(): # note: the relative quotients are of dimension one n = gamma.relative_quotient(sigma).gen(0).lift() perp = sigma.relative_orthogonal_quotient(gamma).gen(0).lift() I_gamma = set(gamma.ambient_ray_indices()) - set(sigma.ambient_ray_indices()) i = I_gamma.pop() # index of a ray in gamma but not sigma v_i = X.fan().ray(i) a_i = D.coefficient(i) s_i = (v_i*perp)/(n*perp) b_gamma = a_i/s_i # print sigma._points_idx, "\t", i, D, a_i, s_i, b_gamma, gamma.A() intersection += self.base_ring()(coefficient*b_gamma) * A(gamma) return intersection