-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPositroid.m2
374 lines (311 loc) · 11.1 KB
/
Positroid.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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
newPackage(
"Positroid",
AuxiliaryFiles => false,
Version => "0.1",
Date => "",
Authors => {
{Name => "Ayah Almousa",
Email => "[email protected]",
HomePage => "http://sites.google.com/view/ayah-almousa"},
{Name=> "Shiliang Gao",
Email => "",
HomePage => ""},
{Name => "Daoji Huang",
Email => "[email protected]",
HomePage => "daojihuang.me"}
},
Headline => "functions for investigating positroid varieties",
PackageExports => {
"Posets"
},
DebuggingMode => true
)
export{
"pluckerPoset", -- documented ++
"pluckerRelations", -- NOT DOCUMENTED
"basicPositroidVariety", -- NOT DOCUMENTED
"leadTermBasicPositroid", -- NOT DOCUMENTED
"leadTermBasicPositroidWrapAround", -- NOT DOCUMENTED
"hodgeDegenerationBasicPositroid", -- NOT DOCUMENTED
"getMultidegree" -- NOT DOCUMENTED
}
------------------------------------------------------------------------------
------------------------------------------------------------------------------
-- **CODE** --
------------------------------------------------------------------------------
------------------------------------------------------------------------------
---------------------------------------
---------------------------------------
-- * PART 0: HELPER FUNCTIONS * --
---------------------------------------
---------------------------------------
multiSubsets := (n,k) -> (
S := subsets(n+k-1,k);
apply(S, i-> i - toList(0..k-1))
)
--------------------------------
--auxiliary function for generating a generic matrix of z variables
--INPUT: integers n,m
--OUTPUT: an n by m generic matrix eith entries z_(i,j)
--NOTE: the ring automatically comes equipped with the antidiagonal term order
-----------------------------------
genMat = method(
Options => {
CoefficientRing => QQ,
Variable => getSymbol "z"
}
)
genMat (ZZ,ZZ) := o -> (n,m) -> (
k := o.CoefficientRing;
zEntries := flatten table (n,m,(i,j) -> (i,j));
z := o.Variable;
Q := k(monoid[z_(1,1)..z_(n,m)]);
Mmut := mutableMatrix(Q,n,m);
for box in zEntries do (
Mmut_(box) = Q_(m*(box_0) + box_1);
);
matrix Mmut
)
--order for creating Plucker poset
cmp := (a,b) -> (
entryCompare := for i from 0 to #a-1 list (a_i >= b_i);
entryCompare == toList(#a:true)
)
---------------------------------------
---------------------------------------
-- * PART 1: Gr(k,n) * --
---------------------------------------
---------------------------------------
----------------------------------------------------------
--computes Plucker poset for Gr(n,m)
----------------------------------------------------------
pluckerPoset = method()
pluckerPoset(ZZ,ZZ) := Poset => (n,m) -> (
coords := subsets(m,n);
shiftedCoords := apply(coords, i-> i+toList(n:1));
poset(shiftedCoords, cmp)
)
----------------------------------------------------------
--outputs the defining relations for k[Gr(n,m)]
----------------------------------------------------------
pluckerRelations = method(
Options => {
CoefficientRing => QQ,
Variable => getSymbol "T"
}
)
pluckerRelations (ZZ,ZZ) := o -> (n,m) -> (
kk := o.CoefficientRing;
T := o.Variable;
P := pluckerPoset(n,m);
shiftedCoords := reverse flatten rank(P);
coordVars := apply(shiftedCoords, i-> T_i);
S := kk[coordVars, MonomialOrder=>RevLex, Global=>false];
M := genMat(n,m, CoefficientRing => kk, Variable => T);
Q := ring(M);
minorRels := apply(shiftedCoords, i-> det(M_(i-toList(n:1))));
F := map(Q,S,minorRels);
ker F
)
-------------------------------------------
-------------------------------------------
-- * PART 2: Basic positroid varieties * --
-------------------------------------------
-------------------------------------------
----------------------------------------------------------
--computes positroid Variety for Gr(k,n) with positroid (L,r)
----------------------------------------------------------
basicPositroidVariety = method(
Options => {
CoefficientRing => QQ,
Variable => getSymbol "T"
}
)
basicPositroidVariety (ZZ,ZZ,List,ZZ) := o -> (k,n,L,r) -> (
kk := o.CoefficientRing;
T := o.Variable;
I := pluckerRelations(k,n, CoefficientRing => kk, Variable => T);
R := ring I;
killedMinors := subsets(L,r+1);
killedCoords := new MutableList;
for i in R_* do (
for j in killedMinors do(
if isSubset(j,(baseName i)#1) then killedCoords#(#killedCoords) = i;
);
);
ideal mingens(I + ideal toList killedCoords)
)
--lists possible locations of generalized antidiagonals of length l
--for a standard monomial of degree d in Gr(k,n)
possibleGeneralizedAntidiagonals := (k,d,l) -> (
possibleRows := apply(select(multiSubsets(d,l), q-> isSubset(toList(0..d-1),q)),reverse);
possibleCols := subsets(k,l);
--apply(subsets(k,l),i-> i+toList(k:1));
apply(possibleRows**possibleCols, p -> pack(mingle p, 2))
)
----------------------------------------------
--outputs LTs without computing actual equations
--the output is as matrices that are transposes of semistandard tableaux
----------------------------------------------
leadTermBasicPositroid = method()
leadTermBasicPositroid (ZZ,ZZ,List,ZZ) := List => (k,n,L,r) -> (
P := pluckerPoset(k,n);
G := P.GroundSet;
badSets := subsets(L,r+1);
vanishingCoords := new MutableList;
--loop to find coordinates that should vanish
for g in G do (
for b in badSets do (
if isSubset(b,g) then (
vanishingCoords#(#vanishingCoords)=g;
break;
);
continue;
);
);
vanishingCoords = toList vanishingCoords;
P' := dropElements(P,vanishingCoords);
incompLTs := apply(antichains(P',2), i-> sort i);
antiDiagLTs := new MutableList;
for d from 2 to r+1 do (
antidiags := possibleGeneralizedAntidiagonals(k,d,r+1);
possibleLTs := apply(chains(P',d), i-> matrix sort i);
for m in possibleLTs do (
for a in antidiags do (
for b in badSets do (
if (b==apply(a, j -> m_(toSequence j))) then (
antiDiagLTs#(#antiDiagLTs) = m;
break;
);
continue;
);
);
);
);
antiDiagLTs = unique toList antiDiagLTs;
apply(vanishingCoords, i -> matrix{i})|apply(incompLTs, j-> matrix j)|antiDiagLTs
);
--------------------------------------------------------------------------
--meant for cases where interval wraps around, i.e. includes both n and 1
--------------------------------------------------------------------------
leadTermBasicPositroidWrapAround = method()
leadTermBasicPositroidWrapAround (ZZ, ZZ, List, ZZ) := List => (k,n,L,r) -> (
compLTs := leadTermBasicPositroid(n-k,n,toList(set(1..n)-L),n-k-#L+r);
apply(compLTs, i-> matrix(sort apply(entries i, j-> sort toList(set(1..n)-j))))
)
hodgeDegenerationBasicPositroid = method(
Options => {
CoefficientRing => QQ,
Variable => getSymbol "T"
}
)
hodgeDegenerationBasicPositroid(ZZ,ZZ,List,ZZ) := o -> (k,n,L,r) -> (
kk := o.CoefficientRing;
T := o.Variable;
P := pluckerPoset(k,n);
shiftedCoords := reverse flatten rank(P);
coordVars := apply(shiftedCoords, i-> T_i);
S := kk[coordVars, MonomialOrder=>RevLex, Global=>false];
varHash := hashTable apply(S_*, v-> last baseName v => v);
if any(L, i-> i==1) and any(L, i-> i==n) then (
tabs := leadTermBasicPositroidWrapAround(k,n,L,r);
)
else (tabs = leadTermBasicPositroid(k,n,L,r));
ideal apply(tabs, tab -> product(apply(entries tab, i -> varHash#i)))
);
getMultidegree = method();
getMultidegree(MonomialIdeal) := I -> (
t := symbol t;
R := ring I;
varList := R_*;
n := last last baseName varList#(#varList-1);
Q := ZZ[t_1..t_n];
comps := decompose I;
sum apply(comps, c-> product apply(c_*, i-> sum apply(last baseName i, j-> t_j)))
);
----------------------------------------------
----------------------------------------------
-- * PART 3: General positroid varieties * --
----------------------------------------------
----------------------------------------------
-------------------------------------------
-------------------------------------------
-- * PART 4: Cyclic Demazure modules * --
-------------------------------------------
-------------------------------------------
------------------------------------------------------------------------------
------------------------------------------------------------------------------
-- **DOCUMENTATION** --
------------------------------------------------------------------------------
------------------------------------------------------------------------------
beginDocumentation ()
doc ///
Key
Positroid
Headline
a package for investigating postroid varieties
Description
Text
This package provides functions for constructing and investigating postroid varieties.
This includes understanding Grobner bases and standard monomials for them.
This package also includes functions for investigating the torus characters of cyclic Demazure modules.
Text
@UL {
{"[KLS14] Allen Knutson, Thomas Lam, and David E. Speyer, ",
HREF("https://arxiv.org/abs/1008.3939", EM "Projections of Richardson Varieties"),
" , Journal für die reine und angewandte Mathematik (Crelles Journal), 2014(687), 133-157."},
}@
///
doc ///
Key
(pluckerPoset, ZZ, ZZ)
pluckerPoset
Headline
the Plucker poset for Gr(k,n)
Usage
pluckerPoset(k,n)
Inputs
n:ZZ
m:ZZ
Outputs
:Poset
Description
Text
Given integers k,n, outputs the poset of Plucker coordinates
Example
(pluckerPoset(2,4)).Relations
///
------------------------------------------------------------------------------
------------------------------------------------------------------------------
-- **TESTS** --
------------------------------------------------------------------------------
------------------------------------------------------------------------------
end---------------------------------------------------------------------------
------------------------------------------------------------------------------
------------------------------------------------------------------------------
-- **SCRATCH SPACE** --
------------------------------------------------------------------------------
------------------------------------------------------------------------------
I =
---------------------
--Ayah's sandbox
---------------------
I1 = hodgeDegenerationBasicPositroid(3,6,{5,6,1,2,3},2);
I2 = sub(hodgeDegenerationBasicPositroid(3,6,{1,2},1),ring I1);
I = I1+I2;
getMultidegree monomialIdeal I
codim I
J2 = sub(hodgeDegenerationBasicPositroid(3,6,{6,1,2},1),ring I1);
J = I1+J2;
codim J
------------------------------------
--Development Section
------------------------------------
restart
uninstallPackage "Positroid"
restart
installPackage "Positroid"
restart
needsPackage "Positroid"
elapsedTime check "Positroid"
viewHelp "Positroid"