-- -*- M2-comint -*- hash: 7384208557076558372

i1 : PP2 = toricProjectiveSpace 2;

i2 : assert (isSmooth PP2 and isProjective PP2)

i3 : fromCDivToWDiv PP2

o3 = | 1 0 0 |
     | 0 1 0 |
     | 0 0 1 |

              3       3
o3 : Matrix ZZ  <-- ZZ

i4 : assert (fromCDivToWDiv PP2 === id_(weilDivisorGroup PP2))

i5 : X = smoothFanoToricVariety (4,20);

i6 : assert (isSmooth X and isProjective X and isFano X)

i7 : fromCDivToWDiv X

o7 = | 1 0 0 0 0 0 0 |
     | 0 1 0 0 0 0 0 |
     | 0 0 1 0 0 0 0 |
     | 0 0 0 1 0 0 0 |
     | 0 0 0 0 1 0 0 |
     | 0 0 0 0 0 1 0 |
     | 0 0 0 0 0 0 1 |

              7       7
o7 : Matrix ZZ  <-- ZZ

i8 : assert (fromCDivToWDiv X === id_(weilDivisorGroup X))

i9 : U = normalToricVariety ({{4,-1},{0,1}},{{0},{1}});

i10 : assert (isSmooth U and not isComplete U)

i11 : fromCDivToWDiv U

o11 = | 1 0 |
      | 0 1 |

               2       2
o11 : Matrix ZZ  <-- ZZ

i12 : assert (fromCDivToWDiv U === id_(weilDivisorGroup U))

i13 : C = normalToricVariety ({{4,-1},{0,1}},{{0,1}});

i14 : fromCDivToWDiv C

o14 = | 4 -1 |
      | 0 1  |

               2       2
o14 : Matrix ZZ  <-- ZZ

i15 : prune cokernel fromCDivToWDiv C

o15 = cokernel | 4 |

                               1
o15 : ZZ-module, quotient of ZZ

i16 : assert (rank cokernel fromCDivToWDiv C === 0)

i17 : Q = normalToricVariety ({{1,0,0},{0,1,0},{0,0,1},{1,1,-1}},{{0,1,2,3}});

i18 : assert (not isSimplicial Q and not isComplete Q)

i19 : fromCDivToWDiv Q

o19 = | 1 0 0  |
      | 0 1 0  |
      | 0 0 1  |
      | 1 1 -1 |

               4       3
o19 : Matrix ZZ  <-- ZZ

i20 : prune coker fromCDivToWDiv Q

        1
o20 = ZZ

o20 : ZZ-module, free

i21 : assert (rank coker fromCDivToWDiv Q === 1)

i22 : Y = normalToricVariety (id_(ZZ^3) | -id_(ZZ^3));

i23 : assert (not isSimplicial Y and isComplete Y)

i24 : fromCDivToWDiv Y

o24 = | 1  1  1  1 |
      | -1 1  1  1 |
      | 1  -1 1  1 |
      | -1 -1 1  1 |
      | 1  1  -1 1 |
      | -1 1  -1 1 |
      | 1  -1 -1 1 |
      | -1 -1 -1 1 |

               8       4
o24 : Matrix ZZ  <-- ZZ

i25 : prune cokernel fromCDivToWDiv Y

o25 = cokernel | 2 0 0 |
               | 0 2 0 |
               | 0 0 2 |
               | 0 0 0 |
               | 0 0 0 |
               | 0 0 0 |
               | 0 0 0 |

                               7
o25 : ZZ-module, quotient of ZZ

i26 : assert (rank coker fromCDivToWDiv Y === 4)

i27 : 
