forked from jmcdonough98/MatrixSchubert
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdemo.m2
More file actions
121 lines (89 loc) · 2.78 KB
/
Copy pathdemo.m2
File metadata and controls
121 lines (89 loc) · 2.78 KB
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
----------------------------------
----------------------------------
--**DEMO FILE**--
--Macaulay2 workshop Minneapolis
--9 June 2023
----------------------------------
----------------------------------
--Pooja starts
restart
uninstallPackage "MatrixSchubert"
restart
installPackage "MatrixSchubert"
restart
needsPackage "MatrixSchubert"
elapsedTime check "MatrixSchubert"
viewHelp "MatrixSchubert"
--------------------------------------------
--Matrix Schubert Varieties & ASM Varieties
--------------------------------------------
--Example from weekend worksheet
v = {2,1,6,3,5,4}
I = schubDetIdeal v;
netList I_*
netList augmentedRotheDiagram v
essentialBoxes v
betti res trim I
betti res antiDiagInit v
--speed of regularity function
time regularity comodule I
time matrixSchubertReg v
--Example from weekend worksheet
A = matrix{{0,0,1,0,0},{1,0,0,0,0},{0,1,-1,1,0},{0,0,0,0,1},{0,0,1,0,0}}
isPartialASM A
J = schubertDetIdeal A;
netList J_*
--Sean
--we can see which Schubert Determintanl Ideals are the prime components of an ASM variety
primePerms = schubertDecomposition J
primes = apply(primePerms, i -> schubertDetIdeal i)
netList transpose{(intersect(primes_0,sub(primes_1,(vars ring primes_0))))_*,(trim J)_*} --they agree!
--Joe
--we can more effectivey compute the regularity of a matrix Schubert variety using antiDiagInit
time regularity comodule (schubertDetIdeal A)
time matrixSchubertReg A
--Another example
w = {1,2,3,9,8,4,5,6,7}
--speed test: which way of computing the initial ideal is faster?
time I = schubertDetIdeal w;
time inI = antiDiagInit w;
time ideal leadTerm (schubertDetIdeal w);
--checking they agree
netList transpose {sort((inI)_*), sort((ideal leadTerm I)_*)}
--------------------------------
--operations for permutations
--------------------------------
--Sean
v
rajCode v
permLength v
schubertPoly v
doubleSchubertPoly v
w
isPatternAvoiding(w,{4,1,2,3})
isCDG w --is Conca-De Negri-Gorla
isVexillary w -- 2143 avoiding
isVexillary v -- not 2143 avoiding
isCartwrightSturmfels w
--Gorenstein example
--takes some time
--u = {3,7,1,4,8,2,6,5}
--betti res trim schubertDetIdeal u
--betti res antiDiagInit u
----------------
--Regularity demo--
--Adam
--Two computations are the same.
for n from 1 to 5 do (
apply(permutations(toList(1..n)),w->assert(matrixSchubertReg(w)==matrixSchubertRegADI(w)));
);
--Comparing reg with raj implementation and ADI implementation. --
setRandomSeed 50;
apply(1..10,i-> elapsedTime matrixSchubertRegADI(random toList (1..7)));
setRandomSeed 50;
apply(1..10,i-> elapsedTime matrixSchubertReg(random toList (1..7)));
--The speed on larger permutations. --
setRandomSeed 1001;
apply(1..10,i-> elapsedTime matrixSchubertReg(random toList (1..50)));
setRandomSeed 1001;
apply(1..5,i-> elapsedTime matrixSchubertReg(random toList (1..100)));