# ToricVarieties, single 12
#
# DO NOT EDIT THIS FILE - EDIT EXAMPLES IN THE SOURCE INSTEAD!
#
# This file has been generated by AutoDoc. It contains examples extracted from
# the package documentation. Each example is preceded by a comment which gives
# the name of a GAPDoc XML file and a line range from which the example were
# taken. Note that the XML file in turn may have been generated by AutoDoc
# from some other input.
#
gap> START_TEST( "toricvarieties12.tst");

# doc/_Chunks.xml:429-474
gap> P1 := Polytope([[0],[1]]);
<A polytope in |R^1>
gap> P2 := Polytope([[0,0],[0,1],[1,0]]);
<A polytope in |R^2>
gap> P1 := ToricVariety( P1 );
<A projective toric variety of dimension 1>
gap> P2 := ToricVariety( P2 );
<A projective toric variety of dimension 2>
gap> P1P2 := P1*P2;
<A projective toric variety of dimension 3
 which is a product of 2 toric varieties>
gap> ClassGroup( P1 );
<A free left module of rank 1 on a free generator>
gap> Display(ByASmallerPresentation(ClassGroup( P1 )));
Z^(1 x 1)
gap> ClassGroup( P2 );
<A free left module of rank 1 on a free generator>
gap> Display(ByASmallerPresentation(ClassGroup( P2 )));
Z^(1 x 1)
gap> ClassGroup( P1P2 );
<A free left module of rank 2 on free generators>
gap> Display( last );
Z^(1 x 2)
gap> PicardGroup( P1P2 );
<A free left module of rank 2 on free generators>
gap> P1P2;
<A projective smooth toric variety of dimension 3 
 which is a product of 2 toric varieties>
gap> P2P1:=P2*P1;
<A projective toric variety of dimension 3 
 which is a product of 2 toric varieties>
gap> M := [[0,0,1],[1,0,0],[0,1,0]];
[ [ 0, 0, 1 ], [ 1, 0, 0 ], [ 0, 1, 0 ] ]
gap> M := ToricMorphism(P1P2,M,P2P1);
<A "homomorphism" of right objects>
gap> IsMorphism(M);
true
gap> ClassGroup(M);
<A homomorphism of left modules>
gap> Display(ClassGroup(M));
[ [  0,  1 ],
  [  1,  0 ] ]

the map is currently represented by the above 2 x 2 matrix

#
gap> STOP_TEST("toricvarieties12.tst", 1 );
