# Ticket #8988: trac_8988_Kahlercone_lattice.patch

File trac_8988_Kahlercone_lattice.patch, 5.3 KB (added by vbraun, 12 years ago)

Added a Mori_vectors() method while I'm at it.

• ## sage/schemes/generic/toric_variety.py

From: Volker Braun <vbraun@stp.dias.ie>
Trac 8988: introduce rational_divisor_class_group for Kaehler_cone, Mori_vectors

diff -r d887abe02c58 sage/schemes/generic/toric_variety.py
 a from sage.geometry.all import Cone, Fan from sage.matrix.all import matrix from sage.misc.all import latex from sage.modules.free_module import FreeModule from sage.modules.free_module_element import vector from sage.rings.all import PolynomialRing, QQ, is_Field, is_FractionField from sage.rings.all import PolynomialRing, ZZ, QQ, is_Field, is_FractionField from sage.schemes.generic.algebraic_scheme import AlgebraicScheme_subscheme from sage.schemes.generic.ambient_space import AmbientSpace from sage.schemes.generic.homset import SchemeHomset_coordinates """ return self.fan().is_smooth() def kaehler_cone(self): def rational_divisor_class_group(self): r""" Return the Kaehler cone of self. The rational divisor class group. OUTPUT: - matrix. - Returns the divisor class group modulo torsion, \mathop{Cl}(X) \otimes_\ZZ \QQ, of the toric variety. .. NOTE:: * If the toric variety is **smooth**, this equals the Picard group: the elements are the isomorphism classes of line bundles on the toric variety. The group law (which we write as addition) is the tensor product of the line bundles. The Picard group of a toric variety is always torsion-free. * The Weil divisor class group \mathop{Cl}(X) of a toric variety is a finitely generated abelian group and can contain torsion. Its rank equals (number of rays)-(rank of M,N-lattice). * The coordinates correspond to the rows of self.fan().gale_transform() * :meth:Kaehler_cone yields a cone in this group. EXAMPLES:: sage: fan = FaceFan(lattice_polytope.octahedron(2)) sage: P1xP1 = ToricVariety(fan) sage: P1xP1.rational_divisor_class_group() Vector space of dimension 2 over Rational Field """ if "_rational_divisor_class_group" not in self.__dict__: self._rational_divisor_class_group = \ FreeModule(QQ, self.fan().nrays()-self.fan().lattice_dim()) return self._rational_divisor_class_group def Kaehler_cone(self): r""" The Kähler cone OUTPUT: Returns the Kähler cone of self as a cone in \mathop{Cl}(X) \otimes_\ZZ \QQ, see :meth:rational_divisor_class_group. EXAMPLES:: sage: fan = FaceFan(lattice_polytope.octahedron(2)) sage: P1xP1 = ToricVariety(fan) sage: P1xP1.kaehler_cone().ray_matrix() [0 1] [1 0] sage: Kc = P1xP1.Kaehler_cone() sage: Kc 2-d cone in 2-d lattice sage: Kc.rays() ((0, 1), (1, 0)) sage: Kc.lattice() Vector space of dimension 2 over Rational Field """ if "_kaehler_cone" not in self.__dict__: if "_Kaehler_cone" not in self.__dict__: fan = self.fan() GT = fan.gale_transform().columns() n = fan.nrays() K = None for cone in fan: sigma = Cone(GT[i] for i in range(n) if i not in cone.ambient_ray_indices()) sigma = Cone([GT[i] for i in range(n) if i not in cone.ambient_ray_indices()], lattice = self.rational_divisor_class_group()) K = K.intersection(sigma) if K is not None else sigma self._kaehler_cone = K return self._kaehler_cone self._Kaehler_cone = K return self._Kaehler_cone def Mori_vectors(self): """ Returns the rays of the Mori cone. OUTPUT: - The rays of the Mori cone, that is, the dual of the Kähler cone. - The points in the Mori cone are the effective curves in the variety. - The first self.fan().nrays() integer entries in each Mori vector are the intersection numbers of the curve corresponding to the generator of the ray with the divisors of the toric variety in the same order as :meth:divisors. - The last entry is associated to the orgin of the N-lattice. - The Mori vectors are also known as the gauged linear sigma model charge vectors. EXAMPLES:: sage: P4_11169 = toric_varieties.P4_11169_resolved() sage: P4_11169.Mori_vectors() [(3, 2, 0, 0, 0, 1, -6), (0, 0, 1, 1, 1, -3, 0)] """ Mc = [ facet_normal * self._fan.gale_transform() for facet_normal in self.Kaehler_cone().facet_normals() ] return Mc; def resolve(self, **kwds): r"""