schubmult 2.0.3__py3-none-any.whl → 3.0.0__py3-none-any.whl

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 (59) hide show
  1. schubmult/__init__.py +94 -1
  2. schubmult/perm_lib.py +233 -880
  3. schubmult/poly_lib/__init__.py +31 -0
  4. schubmult/poly_lib/poly_lib.py +244 -0
  5. schubmult/poly_lib/schub_poly.py +148 -0
  6. schubmult/poly_lib/variables.py +204 -0
  7. schubmult/rings/__init__.py +17 -0
  8. schubmult/rings/_quantum_schubert_polynomial_ring.py +788 -0
  9. schubmult/rings/_schubert_polynomial_ring.py +1006 -0
  10. schubmult/rings/_tensor_schub_ring.py +128 -0
  11. schubmult/rings/_utils.py +55 -0
  12. schubmult/{sage_integration → sage}/__init__.py +17 -15
  13. schubmult/{sage_integration → sage}/_fast_double_schubert_polynomial_ring.py +142 -220
  14. schubmult/{sage_integration → sage}/_fast_schubert_polynomial_ring.py +78 -72
  15. schubmult/sage/_indexing.py +51 -0
  16. schubmult/schub_lib/__init__.py +51 -0
  17. schubmult/{schubmult_double/_funcs.py → schub_lib/double.py} +618 -798
  18. schubmult/{schubmult_q/_funcs.py → schub_lib/quantum.py} +70 -72
  19. schubmult/schub_lib/quantum_double.py +954 -0
  20. schubmult/schub_lib/schub_lib.py +659 -0
  21. schubmult/{schubmult_py/_funcs.py → schub_lib/single.py} +58 -48
  22. schubmult/schub_lib/tests/__init__.py +0 -0
  23. schubmult/schub_lib/tests/legacy_perm_lib.py +946 -0
  24. schubmult/schub_lib/tests/test_vs_old.py +109 -0
  25. schubmult/scripts/__init__.py +0 -0
  26. schubmult/scripts/schubmult_double.py +378 -0
  27. schubmult/scripts/schubmult_py.py +84 -0
  28. schubmult/scripts/schubmult_q.py +109 -0
  29. schubmult/scripts/schubmult_q_double.py +207 -0
  30. schubmult/utils/__init__.py +0 -0
  31. schubmult/{_base_argparse.py → utils/argparse.py} +40 -11
  32. schubmult/utils/logging.py +16 -0
  33. schubmult/utils/parsing.py +20 -0
  34. schubmult/utils/perm_utils.py +135 -0
  35. schubmult/utils/test_utils.py +65 -0
  36. schubmult-3.0.0.dist-info/METADATA +1234 -0
  37. schubmult-3.0.0.dist-info/RECORD +41 -0
  38. {schubmult-2.0.3.dist-info → schubmult-3.0.0.dist-info}/WHEEL +1 -1
  39. schubmult-3.0.0.dist-info/entry_points.txt +5 -0
  40. schubmult/_tests.py +0 -9
  41. schubmult/sage_integration/_indexing.py +0 -51
  42. schubmult/schubmult_double/__init__.py +0 -22
  43. schubmult/schubmult_double/__main__.py +0 -5
  44. schubmult/schubmult_double/_script.py +0 -474
  45. schubmult/schubmult_py/__init__.py +0 -13
  46. schubmult/schubmult_py/__main__.py +0 -5
  47. schubmult/schubmult_py/_script.py +0 -96
  48. schubmult/schubmult_q/__init__.py +0 -13
  49. schubmult/schubmult_q/__main__.py +0 -5
  50. schubmult/schubmult_q/_script.py +0 -160
  51. schubmult/schubmult_q_double/__init__.py +0 -17
  52. schubmult/schubmult_q_double/__main__.py +0 -5
  53. schubmult/schubmult_q_double/_funcs.py +0 -540
  54. schubmult/schubmult_q_double/_script.py +0 -398
  55. schubmult-2.0.3.dist-info/METADATA +0 -455
  56. schubmult-2.0.3.dist-info/RECORD +0 -30
  57. schubmult-2.0.3.dist-info/entry_points.txt +0 -5
  58. {schubmult-2.0.3.dist-info → schubmult-3.0.0.dist-info}/licenses/LICENSE +0 -0
  59. {schubmult-2.0.3.dist-info → schubmult-3.0.0.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,41 @@
1
+ schubmult/__init__.py,sha256=XOa382I_9HvYUwbuz8dEAoDptLnzbLzZcL5A2TiCIos,2363
2
+ schubmult/perm_lib.py,sha256=h_phdUoIMZn66C4CIWSqalHWC0t7ofgPswDrKzd2Sho,9509
3
+ schubmult/poly_lib/__init__.py,sha256=DUA70oCWv64lqhezrpKgA6813Dp5LTM1bkMrpOoqjTU,674
4
+ schubmult/poly_lib/poly_lib.py,sha256=ymFvBNu7rxDMvaAo2_ts4ikixzykAilUbbyJZbTuYB8,6946
5
+ schubmult/poly_lib/schub_poly.py,sha256=_GXApXSbmlF0neSZOY9fCFXxSmYJEoHv_PvJJzIhy5E,4586
6
+ schubmult/poly_lib/variables.py,sha256=cnR9Kvzbh7LA0Mvi292h2eMW7d3s2GU9DKvP3M44HNE,6005
7
+ schubmult/rings/__init__.py,sha256=vRaxEBgeT7OtvOOzOTvZffHBRdopVkouTVyklAOg8l0,612
8
+ schubmult/rings/_quantum_schubert_polynomial_ring.py,sha256=Gy11WD4v9V5lcYhYsoU4lf-wPS-UZ3kyfyxjKLt7X4I,28031
9
+ schubmult/rings/_schubert_polynomial_ring.py,sha256=D0Uo8J2BJGZrDWaXHbrC02FAbuYtssVofNkWoMMCYdU,37969
10
+ schubmult/rings/_tensor_schub_ring.py,sha256=-ahCinjsAyK6EvfPD8T4nB4KJ8syISEbtYL-n34q16I,3952
11
+ schubmult/rings/_utils.py,sha256=hCB9sMJfgINLvqbJbpGd5bnGQL3sb6G1nr1Dr5O-qwM,1787
12
+ schubmult/sage/__init__.py,sha256=bgRIEllThsrH0kYJnEAR_cirTGGfdPojOUajbZjJhq4,906
13
+ schubmult/sage/_fast_double_schubert_polynomial_ring.py,sha256=pAan4EWSss0rQA2Pk_QuqGTuy4SoxAGFzaVZGQJAzS0,19936
14
+ schubmult/sage/_fast_schubert_polynomial_ring.py,sha256=dXLX-9rfpk_ueIRqDcGRc83oWx45gaf1SNAbp4ALliY,14371
15
+ schubmult/sage/_indexing.py,sha256=L6ShyDI7ceMSga8jel5mzAWBxfmsXC9uJZYpZ_WrnOI,1932
16
+ schubmult/schub_lib/__init__.py,sha256=kFtT2ghMrgFACzJSraeJYGcvGlb3uXt_GJIl36tmOw8,1118
17
+ schubmult/schub_lib/double.py,sha256=x7l84DJ4e0VW90z7GbdRNpF7FUcKGPXhXWOxBLXBLh0,51663
18
+ schubmult/schub_lib/quantum.py,sha256=RcjpAtyxVndo-kR-H31gjtmjaLNq2PWSglvw6LnKOR0,9998
19
+ schubmult/schub_lib/quantum_double.py,sha256=Up9wSqZ6A5u5Ze3sznp3vEA8uktepVSpSdVjw5X_RZE,36770
20
+ schubmult/schub_lib/schub_lib.py,sha256=Sca_PAOD0ABEyixpgYpFxPxfCPZnKchFGeKUZIstIyc,22815
21
+ schubmult/schub_lib/single.py,sha256=3ZJzC9dSFc6Ux_DcuSKekwK7D9ZyrCd5OUEiIKW8LZk,5210
22
+ schubmult/schub_lib/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
23
+ schubmult/schub_lib/tests/legacy_perm_lib.py,sha256=fMGkKPv6VtZcTBFC5JZsZQRy1-m9a2uvOGmCiF-eovM,29619
24
+ schubmult/schub_lib/tests/test_vs_old.py,sha256=6X1GDj3dCRg3Hx6rFOUk4trIv7I2Hctq6FlUwGH3gHk,4362
25
+ schubmult/scripts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
26
+ schubmult/scripts/schubmult_double.py,sha256=DGGH_DQDcovAi5TcJ2_bnA0Slj9-pB3tSVh3pr6SIZM,13010
27
+ schubmult/scripts/schubmult_py.py,sha256=ARQn4Ucl5n8dz_q77gjkrazVSDjUMQHkx5EK7Sx5_Wc,2738
28
+ schubmult/scripts/schubmult_q.py,sha256=ntzcVmFjRbXGKTddkhdNVpxcMTTtK4CeOI4BeIVjePQ,3287
29
+ schubmult/scripts/schubmult_q_double.py,sha256=SANQEvlA5XJUWUh8sd_ObwMOEmct0GLSMbjDAvUTOB4,6086
30
+ schubmult/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
31
+ schubmult/utils/argparse.py,sha256=35jg_AtQuue9HuJB7RN_D7YwMOzrcJkrriNAHKiNJh8,7175
32
+ schubmult/utils/logging.py,sha256=h-CgHSl7kPscs9VKp0WjJ4fcrtPplnJYDyrL2klPJJ4,503
33
+ schubmult/utils/parsing.py,sha256=ygkkLqZ1KsNQBPeiF6gkEJYMwjmkqkwfGuIP0Wtawnk,599
34
+ schubmult/utils/perm_utils.py,sha256=mf5VOwLREn_UQWMa67lOsmmwHMJClt_rjsVPIE2yE9w,2716
35
+ schubmult/utils/test_utils.py,sha256=vEIuAkb-mFEs1gow9E76JrRbcEDvxvsTDzp4pPUoT5w,1860
36
+ schubmult-3.0.0.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
37
+ schubmult-3.0.0.dist-info/METADATA,sha256=f9ofBquNwvAKOQ8zCIN1-y-Hj8EErdBgKAGBnoF7Gfg,77074
38
+ schubmult-3.0.0.dist-info/WHEEL,sha256=lTU6B6eIfYoiQJTZNc-fyaR6BpL6ehTzU3xGYxn2n8k,91
39
+ schubmult-3.0.0.dist-info/entry_points.txt,sha256=9iaFSlTd5xZf52635CKaBqmgJTY_NZLkF6AMnL_T84c,240
40
+ schubmult-3.0.0.dist-info/top_level.txt,sha256=IkujyjRu8lbpoSTdPE8DmMJ9sbyXHpo9L0RHL7nOzM0,10
41
+ schubmult-3.0.0.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (78.0.1)
2
+ Generator: setuptools (78.1.1)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -0,0 +1,5 @@
1
+ [console_scripts]
2
+ schubmult_double = schubmult.scripts.schubmult_double:main
3
+ schubmult_py = schubmult.scripts.schubmult_py:main
4
+ schubmult_q = schubmult.scripts.schubmult_q:main
5
+ schubmult_q_double = schubmult.scripts.schubmult_q_double:main
schubmult/_tests.py DELETED
@@ -1,9 +0,0 @@
1
- def get_json(file: str):
2
- import os
3
- import json
4
-
5
- script_dir = os.path.dirname(__file__)
6
- rel_path = f"../tests/{file}.json"
7
- abs_file_path = os.path.join(script_dir, rel_path)
8
- with open(abs_file_path, "r") as f:
9
- return json.load(f)
@@ -1,51 +0,0 @@
1
- from sage.combinat.permutation import Permutation
2
-
3
- from sage.combinat.composition import Composition
4
-
5
- from schubmult.perm_lib import uncode, trimcode, permtrim
6
-
7
-
8
- def _coerce_index(indexed_obj, is_comp, should_be_comp):
9
- if is_comp == should_be_comp:
10
- if isinstance(indexed_obj, list) or isinstance(indexed_obj, tuple):
11
- if is_comp:
12
- return Composition(trimcode(permtrim(uncode(list(indexed_obj)))))
13
- else:
14
- return Permutation(permtrim(list(indexed_obj))).remove_extra_fixed_points()
15
- else:
16
- if not is_comp:
17
- if isinstance(indexed_obj, Permutation):
18
- return indexed_obj.remove_extra_fixed_points()
19
- elif isinstance(indexed_obj, dict):
20
- {
21
- Permutation(permtrim(list(k))).remove_extra_fixed_points(): v
22
- for k, v in indexed_obj.items()
23
- }
24
- else:
25
- if is_comp:
26
- if (
27
- isinstance(indexed_obj, list)
28
- or isinstance(indexed_obj, tuple)
29
- or isinstance(indexed_obj, Composition)
30
- ):
31
- return Permutation(permtrim(uncode(list(indexed_obj)))).remove_extra_fixed_points()
32
-
33
- if isinstance(indexed_obj, dict): # keys are comps
34
- return {
35
- Permutation(permtrim(uncode(list(k)))).remove_extra_fixed_points(): v
36
- for k, v in indexed_obj.items()
37
- }
38
- else:
39
- if (
40
- isinstance(indexed_obj, list)
41
- or isinstance(indexed_obj, tuple)
42
- or isinstance(indexed_obj, Permutation)
43
- ):
44
- return Composition(trimcode(list(indexed_obj)))
45
-
46
- if isinstance(indexed_obj, dict): # keys are comps
47
- return {
48
- Composition(trimcode(permtrim(list(k)))): v
49
- for k, v in indexed_obj.items()
50
- }
51
- raise TypeError
@@ -1,22 +0,0 @@
1
- from ._funcs import (
2
- compute_positive_rep,
3
- schubmult,
4
- single_variable,
5
- mult_poly,
6
- posify,
7
- div_diff,
8
- schub_coprod
9
- )
10
-
11
-
12
-
13
- __all__ = [
14
- "compute_positive_rep",
15
- "schubmult",
16
- "single_variable",
17
- "mult_poly",
18
- "posify",
19
- "div_diff",
20
- "schub_coprod",
21
- "main"
22
- ]
@@ -1,5 +0,0 @@
1
- import sys
2
- from ._script import main
3
-
4
- if __name__ == "__main__":
5
- sys.exit(main(sys.argv))
@@ -1,474 +0,0 @@
1
- import numpy as np
2
- import sympy
3
- import sys
4
-
5
- # from schubmult.schubmult_double._vars import var_x, var, var_r
6
- from schubmult.schubmult_double._funcs import (
7
- mult_poly,
8
- mult_poly_down,
9
- schubmult,
10
- schubmult_down,
11
- compute_positive_rep,
12
- posify,
13
- split_perms,
14
- )
15
- from symengine import expand, sympify, symarray
16
- from schubmult._base_argparse import schub_argparse
17
- from schubmult.perm_lib import (
18
- add_perm_dict,
19
- inverse,
20
- theta,
21
- permtrim,
22
- inv,
23
- mulperm,
24
- code,
25
- uncode,
26
- will_formula_work,
27
- mu_A,
28
- trimcode,
29
- )
30
-
31
- from functools import cached_property
32
-
33
-
34
- class _gvars:
35
- @cached_property
36
- def n(self):
37
- return 100
38
-
39
- # @cached_property
40
- # def fvar(self):
41
- # return 100
42
-
43
- @cached_property
44
- def var1(self):
45
- return tuple(symarray("x", self.n).tolist())
46
-
47
- @cached_property
48
- def var2(self):
49
- return tuple(symarray("y", self.n).tolist())
50
-
51
- @cached_property
52
- def var3(self):
53
- return tuple(symarray("z", self.n).tolist())
54
-
55
- @cached_property
56
- def var_r(self):
57
- return symarray("r", 100)
58
-
59
-
60
- _vars = _gvars()
61
-
62
-
63
- def _display(val):
64
- print(val)
65
-
66
-
67
- def _display_full(
68
- coeff_dict,
69
- args,
70
- formatter,
71
- var2,
72
- var3,
73
- posified=None,
74
- check_coeff_dict=None,
75
- kperm=None,
76
- N=None,
77
- ):
78
- subs_dict2 = {}
79
- for i in range(1, 100):
80
- sm = var2[1]
81
- for j in range(1, i):
82
- sm += _vars.var_r[j]
83
- subs_dict2[var2[i]] = sm
84
- raw_result_dict = {}
85
- perms = args.perms
86
- mult = args.mult
87
- ascode = args.ascode
88
- coprod = args.coprod
89
- check = args.check
90
- msg = args.msg
91
- down = args.down
92
- same = args.same
93
- display_positive = args.display_positive
94
-
95
- coeff_perms = list(coeff_dict.keys())
96
- if coprod:
97
- pos = perms[1]
98
- pos2 = []
99
- last_descent = -1
100
- poso = []
101
- for i in range(len(perms[0]) - 1):
102
- if perms[0][i] > perms[0][i + 1]:
103
- last_descent = i + 1
104
- for i in range(1, last_descent + 1):
105
- if i not in pos:
106
- pos2 += [i - 1]
107
- else:
108
- poso += [i - 1]
109
-
110
- mu_W = uncode(theta(inverse(perms[0])))
111
-
112
- the_top_perm = tuple(permtrim(mulperm(list(perms[0]), mu_W)))
113
-
114
- muA = uncode(mu_A(code(mu_W), poso))
115
- muB = uncode(mu_A(code(mu_W), pos2))
116
- subs_dict = {}
117
- inv_kperm = inv(kperm)
118
- inverse_kperm = inverse(kperm)
119
- var2neg = np.array([-var2[i] for i in range(len(var2))])
120
- var3neg = np.array([-var3[i] for i in range(len(var3))])
121
-
122
- for i in range(1, 100):
123
- if i <= N:
124
- subs_dict[_vars.var1[i]] = var2[i]
125
- else:
126
- subs_dict[_vars.var1[i]] = var3[i - N]
127
-
128
- coeff_perms.sort(key=lambda x: (inv(x), *x))
129
-
130
- perm_pairs = []
131
-
132
- for perm in coeff_perms:
133
- downperm = mulperm(list(perm), inverse_kperm)
134
- if inv(downperm) == inv(perm) - inv_kperm:
135
- flag = True
136
- for i in range(N):
137
- if downperm[i] > N:
138
- flag = False
139
- break
140
- if not flag:
141
- continue
142
- firstperm = downperm[0:N]
143
- secondperm = [downperm[i] - N for i in range(N, len(downperm))]
144
- perm_pairs += [[permtrim(firstperm), permtrim(secondperm)]]
145
-
146
- if ascode:
147
- width = max(
148
- [len(str(trimcode(perm[0])) + " " + str(trimcode(perm[1]))) for perm in perm_pairs]
149
- )
150
- else:
151
- width = max([len(str(perm[0]) + " " + str(perm[1])) for perm in perm_pairs])
152
-
153
- subs_dict2 = {}
154
- for perm in coeff_perms:
155
- val = coeff_dict[perm]
156
- downperm = mulperm(list(perm), inverse_kperm)
157
- if inv(downperm) == inv(perm) - inv_kperm:
158
- flag = True
159
- for i in range(N):
160
- if downperm[i] > N:
161
- flag = False
162
- break
163
- if not flag:
164
- continue
165
- firstperm = downperm[0:N]
166
- secondperm = [downperm[i] - N for i in range(N, len(downperm))]
167
- val = sympify(val).subs(subs_dict)
168
-
169
- if same and display_positive:
170
- val = expand(sympify(val).xreplace(subs_dict2))
171
-
172
- if val != 0:
173
- if display_positive and not same:
174
- if val != 0:
175
- val2 = posify(
176
- val,
177
- tuple(permtrim(mulperm(firstperm, muA))),
178
- tuple(permtrim(mulperm(secondperm, muB))),
179
- the_top_perm,
180
- tuple(var2neg.tolist()),
181
- tuple(var3neg.tolist()),
182
- msg,
183
- False,
184
- )
185
- if expand(val - val2) != 0:
186
- _display(
187
- f"error; write to schubmult@gmail.com with the case {perms=}\n{code(firstperm)=} {code(secondperm)=}\n{val2=}\n{val=}"
188
- )
189
- _display(
190
- f"{code(tuple(permtrim(mulperm(firstperm,muA))))=},{code(tuple(permtrim(mulperm(secondperm,muB))))=},{code(the_top_perm)=}\n{expand(val-val2)=}"
191
- )
192
- exit(1)
193
- val = val2
194
- else:
195
- val = 0
196
- if val != 0:
197
- if not ascode:
198
- width2 = (
199
- width
200
- - len(str(permtrim(firstperm)))
201
- - len(str(permtrim(secondperm)))
202
- )
203
- raw_result_dict[
204
- (tuple(permtrim(firstperm)), tuple(permtrim(secondperm)))
205
- ] = val
206
- if formatter:
207
- _display(
208
- f"{tuple(permtrim(firstperm))}{' ':>{width2}}{tuple(permtrim(secondperm))} {formatter(val)}"
209
- )
210
- else:
211
- width2 = (
212
- width
213
- - len(str(trimcode(firstperm)))
214
- - len(str(trimcode(secondperm)))
215
- )
216
- raw_result_dict[
217
- (tuple(trimcode(firstperm)), tuple(trimcode(secondperm)))
218
- ] = val
219
- if formatter:
220
- _display(
221
- f"{trimcode(firstperm)}{' ':>{width2}}{trimcode(secondperm)} {formatter(val)}"
222
- )
223
- else:
224
- if ascode:
225
- width = max([len(str(trimcode(perm))) for perm in coeff_dict.keys()])
226
- else:
227
- width = max([len(str(perm)) for perm in coeff_dict.keys()])
228
-
229
- coeff_perms = list(coeff_dict.keys())
230
- coeff_perms.sort(key=lambda x: (inv(x), *x))
231
-
232
- for perm in coeff_perms:
233
- val = coeff_dict[perm]
234
- if val != 0:
235
- notint = False
236
- try:
237
- int(val)
238
- except Exception:
239
- notint = True
240
- if notint and display_positive:
241
- if same:
242
- subs_dict = {}
243
- for i in range(1, 100):
244
- sm = var2[1]
245
- for j in range(1, i):
246
- sm += _vars.var_r[j]
247
- subs_dict[var2[i]] = sm
248
- val = expand(sympify(coeff_dict[perm]).xreplace(subs_dict))
249
- else:
250
- try:
251
- if len(perms) == 2 and not posified and not mult:
252
- if not down:
253
- val = posify(
254
- val,
255
- perms[0],
256
- perms[1],
257
- perm,
258
- var2,
259
- var3,
260
- msg,
261
- )
262
- else:
263
- val = posify(
264
- val,
265
- perm,
266
- perms[1],
267
- perms[0],
268
- var2,
269
- var3,
270
- msg,
271
- )
272
- elif not posified and not mult:
273
- val = compute_positive_rep(val, var2, var3, msg)
274
- elif not posified:
275
- val = compute_positive_rep(val, var2, var3, msg, do_pos_neg=False)
276
- except Exception:
277
- if mult:
278
- _display(
279
- "warning; --display-positive is on but result is not positive",
280
- file=sys.stderr,
281
- )
282
- else:
283
- _display(
284
- f"error; write to schubmult@gmail.com with the case {perms=} {perm=} {val=} {check_coeff_dict.get(perm,0)=}"
285
- )
286
- exit(1)
287
- if check and expand(val - check_coeff_dict.get(perm, 0)) != 0:
288
- _display(
289
- f"error; write to schubmult@gmail.com with the case {perms=} {perm=} {val=} {check_coeff_dict.get(perm,0)=}"
290
- )
291
- exit(1)
292
- if val != 0:
293
- if ascode:
294
- raw_result_dict[tuple(trimcode(perm))] = val
295
- if formatter:
296
- _display(f"{str(trimcode(perm)):>{width}} {formatter(val)}")
297
- else:
298
- raw_result_dict[tuple(perm)] = val
299
- if formatter:
300
- _display(f"{str(perm):>{width}} {formatter(val)}")
301
- return raw_result_dict
302
-
303
-
304
- def main(argv=None):
305
- import logging
306
-
307
- logging.basicConfig(
308
- level=logging.ERROR, format="%(asctime)s %(levelname)s %(message) %(module) s"
309
- )
310
- logger = logging.getLogger(__name__)
311
- logger.log(logging.DEBUG, f"main {argv=}")
312
- if argv is None:
313
- argv = sys.argv
314
- try:
315
- var2 = tuple(symarray("y", 100).tolist())
316
- var3 = tuple(symarray("z", 100).tolist())
317
- sys.setrecursionlimit(1000000)
318
-
319
- # TEMP
320
- sympy.init_printing()
321
-
322
- args, formatter = schub_argparse(
323
- "schubmult_double",
324
- "Compute coefficients of product of double Schubert polynomials in the same or different sets of coefficient variables",
325
- argv=argv[1:],
326
- yz=True,
327
- )
328
-
329
- mult = args.mult
330
- mulstring = args.mulstring
331
-
332
- perms = args.perms
333
-
334
- ascode = args.ascode
335
- coprod = args.coprod
336
- same = args.same
337
- msg = args.msg
338
- down = args.down
339
- display_positive = args.display_positive
340
- pr = args.pr
341
-
342
- # logger.log(logging.DEBUG, f"main boing 1 {var2=}{var3=}{same=}")
343
- if same:
344
- # logger.log(logging.DEBUG, f"main OOO {same=}")
345
- var3 = var2
346
- # logger.log(logging.DEBUG, f"main boing 2 {var2=}{var3=}{same=}")
347
- posified = False
348
- if coprod:
349
- if ascode:
350
- mperm = tuple(permtrim(uncode(perms[0])))
351
- else:
352
- mperm = tuple(permtrim(perms[0]))
353
-
354
- perms[0] = mperm
355
- pos = perms[1]
356
-
357
- k = len(pos)
358
- n = len(perms[0])
359
- kcd = [pos[i] - i - 1 for i in range(len(pos))] + [n + 1 - k for i in range(k, n)]
360
- N = len(kcd)
361
-
362
- kperm = inverse(uncode(kcd))
363
- coeff_dict = {tuple(kperm): 1}
364
- coeff_dict = schubmult(coeff_dict, perms[0], _vars.var1, var2)
365
-
366
- if pr or formatter is None:
367
- # logger.log(logging.DEBUG, f"main {var2=}{var3=}{same=}")
368
- return _display_full(
369
- coeff_dict,
370
- args,
371
- formatter,
372
- posified=posified,
373
- kperm=kperm,
374
- var2=var2,
375
- var3=var3,
376
- N=N,
377
- )
378
- else:
379
- if ascode:
380
- for i in range(len(perms)):
381
- perms[i] = tuple(permtrim(uncode(perms[i])))
382
- else:
383
- for i in range(len(perms)):
384
- if len(perms[i]) < 2 and (len(perms[i]) == 0 or perms[i][0] == 1):
385
- perms[i] = (1, 2)
386
- perms[i] = tuple(permtrim([*perms[i]]))
387
-
388
- size = 0
389
- orig_perms = [*perms]
390
- while len(perms) != size:
391
- size = len(perms)
392
- perms = split_perms(perms)
393
-
394
- coeff_dict = {perms[0]: 1}
395
- check_coeff_dict = {perms[0]: 1}
396
-
397
- # if mult:
398
- # for v in var2:
399
- # ()[str(v)] = v
400
- # for v in var3:
401
- # globals()[str(v)] = v
402
- # for v in _vars.var1:
403
- # globals()[str(v)] = v
404
-
405
- if down:
406
- for perm in orig_perms[1:]:
407
- check_coeff_dict = schubmult_down(check_coeff_dict, perm, var2, var3)
408
- if mult:
409
- mul_exp = eval(mulstring)
410
- check_coeff_dict = mult_poly_down(check_coeff_dict, mul_exp)
411
- else:
412
- for perm in orig_perms[1:]:
413
- check_coeff_dict = schubmult(check_coeff_dict, perm, var2, var3)
414
- # coeff_dict = check_coeff_dict
415
- if mult:
416
- mul_exp = eval(mulstring)
417
- check_coeff_dict = mult_poly(check_coeff_dict, mul_exp)
418
-
419
- if (
420
- display_positive
421
- and len(perms) == 2
422
- and will_formula_work(perms[0], perms[1])
423
- and not mult
424
- and not down
425
- and not same
426
- ):
427
- coeff_dict = {}
428
- th = theta(perms[1])
429
- muv = uncode(th)
430
- muvn1v = mulperm(inverse(muv), perms[1])
431
- coeff_dict2 = {perms[0]: 1}
432
- coeff_dict2 = schubmult(coeff_dict2, muv, var2, var3)
433
- for perm, val in coeff_dict2.items():
434
- w = mulperm([*perm], muvn1v)
435
- if inv(w) + inv(muvn1v) == inv(perm):
436
- coeff_dict[tuple(permtrim(w))] = val
437
- posified = True
438
-
439
- if display_positive and len(perms) > 2 and not mult and not same:
440
- coeff_dict2 = dict(coeff_dict)
441
- for perm in perms[1:]:
442
- coeff_dict3 = {}
443
- for u in coeff_dict2:
444
- coeff_dict4 = {u: 1}
445
- coeff_dict4 = schubmult(coeff_dict4, perm, var2, var3)
446
- for w in coeff_dict4:
447
- coeff_dict4[w] = coeff_dict2[u] * posify(
448
- coeff_dict4[w], u, perm, w, var2, var3, msg
449
- )
450
- coeff_dict3 = add_perm_dict(coeff_dict4, coeff_dict3)
451
- coeff_dict2 = coeff_dict3
452
- coeff_dict = coeff_dict2
453
- posified = True
454
- elif not posified:
455
- coeff_dict = check_coeff_dict
456
-
457
- if pr or formatter is None:
458
- raw_result_dict = _display_full(
459
- coeff_dict,
460
- args,
461
- formatter,
462
- var2,
463
- var3,
464
- posified=posified,
465
- check_coeff_dict=check_coeff_dict,
466
- )
467
- if formatter is None:
468
- return raw_result_dict
469
- except BrokenPipeError:
470
- pass
471
-
472
-
473
- if __name__ == "__main__":
474
- main(sys.argv)
@@ -1,13 +0,0 @@
1
- from ._funcs import (
2
- schubmult,
3
- mult_poly,
4
- schub_coprod,
5
- )
6
-
7
-
8
- __all__ = [
9
- "schubmult",
10
- "mult_poly",
11
- "schub_coprod"
12
- ]
13
-
@@ -1,5 +0,0 @@
1
- import sys
2
- from ._script import main
3
-
4
- if __name__ == "__main__":
5
- sys.exit(main(sys.argv))