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 b  
    231231from sage.geometry.all import Cone, Fan
    232232from sage.matrix.all import matrix
    233233from sage.misc.all import latex
     234from sage.modules.free_module import FreeModule
    234235from sage.modules.free_module_element import vector
    235 from sage.rings.all import PolynomialRing, QQ, is_Field, is_FractionField
     236from sage.rings.all import PolynomialRing, ZZ, QQ, is_Field, is_FractionField
    236237from sage.schemes.generic.algebraic_scheme import AlgebraicScheme_subscheme
    237238from sage.schemes.generic.ambient_space import AmbientSpace
    238239from sage.schemes.generic.homset import SchemeHomset_coordinates
     
    11831184        """
    11841185        return self.fan().is_smooth()
    11851186
    1186     def kaehler_cone(self):
     1187    def rational_divisor_class_group(self):
    11871188        r"""
    1188         Return the Kaehler cone of ``self``.
     1189        The rational divisor class group.
    11891190
    11901191        OUTPUT:
    11911192
    1192         - matrix.
     1193        - Returns the divisor class group modulo torsion,
     1194          `\mathop{Cl}(X) \otimes_\ZZ \QQ`, of the toric variety.
     1195
     1196        .. NOTE::
     1197       
     1198            * If the toric variety is **smooth**, this equals the
     1199              Picard group: the elements are the isomorphism classes
     1200              of line bundles on the toric variety. The group law
     1201              (which we write as addition) is the tensor product of
     1202              the line bundles. The Picard group of a toric variety is
     1203              always torsion-free.
     1204       
     1205            * The Weil divisor class group `\mathop{Cl}(X)` of a toric
     1206              variety is a finitely generated abelian group and can
     1207              contain torsion. Its rank equals (number of rays)-(rank
     1208              of M,N-lattice).
     1209
     1210            * The coordinates correspond to the rows of ``self.fan().gale_transform()``
     1211       
     1212            * :meth:`Kaehler_cone` yields a cone in this group.
     1213
     1214        EXAMPLES::
     1215       
     1216            sage: fan = FaceFan(lattice_polytope.octahedron(2))
     1217            sage: P1xP1 = ToricVariety(fan)
     1218            sage: P1xP1.rational_divisor_class_group()
     1219            Vector space of dimension 2 over Rational Field
     1220        """
     1221        if "_rational_divisor_class_group" not in self.__dict__:
     1222            self._rational_divisor_class_group = \
     1223                FreeModule(QQ, self.fan().nrays()-self.fan().lattice_dim())
     1224        return self._rational_divisor_class_group
     1225
     1226    def Kaehler_cone(self):
     1227        r"""
     1228        The Kähler cone
     1229
     1230        OUTPUT:
     1231
     1232        Returns the Kähler cone of ``self`` as a cone in
     1233        `\mathop{Cl}(X) \otimes_\ZZ \QQ`, see
     1234        :meth:`rational_divisor_class_group`.
    11931235
    11941236        EXAMPLES::
    11951237
    11961238            sage: fan = FaceFan(lattice_polytope.octahedron(2))
    11971239            sage: P1xP1 = ToricVariety(fan)
    1198             sage: P1xP1.kaehler_cone().ray_matrix()
    1199             [0 1]
    1200             [1 0]
     1240            sage: Kc = P1xP1.Kaehler_cone()
     1241            sage: Kc
     1242            2-d cone in 2-d lattice
     1243            sage: Kc.rays()
     1244            ((0, 1), (1, 0))
     1245            sage: Kc.lattice()
     1246            Vector space of dimension 2 over Rational Field
    12011247        """
    1202         if "_kaehler_cone" not in self.__dict__:
     1248        if "_Kaehler_cone" not in self.__dict__:
    12031249            fan = self.fan()
    12041250            GT = fan.gale_transform().columns()
    12051251            n = fan.nrays()
    12061252            K = None
    12071253            for cone in fan:
    1208                 sigma = Cone(GT[i] for i in range(n)
    1209                                    if i not in cone.ambient_ray_indices())
     1254                sigma = Cone([GT[i] for i in range(n)
     1255                                    if i not in cone.ambient_ray_indices()],
     1256                             lattice = self.rational_divisor_class_group())
    12101257                K = K.intersection(sigma) if K is not None else sigma
    1211             self._kaehler_cone = K
    1212         return self._kaehler_cone
     1258            self._Kaehler_cone = K
     1259        return self._Kaehler_cone
     1260
     1261    def Mori_vectors(self):
     1262        """
     1263        Returns the rays of the Mori cone.
     1264
     1265        OUTPUT:
     1266
     1267        - The rays of the Mori cone, that is, the dual of the Kähler cone.
     1268
     1269        - The points in the Mori cone are the effective curves in the variety.
     1270
     1271        - The first ``self.fan().nrays()`` integer entries in each
     1272          Mori vector are the intersection numbers of the curve
     1273          corresponding to the generator of the ray with the divisors
     1274          of the toric variety in the same order as :meth:`divisors`.
     1275
     1276        - The last entry is associated to the orgin of the N-lattice.
     1277
     1278        - The Mori vectors are also known as the gauged linear sigma
     1279          model charge vectors.
     1280
     1281        EXAMPLES::
     1282
     1283            sage: P4_11169 = toric_varieties.P4_11169_resolved()
     1284            sage: P4_11169.Mori_vectors()
     1285            [(3, 2, 0, 0, 0, 1, -6), (0, 0, 1, 1, 1, -3, 0)]
     1286        """
     1287        Mc = [ facet_normal * self._fan.gale_transform()
     1288               for facet_normal in self.Kaehler_cone().facet_normals() ]
     1289        return Mc;
    12131290
    12141291    def resolve(self, **kwds):
    12151292        r"""