"Source: Text/Geometry/Toric.text";
"Line: 660";
"Date: Thu Sep 25 14:47:45 2025";
"Main: Fri Sep 26 14:29:19 2025";
// original file: Text/Geometry/Toric.text, line: 660
// Example: H129E7 ()
print "Example: H129E7";
ei := GetEchoInput();
SetEchoInput(true);
F:=FanWithWeights([
    [ 1, 1,-1, 0,-2, 0 ],
    [ 0, 0, 1, 1, 0, 0 ],
    [ 0, 0, 0, 0, 1, 1 ]
]);
X<[x]>:=ToricVariety(Rationals(),F);
X;
IsFano(X);
assert $1;
IsNonsingular(X);
assert not $1;
IsQFactorial(X);
assert $1;
IsTerminal(X);
assert $1;
P:=WPS(Rationals(),[1,1,1,2]);
F:=Fan(P);
F;
N:=Ambient(F);
pt1:=N ! [1,-1,0];
pt2:=N ! [-1,0,0];
Y1:=Blowup(P,pt1);
Y<[y]>:=Blowup(Y1,pt2);
Y;
IsFano(Y);
assert $1;
PX:=Polytope(Rays(Fan(X)));
PY:=Polytope(Rays(Fan(Y)));
bool,phi:=IsIsomorphic(PX,PY);
bool;
assert $1;
phi;
DefiningMatrix(phi);
Image(phi,Fan(X)) eq Fan(Y);
assert $1;
SetEchoInput(ei);
