schubmult 2.0.3__py3-none-any.whl → 2.0.4__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 (32) hide show
  1. schubmult/__init__.py +1 -1
  2. schubmult/_base_argparse.py +11 -6
  3. schubmult/_tests.py +19 -4
  4. schubmult/perm_lib.py +52 -112
  5. schubmult/sage_integration/__init__.py +13 -14
  6. schubmult/sage_integration/_fast_double_schubert_polynomial_ring.py +92 -128
  7. schubmult/sage_integration/_fast_schubert_polynomial_ring.py +55 -54
  8. schubmult/sage_integration/_indexing.py +35 -39
  9. schubmult/schubmult_double/__init__.py +5 -15
  10. schubmult/schubmult_double/__main__.py +1 -0
  11. schubmult/schubmult_double/_funcs.py +140 -256
  12. schubmult/schubmult_double/_script.py +41 -41
  13. schubmult/schubmult_py/__init__.py +3 -4
  14. schubmult/schubmult_py/__main__.py +1 -0
  15. schubmult/schubmult_py/_funcs.py +18 -18
  16. schubmult/schubmult_py/_script.py +12 -11
  17. schubmult/schubmult_q/__init__.py +2 -7
  18. schubmult/schubmult_q/__main__.py +1 -0
  19. schubmult/schubmult_q/_funcs.py +24 -27
  20. schubmult/schubmult_q/_script.py +27 -21
  21. schubmult/schubmult_q_double/__init__.py +4 -11
  22. schubmult/schubmult_q_double/__main__.py +1 -0
  23. schubmult/schubmult_q_double/_funcs.py +48 -48
  24. schubmult/schubmult_q_double/_script.py +39 -41
  25. schubmult-2.0.4.dist-info/METADATA +542 -0
  26. schubmult-2.0.4.dist-info/RECORD +30 -0
  27. {schubmult-2.0.3.dist-info → schubmult-2.0.4.dist-info}/WHEEL +1 -1
  28. schubmult-2.0.3.dist-info/METADATA +0 -455
  29. schubmult-2.0.3.dist-info/RECORD +0 -30
  30. {schubmult-2.0.3.dist-info → schubmult-2.0.4.dist-info}/entry_points.txt +0 -0
  31. {schubmult-2.0.3.dist-info → schubmult-2.0.4.dist-info}/licenses/LICENSE +0 -0
  32. {schubmult-2.0.3.dist-info → schubmult-2.0.4.dist-info}/top_level.txt +0 -0
@@ -1,34 +1,35 @@
1
+ import sys
2
+ from functools import cached_property
3
+
1
4
  import numpy as np
2
5
  import sympy
3
- import sys
6
+ from symengine import expand, symarray, sympify
4
7
 
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
8
  from schubmult._base_argparse import schub_argparse
17
9
  from schubmult.perm_lib import (
18
10
  add_perm_dict,
19
- inverse,
20
- theta,
21
- permtrim,
11
+ code,
22
12
  inv,
13
+ inverse,
14
+ mu_A,
23
15
  mulperm,
24
- code,
16
+ permtrim,
17
+ theta,
18
+ trimcode,
25
19
  uncode,
26
20
  will_formula_work,
27
- mu_A,
28
- trimcode,
29
21
  )
30
22
 
31
- from functools import cached_property
23
+ # from schubmult.schubmult_double._vars import var_x, var, var_r
24
+ from schubmult.schubmult_double._funcs import (
25
+ compute_positive_rep,
26
+ mult_poly,
27
+ mult_poly_down,
28
+ posify,
29
+ schubmult,
30
+ schubmult_down,
31
+ split_perms,
32
+ )
32
33
 
33
34
 
34
35
  class _gvars:
@@ -145,12 +146,12 @@ def _display_full(
145
146
 
146
147
  if ascode:
147
148
  width = max(
148
- [len(str(trimcode(perm[0])) + " " + str(trimcode(perm[1]))) for perm in perm_pairs]
149
+ [len(str(trimcode(perm[0])) + " " + str(trimcode(perm[1]))) for perm in perm_pairs],
149
150
  )
150
151
  else:
151
152
  width = max([len(str(perm[0]) + " " + str(perm[1])) for perm in perm_pairs])
152
153
 
153
- subs_dict2 = {}
154
+
154
155
  for perm in coeff_perms:
155
156
  val = coeff_dict[perm]
156
157
  downperm = mulperm(list(perm), inverse_kperm)
@@ -166,8 +167,8 @@ def _display_full(
166
167
  secondperm = [downperm[i] - N for i in range(N, len(downperm))]
167
168
  val = sympify(val).subs(subs_dict)
168
169
 
169
- if same and display_positive:
170
- val = expand(sympify(val).xreplace(subs_dict2))
170
+ if same and display_positive:
171
+ val = expand(sympify(val).subs(subs_dict2))
171
172
 
172
173
  if val != 0:
173
174
  if display_positive and not same:
@@ -184,10 +185,10 @@ def _display_full(
184
185
  )
185
186
  if expand(val - val2) != 0:
186
187
  _display(
187
- f"error; write to schubmult@gmail.com with the case {perms=}\n{code(firstperm)=} {code(secondperm)=}\n{val2=}\n{val=}"
188
+ f"error; write to schubmult@gmail.com with the case {perms=}\n{code(firstperm)=} {code(secondperm)=}\n{val2=}\n{val=}",
188
189
  )
189
190
  _display(
190
- f"{code(tuple(permtrim(mulperm(firstperm,muA))))=},{code(tuple(permtrim(mulperm(secondperm,muB))))=},{code(the_top_perm)=}\n{expand(val-val2)=}"
191
+ f"{code(tuple(permtrim(mulperm(firstperm,muA))))=},{code(tuple(permtrim(mulperm(secondperm,muB))))=},{code(the_top_perm)=}\n{expand(val-val2)=}",
191
192
  )
192
193
  exit(1)
193
194
  val = val2
@@ -205,7 +206,7 @@ def _display_full(
205
206
  ] = val
206
207
  if formatter:
207
208
  _display(
208
- f"{tuple(permtrim(firstperm))}{' ':>{width2}}{tuple(permtrim(secondperm))} {formatter(val)}"
209
+ f"{tuple(permtrim(firstperm))}{' ':>{width2}}{tuple(permtrim(secondperm))} {formatter(val)}",
209
210
  )
210
211
  else:
211
212
  width2 = (
@@ -218,7 +219,7 @@ def _display_full(
218
219
  ] = val
219
220
  if formatter:
220
221
  _display(
221
- f"{trimcode(firstperm)}{' ':>{width2}}{trimcode(secondperm)} {formatter(val)}"
222
+ f"{trimcode(firstperm)}{' ':>{width2}}{trimcode(secondperm)} {formatter(val)}",
222
223
  )
223
224
  else:
224
225
  if ascode:
@@ -281,36 +282,30 @@ def _display_full(
281
282
  )
282
283
  else:
283
284
  _display(
284
- f"error; write to schubmult@gmail.com with the case {perms=} {perm=} {val=} {check_coeff_dict.get(perm,0)=}"
285
+ f"error; write to schubmult@gmail.com with the case {perms=} {perm=} {val=} {check_coeff_dict.get(perm,0)=}",
285
286
  )
286
287
  exit(1)
287
288
  if check and expand(val - check_coeff_dict.get(perm, 0)) != 0:
288
289
  _display(
289
- f"error; write to schubmult@gmail.com with the case {perms=} {perm=} {val=} {check_coeff_dict.get(perm,0)=}"
290
+ f"error; write to schubmult@gmail.com with the case {perms=} {perm=} {val=} {check_coeff_dict.get(perm,0)=}",
290
291
  )
291
292
  exit(1)
292
293
  if val != 0:
293
294
  if ascode:
294
295
  raw_result_dict[tuple(trimcode(perm))] = val
295
296
  if formatter:
296
- _display(f"{str(trimcode(perm)):>{width}} {formatter(val)}")
297
+ _display(f"{trimcode(perm)!s:>{width}} {formatter(val)}")
297
298
  else:
298
299
  raw_result_dict[tuple(perm)] = val
299
300
  if formatter:
300
- _display(f"{str(perm):>{width}} {formatter(val)}")
301
+ _display(f"{perm!s:>{width}} {formatter(val)}")
301
302
  return raw_result_dict
302
303
 
303
304
 
304
305
  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
306
  if argv is None:
313
307
  argv = sys.argv
308
+
314
309
  try:
315
310
  var2 = tuple(symarray("y", 100).tolist())
316
311
  var3 = tuple(symarray("z", 100).tolist())
@@ -365,7 +360,7 @@ def main(argv=None):
365
360
 
366
361
  if pr or formatter is None:
367
362
  # logger.log(logging.DEBUG, f"main {var2=}{var3=}{same=}")
368
- return _display_full(
363
+ raw_result_dict = _display_full(
369
364
  coeff_dict,
370
365
  args,
371
366
  formatter,
@@ -375,6 +370,8 @@ def main(argv=None):
375
370
  var3=var3,
376
371
  N=N,
377
372
  )
373
+ if formatter is None:
374
+ return raw_result_dict
378
375
  else:
379
376
  if ascode:
380
377
  for i in range(len(perms)):
@@ -445,7 +442,7 @@ def main(argv=None):
445
442
  coeff_dict4 = schubmult(coeff_dict4, perm, var2, var3)
446
443
  for w in coeff_dict4:
447
444
  coeff_dict4[w] = coeff_dict2[u] * posify(
448
- coeff_dict4[w], u, perm, w, var2, var3, msg
445
+ coeff_dict4[w], u, perm, w, var2, var3, msg,
449
446
  )
450
447
  coeff_dict3 = add_perm_dict(coeff_dict4, coeff_dict3)
451
448
  coeff_dict2 = coeff_dict3
@@ -454,6 +451,7 @@ def main(argv=None):
454
451
  elif not posified:
455
452
  coeff_dict = check_coeff_dict
456
453
 
454
+
457
455
  if pr or formatter is None:
458
456
  raw_result_dict = _display_full(
459
457
  coeff_dict,
@@ -464,11 +462,13 @@ def main(argv=None):
464
462
  posified=posified,
465
463
  check_coeff_dict=check_coeff_dict,
466
464
  )
465
+
467
466
  if formatter is None:
468
467
  return raw_result_dict
469
468
  except BrokenPipeError:
470
469
  pass
470
+ return 0
471
471
 
472
472
 
473
473
  if __name__ == "__main__":
474
- main(sys.argv)
474
+ sys.exit(main(sys.argv))
@@ -1,13 +1,12 @@
1
1
  from ._funcs import (
2
- schubmult,
3
2
  mult_poly,
4
3
  schub_coprod,
4
+ schubmult,
5
5
  )
6
6
 
7
-
8
7
  __all__ = [
9
- "schubmult",
10
8
  "mult_poly",
11
- "schub_coprod"
9
+ "schub_coprod",
10
+ "schubmult",
12
11
  ]
13
12
 
@@ -1,4 +1,5 @@
1
1
  import sys
2
+
2
3
  from ._script import main
3
4
 
4
5
  if __name__ == "__main__":
@@ -1,16 +1,18 @@
1
+ from functools import cached_property
2
+
3
+ from symengine import Add, Mul, Pow, symarray
4
+
1
5
  from schubmult.perm_lib import (
2
- elem_sym_perms,
3
6
  add_perm_dict,
4
7
  compute_vpathdicts,
5
- inverse,
6
- theta,
7
- permtrim,
8
+ elem_sym_perms,
8
9
  inv,
10
+ inverse,
9
11
  mulperm,
12
+ permtrim,
13
+ theta,
10
14
  uncode,
11
15
  )
12
- from symengine import Add, Mul, Pow, symarray
13
- from functools import cached_property
14
16
 
15
17
 
16
18
  class _gvars:
@@ -45,28 +47,27 @@ def single_variable(coeff_dict, varnum):
45
47
  def mult_poly(coeff_dict, poly, var_x=_vars.var_x):
46
48
  if poly in var_x:
47
49
  return single_variable(coeff_dict, var_x.index(poly))
48
- elif isinstance(poly, Mul):
50
+ if isinstance(poly, Mul):
49
51
  ret = coeff_dict
50
52
  for a in poly.args:
51
53
  ret = mult_poly(ret, a, var_x)
52
54
  return ret
53
- elif isinstance(poly, Pow):
55
+ if isinstance(poly, Pow):
54
56
  base = poly.args[0]
55
57
  exponent = int(poly.args[1])
56
58
  ret = coeff_dict
57
59
  for i in range(int(exponent)):
58
60
  ret = mult_poly(ret, base, var_x)
59
61
  return ret
60
- elif isinstance(poly, Add):
62
+ if isinstance(poly, Add):
61
63
  ret = {}
62
64
  for a in poly.args:
63
65
  ret = add_perm_dict(ret, mult_poly(coeff_dict, a, var_x))
64
66
  return ret
65
- else:
66
- ret = {}
67
- for perm in coeff_dict:
68
- ret[perm] = poly * coeff_dict[perm]
69
- return ret
67
+ ret = {}
68
+ for perm in coeff_dict:
69
+ ret[perm] = poly * coeff_dict[perm]
70
+ return ret
70
71
 
71
72
 
72
73
  def schubmult(perm_dict, v):
@@ -87,8 +88,7 @@ def schubmult(perm_dict, v):
87
88
  for index in range(len(th)):
88
89
  for vp in vpathdicts[index]:
89
90
  for v2, vdiff, s in vpathdicts[index][vp]:
90
- if th[index] - vdiff > mx_th[index]:
91
- mx_th[index] = th[index] - vdiff
91
+ mx_th[index] = max(mx_th[index], th[index] - vdiff)
92
92
 
93
93
  for u, val in perm_dict.items():
94
94
  inv_u = inv(u)
@@ -150,7 +150,7 @@ def schub_coprod(perm, indices):
150
150
  break
151
151
  if not flag:
152
152
  continue
153
- firstperm = tuple(permtrim((list(downperm[0:N]))))
154
- secondperm = tuple(permtrim(([downperm[i] - N for i in range(N, len(downperm))])))
153
+ firstperm = tuple(permtrim(list(downperm[0:N])))
154
+ secondperm = tuple(permtrim([downperm[i] - N for i in range(N, len(downperm))]))
155
155
  ret_dict[(firstperm, secondperm)] = val
156
156
  return ret_dict
@@ -1,15 +1,17 @@
1
- from schubmult.schubmult_py._funcs import mult_poly, schubmult, schub_coprod
2
1
  import sys
2
+
3
3
  from symengine import sympify
4
+
4
5
  from schubmult._base_argparse import schub_argparse
5
6
  from schubmult.perm_lib import (
7
+ inv,
6
8
  inverse,
7
- theta,
8
9
  permtrim,
9
- inv,
10
- uncode,
10
+ theta,
11
11
  trimcode,
12
+ uncode,
12
13
  )
14
+ from schubmult.schubmult_py._funcs import mult_poly, schub_coprod, schubmult
13
15
 
14
16
 
15
17
  def main(argv=None):
@@ -17,7 +19,7 @@ def main(argv=None):
17
19
  argv = sys.argv
18
20
  try:
19
21
  args, formatter = schub_argparse(
20
- "schubmult_py", "Compute products of ordinary Schubert polynomials", argv=argv[1:]
22
+ "schubmult_py", "Compute products of ordinary Schubert polynomials", argv=argv[1:],
21
23
  )
22
24
 
23
25
  mult = args.mult
@@ -52,14 +54,13 @@ def main(argv=None):
52
54
  if val != 0:
53
55
  if ascode:
54
56
  if formatter is None:
55
- raw_result_dict[(firstperm, secondperm)] = val
57
+ raw_result_dict[(tuple(trimcode(firstperm)), tuple(trimcode(secondperm)))] = val
56
58
  else:
57
59
  print(f"{val} {trimcode(firstperm)} {trimcode(secondperm)}")
60
+ elif formatter is None:
61
+ raw_result_dict[(firstperm, secondperm)] = val
58
62
  else:
59
- if formatter is None:
60
- raw_result_dict[(firstperm, secondperm)] = val
61
- else:
62
- print(f"{val} {firstperm} {secondperm}")
63
+ print(f"{val} {firstperm} {secondperm}")
63
64
  else:
64
65
  if ascode:
65
66
  for i in range(len(perms)):
@@ -93,4 +94,4 @@ def main(argv=None):
93
94
 
94
95
 
95
96
  if __name__ == "__main__":
96
- main(sys.argv)
97
+ sys.exit(main(sys.argv))
@@ -1,13 +1,8 @@
1
- from ._funcs import (
2
- schubmult,
3
- schubmult_db,
4
- mult_poly
5
- )
6
-
1
+ from ._funcs import mult_poly, schubmult, schubmult_db
7
2
 
8
3
  __all__ = [
4
+ "mult_poly",
9
5
  "schubmult",
10
6
  "schubmult_db",
11
- "mult_poly"
12
7
  ]
13
8
 
@@ -1,4 +1,5 @@
1
1
  import sys
2
+
2
3
  from ._script import main
3
4
 
4
5
  if __name__ == "__main__":
@@ -1,27 +1,28 @@
1
+ from functools import cached_property
2
+
1
3
  from symengine import Add, Mul, Pow, symarray
4
+
2
5
  from schubmult.perm_lib import (
3
- elem_sym_perms_q,
4
6
  add_perm_dict,
7
+ code,
5
8
  compute_vpathdicts,
9
+ double_elem_sym_q,
10
+ elem_sym_perms_q,
11
+ inv,
6
12
  inverse,
7
- strict_theta,
8
13
  medium_theta,
9
- permtrim,
10
- inv,
11
14
  mulperm,
12
- code,
15
+ permtrim,
16
+ strict_theta,
13
17
  uncode,
14
- double_elem_sym_q,
15
18
  )
16
19
 
17
- from functools import cached_property
18
-
19
20
 
20
21
  class _gvars:
21
22
  @cached_property
22
23
  def n(self):
23
24
  return 100
24
-
25
+
25
26
  @cached_property
26
27
  def var_x(self):
27
28
  return tuple(symarray("x", self.n).tolist())
@@ -51,28 +52,27 @@ def single_variable(coeff_dict, varnum, var_q=_vars.q_var):
51
52
  def mult_poly(coeff_dict, poly, var_x=_vars.var_x, var_q=_vars.q_var):
52
53
  if poly in var_x:
53
54
  return single_variable(coeff_dict, var_x.index(poly), var_q=var_q)
54
- elif isinstance(poly, Mul):
55
+ if isinstance(poly, Mul):
55
56
  ret = coeff_dict
56
57
  for a in poly.args:
57
58
  ret = mult_poly(ret, a, var_x, var_q=var_q)
58
59
  return ret
59
- elif isinstance(poly, Pow):
60
+ if isinstance(poly, Pow):
60
61
  base = poly.args[0]
61
62
  exponent = int(poly.args[1])
62
63
  ret = coeff_dict
63
64
  for i in range(int(exponent)):
64
65
  ret = mult_poly(ret, base, var_x, var_q=var_q)
65
66
  return ret
66
- elif isinstance(poly, Add):
67
+ if isinstance(poly, Add):
67
68
  ret = {}
68
69
  for a in poly.args:
69
70
  ret = add_perm_dict(ret, mult_poly(coeff_dict, a, var_x, var_q=var_q))
70
71
  return ret
71
- else:
72
- ret = {}
73
- for perm in coeff_dict:
74
- ret[perm] = poly * coeff_dict[perm]
75
- return ret
72
+ ret = {}
73
+ for perm in coeff_dict:
74
+ ret[perm] = poly * coeff_dict[perm]
75
+ return ret
76
76
 
77
77
  def schubmult_db(perm_dict, v, q_var=_vars.q_var):
78
78
  if v == (1, 2):
@@ -102,14 +102,12 @@ def schubmult_db(perm_dict, v, q_var=_vars.q_var):
102
102
  mx_th = 0
103
103
  for vp in vpathdicts[index]:
104
104
  for v2, vdiff, s in vpathdicts[index][vp]:
105
- if th[index] - vdiff > mx_th:
106
- mx_th = th[index] - vdiff
105
+ mx_th = max(mx_th, th[index] - vdiff)
107
106
  if index < len(th) - 1 and th[index] == th[index + 1]:
108
107
  mx_th1 = 0
109
108
  for vp in vpathdicts[index + 1]:
110
109
  for v2, vdiff, s in vpathdicts[index + 1][vp]:
111
- if th[index + 1] - vdiff > mx_th1:
112
- mx_th1 = th[index + 1] - vdiff
110
+ mx_th1 = max(mx_th1, th[index + 1] - vdiff)
113
111
  newpathsums = {}
114
112
  for up in vpathsums:
115
113
  newpathsums0 = {}
@@ -126,7 +124,7 @@ def schubmult_db(perm_dict, v, q_var=_vars.q_var):
126
124
  if udiff1 + vdiff2 == th[index]:
127
125
  newpathsums0[(up1, udiff1, mul_val1)][v2] = (
128
126
  newpathsums0[(up1, udiff1, mul_val1)].get(
129
- v2, 0
127
+ v2, 0,
130
128
  )
131
129
  + s2 * sumval * mul_val1
132
130
  )
@@ -173,7 +171,7 @@ def schubmult_db(perm_dict, v, q_var=_vars.q_var):
173
171
  vpathsums = newpathsums
174
172
  toget = tuple(vmu)
175
173
  ret_dict = add_perm_dict(
176
- {ep: vpathsums[ep].get(toget, 0) for ep in vpathsums}, ret_dict
174
+ {ep: vpathsums[ep].get(toget, 0) for ep in vpathsums}, ret_dict,
177
175
  )
178
176
  return ret_dict
179
177
 
@@ -198,13 +196,12 @@ def schubmult(perm_dict, v):
198
196
  mx_th = 0
199
197
  for vp in vpathdicts[index]:
200
198
  for v2, vdiff, s in vpathdicts[index][vp]:
201
- if th[index] - vdiff > mx_th:
202
- mx_th = th[index] - vdiff
199
+ mx_th = max(mx_th, th[index] - vdiff)
203
200
  newpathsums = {}
204
201
  for up in vpathsums:
205
202
  inv_up = inv(up)
206
203
  newperms = elem_sym_perms_q(
207
- up, min(mx_th, (inv_mu - (inv_up - inv_u)) - inv_vmu), th[index]
204
+ up, min(mx_th, (inv_mu - (inv_up - inv_u)) - inv_vmu), th[index],
208
205
  )
209
206
  for up2, udiff, mul_val in newperms:
210
207
  if up2 not in newpathsums:
@@ -222,7 +219,7 @@ def schubmult(perm_dict, v):
222
219
  vpathsums = newpathsums
223
220
  toget = tuple(vmu)
224
221
  ret_dict = add_perm_dict(
225
- {ep: vpathsums[ep].get(toget, 0) for ep in vpathsums}, ret_dict
222
+ {ep: vpathsums[ep].get(toget, 0) for ep in vpathsums}, ret_dict,
226
223
  )
227
224
  return ret_dict
228
225
 
@@ -1,27 +1,30 @@
1
- from schubmult.schubmult_q._funcs import (
2
- schubmult,
3
- schubmult_db,
4
- )
1
+ import sys
2
+
3
+ import numpy as np
5
4
  from symengine import sympify
5
+
6
6
  from schubmult._base_argparse import schub_argparse
7
7
  from schubmult.perm_lib import (
8
- trimcode,
9
- permtrim,
10
- inv,
11
- mulperm,
12
- uncode,
13
- longest_element,
14
8
  check_blocks,
9
+ count_less_than,
10
+ inv,
15
11
  is_parabolic,
16
- q_vector,
12
+ longest_element,
13
+ mulperm,
17
14
  omega,
18
- count_less_than,
15
+ permtrim,
19
16
  q_var,
17
+ q_vector,
20
18
  sg,
19
+ trimcode,
20
+ uncode,
21
+ )
22
+ from schubmult.schubmult_q._funcs import (
23
+ schubmult,
24
+ schubmult_db,
21
25
  )
22
- import numpy as np
23
26
  from schubmult.schubmult_q_double import factor_out_q_keep_factored
24
- import sys
27
+
25
28
 
26
29
  def _display_full(coeff_dict, args, formatter):
27
30
  raw_result_dict = {}
@@ -63,7 +66,7 @@ def _display_full(coeff_dict, args, formatter):
63
66
  q_var[index + 1 - count_less_than(parabolic_index, index + 1)] ** qv[index]
64
67
  for index in range(len(qv))
65
68
  if index + 1 not in parabolic_index
66
- ]
69
+ ],
67
70
  )
68
71
 
69
72
  try:
@@ -81,10 +84,13 @@ def _display_full(coeff_dict, args, formatter):
81
84
  val = sympify(coeff_dict[perm]).expand()
82
85
  if val != 0:
83
86
  if ascode:
84
-
85
- print(f"{str(trimcode(perm))} {formatter(val)}")
87
+ raw_result_dict[tuple(trimcode(perm))] = val
88
+ if formatter:
89
+ print(f"{trimcode(perm)!s} {formatter(val)}")
86
90
  else:
87
- print(f"{str(perm)} {formatter(val)}")
91
+ raw_result_dict[perm] = val
92
+ if formatter:
93
+ print(f"{perm!s} {formatter(val)}")
88
94
  return raw_result_dict
89
95
 
90
96
 
@@ -99,7 +105,7 @@ def main(argv=None):
99
105
  quantum=True,
100
106
  )
101
107
 
102
-
108
+
103
109
 
104
110
  perms = args.perms
105
111
 
@@ -130,7 +136,7 @@ def main(argv=None):
130
136
  index = parabolic_index[i] - 1
131
137
  if sg(index, perms[0]) == 1 or sg(index, perms[1]) == 1:
132
138
  print(
133
- "Parabolic given but elements are not minimal length coset representatives."
139
+ "Parabolic given but elements are not minimal length coset representatives.",
134
140
  )
135
141
  exit(1)
136
142
 
@@ -157,4 +163,4 @@ def main(argv=None):
157
163
 
158
164
  if __name__ == "__main__":
159
165
  import sys
160
- main(sys.argv)
166
+ sys.exit(main(sys.argv))
@@ -1,17 +1,10 @@
1
- from ._funcs import (
2
- schubmult,
3
- schubmult_db,
4
- mult_poly,
5
- factor_out_q_keep_factored,
6
- schubpoly_quantum
7
- )
8
-
1
+ from ._funcs import factor_out_q_keep_factored, mult_poly, schubmult, schubmult_db, schubpoly_quantum
9
2
 
10
3
  __all__ = [
4
+ "factor_out_q_keep_factored",
5
+ "mult_poly",
11
6
  "schubmult",
12
7
  "schubmult_db",
13
- "mult_poly",
14
- "factor_out_q_keep_factored",
15
- "schubpoly_quantum"
8
+ "schubpoly_quantum",
16
9
  ]
17
10
 
@@ -1,4 +1,5 @@
1
1
  import sys
2
+
2
3
  from ._script import main
3
4
 
4
5
  if __name__ == "__main__":