schubmult 1.3.6__tar.gz → 1.3.7__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. {schubmult-1.3.6 → schubmult-1.3.7}/PKG-INFO +5 -2
  2. {schubmult-1.3.6 → schubmult-1.3.7}/README.md +4 -1
  3. {schubmult-1.3.6 → schubmult-1.3.7}/schubmult/perm_lib.py +26 -0
  4. {schubmult-1.3.6 → schubmult-1.3.7}/schubmult/schubmult_q_yz/schubmult_q_yz.py +75 -17
  5. {schubmult-1.3.6 → schubmult-1.3.7}/schubmult.egg-info/PKG-INFO +5 -2
  6. {schubmult-1.3.6 → schubmult-1.3.7}/setup.py +1 -1
  7. {schubmult-1.3.6 → schubmult-1.3.7}/LICENSE +0 -0
  8. {schubmult-1.3.6 → schubmult-1.3.7}/schubmult/__init__.py +0 -0
  9. {schubmult-1.3.6 → schubmult-1.3.7}/schubmult/schubmult_double/__init__.py +0 -0
  10. {schubmult-1.3.6 → schubmult-1.3.7}/schubmult/schubmult_double/__main__.py +0 -0
  11. {schubmult-1.3.6 → schubmult-1.3.7}/schubmult/schubmult_double/schubmult_double.py +0 -0
  12. {schubmult-1.3.6 → schubmult-1.3.7}/schubmult/schubmult_py/__init__.py +0 -0
  13. {schubmult-1.3.6 → schubmult-1.3.7}/schubmult/schubmult_py/__main__.py +0 -0
  14. {schubmult-1.3.6 → schubmult-1.3.7}/schubmult/schubmult_py/schubmult_py.py +0 -0
  15. {schubmult-1.3.6 → schubmult-1.3.7}/schubmult/schubmult_q/__init__.py +0 -0
  16. {schubmult-1.3.6 → schubmult-1.3.7}/schubmult/schubmult_q/__main__.py +0 -0
  17. {schubmult-1.3.6 → schubmult-1.3.7}/schubmult/schubmult_q/schubmult_q.py +0 -0
  18. {schubmult-1.3.6 → schubmult-1.3.7}/schubmult/schubmult_q_double/__init__.py +0 -0
  19. {schubmult-1.3.6 → schubmult-1.3.7}/schubmult/schubmult_q_double/__main__.py +0 -0
  20. {schubmult-1.3.6 → schubmult-1.3.7}/schubmult/schubmult_q_double/schubmult_q_double.py +0 -0
  21. {schubmult-1.3.6 → schubmult-1.3.7}/schubmult/schubmult_q_yz/__init__.py +0 -0
  22. {schubmult-1.3.6 → schubmult-1.3.7}/schubmult/schubmult_q_yz/__main__.py +0 -0
  23. {schubmult-1.3.6 → schubmult-1.3.7}/schubmult/schubmult_yz/__init__.py +0 -0
  24. {schubmult-1.3.6 → schubmult-1.3.7}/schubmult/schubmult_yz/__main__.py +0 -0
  25. {schubmult-1.3.6 → schubmult-1.3.7}/schubmult/schubmult_yz/schubmult_yz.py +0 -0
  26. {schubmult-1.3.6 → schubmult-1.3.7}/schubmult.egg-info/SOURCES.txt +0 -0
  27. {schubmult-1.3.6 → schubmult-1.3.7}/schubmult.egg-info/dependency_links.txt +0 -0
  28. {schubmult-1.3.6 → schubmult-1.3.7}/schubmult.egg-info/entry_points.txt +0 -0
  29. {schubmult-1.3.6 → schubmult-1.3.7}/schubmult.egg-info/requires.txt +0 -0
  30. {schubmult-1.3.6 → schubmult-1.3.7}/schubmult.egg-info/top_level.txt +0 -0
  31. {schubmult-1.3.6 → schubmult-1.3.7}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: schubmult
3
- Version: 1.3.6
3
+ Version: 1.3.7
4
4
  Summary: Computing Littlewood-Richardson coefficients of Schubert polynomials
5
5
  Home-page: https://github.com/matthematics/schubmult
6
6
  Author: Matt Samuel
@@ -50,7 +50,10 @@ schubmult_double -code -coprod 0 1 2 3 - 2 4
50
50
  schubmult_yz -code -coprod 0 1 2 3 - 2 4 --display-positive
51
51
  ```
52
52
 
53
-
53
+ Since version 1.3.7, schubmult_q_yz has a feature for displaying the coefficients of the divided difference operators in the evaluation of the quantum double Schubert polynomials on the commuting difference operators of Fomin, Gelfand, and Postnikov. It is necessary to cap the value of n in the group S_n we are working in because as n increases the expression does not stabilize.
54
+ ```
55
+ schubmult_q_yz -nil-hecke 6 -code 2 2 --display-positive
56
+ ```
54
57
 
55
58
  Runtime will vary tremendously by case. The general problem is #P-hard. Though the result is always nonnegative (which at least is known for schubmult_py, schubmult_q, schubmult_double, and schubmult_q_double) and the problem is in GapP, it is not known to be in #P at this time.
56
59
 
@@ -37,7 +37,10 @@ schubmult_double -code -coprod 0 1 2 3 - 2 4
37
37
  schubmult_yz -code -coprod 0 1 2 3 - 2 4 --display-positive
38
38
  ```
39
39
 
40
-
40
+ Since version 1.3.7, schubmult_q_yz has a feature for displaying the coefficients of the divided difference operators in the evaluation of the quantum double Schubert polynomials on the commuting difference operators of Fomin, Gelfand, and Postnikov. It is necessary to cap the value of n in the group S_n we are working in because as n increases the expression does not stabilize.
41
+ ```
42
+ schubmult_q_yz -nil-hecke 6 -code 2 2 --display-positive
43
+ ```
41
44
 
42
45
  Runtime will vary tremendously by case. The general problem is #P-hard. Though the result is always nonnegative (which at least is known for schubmult_py, schubmult_q, schubmult_double, and schubmult_q_double) and the problem is in GapP, it is not known to be in #P at this time.
43
46
 
@@ -181,6 +181,32 @@ def elem_sym_perms_q(orig_perm,p,k):
181
181
  #print(f"{total_list=}")
182
182
  return total_list
183
183
 
184
+ def elem_sym_perms_q_op(orig_perm,p,k,n):
185
+ total_list = [(orig_perm,0,1)]
186
+ up_perm_list = [(orig_perm,1,k)]
187
+ for pp in range(p):
188
+ perm_list = []
189
+ for up_perm, val, last_j in up_perm_list:
190
+ up_perm2 = [*up_perm]
191
+ if len(up_perm) < n :
192
+ up_perm2 += [i+1 for i in range(len(up_perm2),n)]
193
+ pos_list = [i for i in range(k) if (i>=len(orig_perm) and up_perm2[i]==i+1) or (i<len(orig_perm) and up_perm2[i] == orig_perm[i])]
194
+ for j in range(last_j,n):
195
+ for i in pos_list:
196
+ ct = count_bruhat(up_perm2,i,j)
197
+ #print(f"{up_perm2=} {ct=} {i=} {j=} {k=} {pp=}")
198
+ if ct == -1 or ct == 2*(j-i)-1:
199
+ new_perm = [*up_perm2]
200
+ new_perm[i],new_perm[j] = new_perm[j],new_perm[i]
201
+ new_perm_add = tuple(permtrim(new_perm))
202
+ new_val = val
203
+ if ct>0:
204
+ new_val *= np.prod([q_var[index] for index in range(i+1,j+1)])
205
+ perm_list += [(new_perm_add,new_val,j)]
206
+ total_list+=[(new_perm_add,pp+1,new_val)]
207
+ up_perm_list = perm_list
208
+ return total_list
209
+
184
210
 
185
211
  # perms and inversion diff
186
212
  def kdown_perms(perm,monoperm,p,k):
@@ -3,15 +3,51 @@ from schubmult.schubmult_yz import compute_positive_rep, posify
3
3
  from symengine import *
4
4
  import sys
5
5
 
6
-
7
- #q_var = symarray("q",100)
8
-
9
6
  var2 = symarray("y",100)
10
7
  var3 = symarray("z",100)
11
8
 
12
-
9
+ var_x = symarray("x",100)
10
+
11
+ def nil_hecke(perm_dict,v,n,var2=var2,var3=var3):
12
+ th = strict_theta(inverse(v))
13
+ mu = permtrim(uncode(th))
14
+ vmu = permtrim(mulperm([*v],mu))
15
+ inv_vmu = inv(vmu)
16
+ inv_mu = inv(mu)
17
+ ret_dict = {}
18
+ vpaths = [([(vmu,0)],1)]
19
+ while th[-1] == 0:
20
+ th.pop()
21
+ thL = len(th)
22
+ vpathdicts = compute_vpathdicts(th,vmu,True)
23
+ for u,val in perm_dict.items():
24
+ inv_u = inv(u)
25
+ vpathsums = {u: {(1,2): val}}
26
+ for index in range(thL):
27
+ mx_th = 0
28
+ for vp in vpathdicts[index]:
29
+ for v2,vdiff,s in vpathdicts[index][vp]:
30
+ if th[index]-vdiff > mx_th:
31
+ mx_th = th[index] - vdiff
32
+ newpathsums = {}
33
+ for up in vpathsums:
34
+ inv_up = inv(up)
35
+ newperms = elem_sym_perms_q_op(up,mx_th,th[index],n)
36
+ for up2, udiff,mul_val in newperms:
37
+ if up2 not in newpathsums:
38
+ newpathsums[up2]={}
39
+ for v in vpathdicts[index]:
40
+ sumval = vpathsums[up].get(v,zero)*mul_val
41
+ if sumval == 0:
42
+ continue
43
+ for v2,vdiff,s in vpathdicts[index][v]:
44
+ #print(f"{code(up2)=} {elem_sym_func_q(th[index],index+1,up,up2,v,v2,udiff,vdiff,var2,var3)=} {mul_val=} {sumval=}")
45
+ newpathsums[up2][v2] = newpathsums[up2].get(v2,zero)+s*sumval*elem_sym_func_q(th[index],index+1,up2,up,v,v2,udiff,vdiff,var2,var3)
46
+ vpathsums = newpathsums
47
+ toget = tuple(vmu)
48
+ ret_dict = add_perm_dict({ep: vpathsums[ep].get(toget,0) for ep in vpathsums},ret_dict)
49
+ return ret_dict
13
50
 
14
-
15
51
 
16
52
 
17
53
  def schubmult(perm_dict,v,var2=var2,var3=var3):
@@ -150,6 +186,14 @@ def factor_out_q(poly):
150
186
  var2_t = tuple(var2.tolist())
151
187
  var3_t = tuple(var3.tolist())
152
188
 
189
+ def print_usage():
190
+ print("**** schubmult_q_yz ****")
191
+ print("Purpose: Compute Molev-Sagan coefficients of quantum double Schubert polynomials")
192
+ print("Usage: schubmult_q_yz <-np|--no-print> <-code> <--display-positive> <--optimizer-message> perm1 - perm2 < - perm3 .. >")
193
+ print(" *** Computes products")
194
+ print("Alternative usage: schubmult_q_yz -nil-hecke n <-code> <--display-positive> perm")
195
+ print(" *** Computes nil-Hecke representation of quantum double Schubert polynomial, limiting to the group S_n")
196
+
153
197
  def main():
154
198
  global var2
155
199
  try:
@@ -162,10 +206,19 @@ def main():
162
206
  display_positive = False
163
207
  ascode = False
164
208
  coprod = False
209
+ nilhecke = False
165
210
  check = True
166
211
  msg = False
212
+ just_nil = False
213
+
214
+ nil_N = 0
215
+
167
216
  try:
168
217
  for s in sys.argv[1:]:
218
+ if just_nil:
219
+ just_nil = False
220
+ nil_N = int(s)
221
+ continue
169
222
  if s == "-np" or s == "--no-print":
170
223
  pr = False
171
224
  continue
@@ -178,16 +231,18 @@ def main():
178
231
  if s == "--optimizer-message":
179
232
  msg = True
180
233
  continue
234
+ if s == "-nil-hecke":
235
+ nilhecke = True
236
+ just_nil = True
237
+ continue
181
238
  if s == "--version":
182
239
  print(f"Python version {sys.version}")
183
240
  exit(0)
184
241
  if s == "-code":
185
242
  ascode = True
186
243
  continue
187
- if s == "--usage":
188
- print("**** schubmult_q_yz ****")
189
- print("Purpose: Compute Molev-Sagan coefficients of quantum double Schubert polynomials")
190
- print("Usage: schubmult_q_yz <-np|--no-print> <-code> <--display-positive> <--optimizer-message> perm1 - perm2 < - perm3 .. >")
244
+ if s == "--usage" or s == "--help":
245
+ print_usage()
191
246
  exit(0)
192
247
  if s == "-":
193
248
  perms += [curperm]
@@ -195,9 +250,7 @@ def main():
195
250
  continue
196
251
  curperm += [int(s)]
197
252
  except Exception:
198
- print("**** schubmult_q_yz ****")
199
- print("Purpose: Compute Molev-Sagan coefficients of quantum double Schubert polynomials")
200
- print("Usage: schubmult_q_yz <-np|--no-print> <-code> <--display-positive> <--optimizer-message> perm1 - perm2 < - perm3 .. >")
253
+ print_usage()
201
254
  exit(1)
202
255
 
203
256
  perms += [curperm]
@@ -213,9 +266,14 @@ def main():
213
266
  size = 0
214
267
  L = len(perms)
215
268
 
216
- coeff_dict = {perms[0]: 1}
217
- for perm in perms[1:]:
218
- coeff_dict = schubmult(coeff_dict,perm)
269
+ if nilhecke:
270
+ coeff_dict = nil_hecke({(1,2): 1},perms[0],nil_N)
271
+ rep = ("y","x")
272
+ else:
273
+ coeff_dict = {perms[0]: 1}
274
+ for perm in perms[1:]:
275
+ coeff_dict = schubmult(coeff_dict,perm)
276
+ rep = ("","")
219
277
 
220
278
  if pr:
221
279
  if ascode:
@@ -269,9 +327,9 @@ def main():
269
327
  val = val2
270
328
  if val!=0:
271
329
  if ascode:
272
- print(f"{str(trimcode(perm)):>{width}} {str(val).replace('**','^').replace('*',' ')}")
330
+ print(f"{str(trimcode(perm)):>{width}} {str(val).replace('**','^').replace('*',' ').replace(*rep)}")
273
331
  else:
274
- print(f"{str(perm):>{width}} {str(val).replace('**','^').replace('*',' ')}")
332
+ print(f"{str(perm):>{width}} {str(val).replace('**','^').replace('*',' ').replace(*rep)}")
275
333
  except BrokenPipeError:
276
334
  pass
277
335
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: schubmult
3
- Version: 1.3.6
3
+ Version: 1.3.7
4
4
  Summary: Computing Littlewood-Richardson coefficients of Schubert polynomials
5
5
  Home-page: https://github.com/matthematics/schubmult
6
6
  Author: Matt Samuel
@@ -50,7 +50,10 @@ schubmult_double -code -coprod 0 1 2 3 - 2 4
50
50
  schubmult_yz -code -coprod 0 1 2 3 - 2 4 --display-positive
51
51
  ```
52
52
 
53
-
53
+ Since version 1.3.7, schubmult_q_yz has a feature for displaying the coefficients of the divided difference operators in the evaluation of the quantum double Schubert polynomials on the commuting difference operators of Fomin, Gelfand, and Postnikov. It is necessary to cap the value of n in the group S_n we are working in because as n increases the expression does not stabilize.
54
+ ```
55
+ schubmult_q_yz -nil-hecke 6 -code 2 2 --display-positive
56
+ ```
54
57
 
55
58
  Runtime will vary tremendously by case. The general problem is #P-hard. Though the result is always nonnegative (which at least is known for schubmult_py, schubmult_q, schubmult_double, and schubmult_q_double) and the problem is in GapP, it is not known to be in #P at this time.
56
59
 
@@ -6,7 +6,7 @@ long_description = (this_directory / "README.md").read_text()
6
6
 
7
7
  setup(
8
8
  name="schubmult",
9
- version="1.3.6",
9
+ version="1.3.7",
10
10
  description="Computing Littlewood-Richardson coefficients of Schubert polynomials",
11
11
  long_description=long_description,
12
12
  long_description_content_type='text/markdown',
File without changes
File without changes