def __init__(self, X, Y, category=None, check=True, base=ZZ): """ The Python constructor. INPUT: The same as for any homset, see :mod:`~sage.categories.homset`. EXAMPLES:: sage: P1xP1 = toric_varieties.P1xP1() sage: P1 = toric_varieties.P1() sage: hom_set = P1xP1.Hom(P1); hom_set Set of morphisms From: 2-d CPR-Fano toric variety covered by 4 affine patches To: 1-d CPR-Fano toric variety covered by 2 affine patches An integral matrix defines a fan morphism, since we think of the matrix as a linear map on the toric lattice. This is why we need to ``register_conversion`` in the constructor below. The result is:: sage: hom_set(matrix([[1],[0]])) Scheme morphism: From: 2-d CPR-Fano toric variety covered by 4 affine patches To: 1-d CPR-Fano toric variety covered by 2 affine patches Defn: Defined by sending Rational polyhedral fan in 2-d lattice N to Rational polyhedral fan in 1-d lattice N. """ SchemeHomset_generic.__init__(self, X, Y, category=category, check=check, base=base) self.register_conversion(MatrixSpace(ZZ, X.fan().dim(), Y.fan().dim()))
def __init__(self, X, S): R = X.base_ring() SchemeHomset_generic.__init__(self, spec.Spec(S, R), X) P2 = X.curve()._printing_ring if S != R: y = str(P2.gen()) x = str(P2.base_ring().gen()) P1 = PolynomialRing(S,name=x) P2 = PolynomialRing(P1,name=y) self._printing_ring = P2
def __init__(self, X, S): R = X.base_ring() SchemeHomset_generic.__init__(self, spec.Spec(S, R), X) P2 = X.curve()._printing_ring if S != R: y = str(P2.gen()) x = str(P2.base_ring().gen()) P1 = PolynomialRing(S, name=x) P2 = PolynomialRing(P1, name=y) self._printing_ring = P2