-
Notifications
You must be signed in to change notification settings - Fork 0
/
demo.m2
138 lines (92 loc) · 2.72 KB
/
demo.m2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
needsPackage("Desingularization");
needsPackage("Divisor");
--R = QQ[x,y];
--m = ideal(x,y);
--S = desingStep(R);
--T = blowupCharts(S, m);
-- Checks if the strict transform is smooth in each chart of a Step.
--testRing = QQ[x,y];
--D1 = divisor(ideal(y*(y - x^2)));
--D2 = divisor(ideal(y*x*(x + y)));
--D3 = divisor(x^3*y^4);
-- nonSNCLocus(D1);
--cusp = ideal(y^2 - x^3);
--cuspresolution = curveResolution(cusp);
-- TBC Make the above work for D1. The recursive step misses multiplicities by taking divisors.
--R = QQ[x,y];
--I1 = ideal(y-x^2);
--J1 = ideal(y);
--D1 = divisor(I1*J1);
--a1 = nonSNCLocusAlongIdeal(D1,J1); -- expect (x,y)
--I2 = ideal(y-x^2*(x-1));
--J2 = ideal(y);
--D2 = divisor(I2*J2);
--a2 = nonSNCLocusAlongIdeal(D2,J2); -- expect (x,y)
--I3 = ideal((y-2*x)*(y-3*x));
--J3 = ideal(y-x);
--D3 = divisor(I3*J3);
--a3 = nonSNCLocusAlongIdeal(D3,J3); -- expect (x,y)
-- note: press "alt + enter" to run these commands in the terminal w/o copying & pasting
needsPackage("Desingularization");
needsPackage("Divisor");
-- R = QQ[x,y]
-- step0 = desingStep(R)
-- step1 = blowupCharts(step0, ideal(x,y))
-- R1 = target(step1#Charts#0)
-- m = ideal(T1_1, y)
-- step2 = blowupCharts(step1, m)
-- I = ideal(x^2*(1-y^3*x))
-- cusp, should require 2 blow-ups
-- I = ideal(y^2-x^7);
-- curveResolution(I)
-- D = divisor(ideal(y^2-x^5));
-- s1 = desingStep(D);
-- locus = nonSNCLocus(s1);
-- s1#Boundary#0
-- s1#CheckLoci#0
-- nonSNCLocusAlongIdeal(s1#Boundary#0,s1#CheckLoci#0)
-- s2 = blowupCharts(s1,locus#0)
-- R = QQ[x,y]
-- m = ideal(x,y)
-- step0 = desingStep(R)
-- step1 = blowupCharts(step0, m)
-- peek step1
-- R = QQ[x,y]
-- S = R[t]/ideal(x*t-y)
-- singularLocus(S)
-- To compute D^n for an n dimensional normal projective variety X and a Cartier divisor D.
-- R = QQ[x,y,z];
-- D = divisor(x*y^2 - z^3);
-- S = projDesingStep(D);
-- curveResolution(S);
-- Chartring = target((S#Charts)#0);
-- m = sub(ideal(y,z), Chartring);
-- S1 = blowupCharts(S, m);
needsPackage("Desingularization");
needsPackage("Divisor");
R = QQ[x,y,z];
curveResolution(projDesingStep(divisor(z*x^2-y^3)));
-- D = divisor(x^2 - y^3);
-- S = desingStep(D);
-- m = ideal(x,y);
-- S1 = blowupCharts(S, m);
-- R1 = target (S1#Charts)#0;
-- m1 = sub(ideal(T1_1, y), R1);
-- S2 = blowupCharts(S1, m1);
-- Included here for testing since it won't be exported.
mutaBate = method();
mutaBate(List) := L -> (
output := new MutableList from L;
for i from 0 to (#L - 1) do (
output#i = new MutableList from L#i;
);
return output;
);
demutaBate = method();
demutaBate(MutableList) := L -> (
output := {};
for i from 0 to (#L - 1) do (
output = append(output, new List from (L#i));
);
return output;
);