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.
- schubmult/__init__.py +94 -1
- schubmult/perm_lib.py +233 -880
- schubmult/poly_lib/__init__.py +31 -0
- schubmult/poly_lib/poly_lib.py +244 -0
- schubmult/poly_lib/schub_poly.py +148 -0
- schubmult/poly_lib/variables.py +204 -0
- schubmult/rings/__init__.py +17 -0
- schubmult/rings/_quantum_schubert_polynomial_ring.py +788 -0
- schubmult/rings/_schubert_polynomial_ring.py +1006 -0
- schubmult/rings/_tensor_schub_ring.py +128 -0
- schubmult/rings/_utils.py +55 -0
- schubmult/{sage_integration → sage}/__init__.py +17 -15
- schubmult/{sage_integration → sage}/_fast_double_schubert_polynomial_ring.py +142 -220
- schubmult/{sage_integration → sage}/_fast_schubert_polynomial_ring.py +78 -72
- schubmult/sage/_indexing.py +51 -0
- schubmult/schub_lib/__init__.py +51 -0
- schubmult/{schubmult_double/_funcs.py → schub_lib/double.py} +618 -798
- schubmult/{schubmult_q/_funcs.py → schub_lib/quantum.py} +70 -72
- schubmult/schub_lib/quantum_double.py +954 -0
- schubmult/schub_lib/schub_lib.py +659 -0
- schubmult/{schubmult_py/_funcs.py → schub_lib/single.py} +58 -48
- schubmult/schub_lib/tests/__init__.py +0 -0
- schubmult/schub_lib/tests/legacy_perm_lib.py +946 -0
- schubmult/schub_lib/tests/test_vs_old.py +109 -0
- schubmult/scripts/__init__.py +0 -0
- schubmult/scripts/schubmult_double.py +378 -0
- schubmult/scripts/schubmult_py.py +84 -0
- schubmult/scripts/schubmult_q.py +109 -0
- schubmult/scripts/schubmult_q_double.py +207 -0
- schubmult/utils/__init__.py +0 -0
- schubmult/{_base_argparse.py → utils/argparse.py} +40 -11
- schubmult/utils/logging.py +16 -0
- schubmult/utils/parsing.py +20 -0
- schubmult/utils/perm_utils.py +135 -0
- schubmult/utils/test_utils.py +65 -0
- schubmult-3.0.0.dist-info/METADATA +1234 -0
- schubmult-3.0.0.dist-info/RECORD +41 -0
- {schubmult-2.0.3.dist-info → schubmult-3.0.0.dist-info}/WHEEL +1 -1
- schubmult-3.0.0.dist-info/entry_points.txt +5 -0
- schubmult/_tests.py +0 -9
- schubmult/sage_integration/_indexing.py +0 -51
- schubmult/schubmult_double/__init__.py +0 -22
- schubmult/schubmult_double/__main__.py +0 -5
- schubmult/schubmult_double/_script.py +0 -474
- schubmult/schubmult_py/__init__.py +0 -13
- schubmult/schubmult_py/__main__.py +0 -5
- schubmult/schubmult_py/_script.py +0 -96
- schubmult/schubmult_q/__init__.py +0 -13
- schubmult/schubmult_q/__main__.py +0 -5
- schubmult/schubmult_q/_script.py +0 -160
- schubmult/schubmult_q_double/__init__.py +0 -17
- schubmult/schubmult_q_double/__main__.py +0 -5
- schubmult/schubmult_q_double/_funcs.py +0 -540
- schubmult/schubmult_q_double/_script.py +0 -398
- schubmult-2.0.3.dist-info/METADATA +0 -455
- schubmult-2.0.3.dist-info/RECORD +0 -30
- schubmult-2.0.3.dist-info/entry_points.txt +0 -5
- {schubmult-2.0.3.dist-info → schubmult-3.0.0.dist-info}/licenses/LICENSE +0 -0
- {schubmult-2.0.3.dist-info → schubmult-3.0.0.dist-info}/top_level.txt +0 -0
@@ -1,96 +0,0 @@
|
|
1
|
-
from schubmult.schubmult_py._funcs import mult_poly, schubmult, schub_coprod
|
2
|
-
import sys
|
3
|
-
from symengine import sympify
|
4
|
-
from schubmult._base_argparse import schub_argparse
|
5
|
-
from schubmult.perm_lib import (
|
6
|
-
inverse,
|
7
|
-
theta,
|
8
|
-
permtrim,
|
9
|
-
inv,
|
10
|
-
uncode,
|
11
|
-
trimcode,
|
12
|
-
)
|
13
|
-
|
14
|
-
|
15
|
-
def main(argv=None):
|
16
|
-
if argv is None:
|
17
|
-
argv = sys.argv
|
18
|
-
try:
|
19
|
-
args, formatter = schub_argparse(
|
20
|
-
"schubmult_py", "Compute products of ordinary Schubert polynomials", argv=argv[1:]
|
21
|
-
)
|
22
|
-
|
23
|
-
mult = args.mult
|
24
|
-
mulstring = args.mulstring
|
25
|
-
|
26
|
-
perms = args.perms
|
27
|
-
|
28
|
-
for perm in perms:
|
29
|
-
try:
|
30
|
-
for i in range(len(perm)):
|
31
|
-
perm[i] = int(perm[i])
|
32
|
-
except Exception as e:
|
33
|
-
print("Permutations must have integer values")
|
34
|
-
raise e
|
35
|
-
|
36
|
-
ascode = args.ascode
|
37
|
-
pr = args.pr
|
38
|
-
coprod = args.coprod
|
39
|
-
raw_result_dict = {}
|
40
|
-
if coprod:
|
41
|
-
if ascode:
|
42
|
-
perms[0] = tuple(permtrim(uncode(perms[0])))
|
43
|
-
pos = [*perms[1]]
|
44
|
-
pos.sort()
|
45
|
-
mperm = tuple(permtrim(perms[0]))
|
46
|
-
|
47
|
-
coeff_dict = schub_coprod(mperm, pos)
|
48
|
-
|
49
|
-
if pr or formatter is None:
|
50
|
-
for firstperm, secondperm in coeff_dict:
|
51
|
-
val = coeff_dict[(firstperm, secondperm)]
|
52
|
-
if val != 0:
|
53
|
-
if ascode:
|
54
|
-
if formatter is None:
|
55
|
-
raw_result_dict[(firstperm, secondperm)] = val
|
56
|
-
else:
|
57
|
-
print(f"{val} {trimcode(firstperm)} {trimcode(secondperm)}")
|
58
|
-
else:
|
59
|
-
if formatter is None:
|
60
|
-
raw_result_dict[(firstperm, secondperm)] = val
|
61
|
-
else:
|
62
|
-
print(f"{val} {firstperm} {secondperm}")
|
63
|
-
else:
|
64
|
-
if ascode:
|
65
|
-
for i in range(len(perms)):
|
66
|
-
perms[i] = tuple(permtrim(uncode(perms[i])))
|
67
|
-
|
68
|
-
perms.sort(reverse=True, key=lambda x: sum(theta(inverse(x))) - inv(x))
|
69
|
-
|
70
|
-
coeff_dict = {tuple(permtrim([*perms[0]])): 1}
|
71
|
-
|
72
|
-
for perm in perms[1:]:
|
73
|
-
coeff_dict = schubmult(coeff_dict, tuple(permtrim([*perm])))
|
74
|
-
if mult:
|
75
|
-
mul_exp = sympify(mulstring)
|
76
|
-
coeff_dict = mult_poly(coeff_dict, mul_exp)
|
77
|
-
|
78
|
-
if pr or formatter is None:
|
79
|
-
for perm, val in coeff_dict.items():
|
80
|
-
if val != 0:
|
81
|
-
if ascode:
|
82
|
-
raw_result_dict[tuple(trimcode(perm))] = val
|
83
|
-
if formatter:
|
84
|
-
print(f"{val} {trimcode(perm)}")
|
85
|
-
else:
|
86
|
-
raw_result_dict[tuple(perm)] = val
|
87
|
-
if formatter:
|
88
|
-
print(f"{val} {perm}")
|
89
|
-
if formatter is None:
|
90
|
-
return raw_result_dict
|
91
|
-
except BrokenPipeError:
|
92
|
-
pass
|
93
|
-
|
94
|
-
|
95
|
-
if __name__ == "__main__":
|
96
|
-
main(sys.argv)
|
schubmult/schubmult_q/_script.py
DELETED
@@ -1,160 +0,0 @@
|
|
1
|
-
from schubmult.schubmult_q._funcs import (
|
2
|
-
schubmult,
|
3
|
-
schubmult_db,
|
4
|
-
)
|
5
|
-
from symengine import sympify
|
6
|
-
from schubmult._base_argparse import schub_argparse
|
7
|
-
from schubmult.perm_lib import (
|
8
|
-
trimcode,
|
9
|
-
permtrim,
|
10
|
-
inv,
|
11
|
-
mulperm,
|
12
|
-
uncode,
|
13
|
-
longest_element,
|
14
|
-
check_blocks,
|
15
|
-
is_parabolic,
|
16
|
-
q_vector,
|
17
|
-
omega,
|
18
|
-
count_less_than,
|
19
|
-
q_var,
|
20
|
-
sg,
|
21
|
-
)
|
22
|
-
import numpy as np
|
23
|
-
from schubmult.schubmult_q_double import factor_out_q_keep_factored
|
24
|
-
import sys
|
25
|
-
|
26
|
-
def _display_full(coeff_dict, args, formatter):
|
27
|
-
raw_result_dict = {}
|
28
|
-
ascode = args.ascode
|
29
|
-
parabolic_index = [int(s) for s in args.parabolic]
|
30
|
-
parabolic = len(parabolic_index) != 0
|
31
|
-
|
32
|
-
if parabolic:
|
33
|
-
w_P = longest_element(parabolic_index)
|
34
|
-
w_P_prime = [1, 2]
|
35
|
-
coeff_dict_update = {}
|
36
|
-
for w_1 in coeff_dict:
|
37
|
-
val = coeff_dict[w_1]
|
38
|
-
q_dict = factor_out_q_keep_factored(val)
|
39
|
-
for q_part in q_dict:
|
40
|
-
qv = q_vector(q_part)
|
41
|
-
w = [*w_1]
|
42
|
-
good = True
|
43
|
-
parabolic_index2 = []
|
44
|
-
for i in range(len(parabolic_index)):
|
45
|
-
if omega(parabolic_index[i], qv) == 0:
|
46
|
-
parabolic_index2 += [parabolic_index[i]]
|
47
|
-
elif omega(parabolic_index[i], qv) != -1:
|
48
|
-
good = False
|
49
|
-
break
|
50
|
-
if not good:
|
51
|
-
continue
|
52
|
-
w_P_prime = longest_element(parabolic_index2)
|
53
|
-
if not check_blocks(qv, parabolic_index):
|
54
|
-
continue
|
55
|
-
w = permtrim(mulperm(mulperm(w, w_P_prime), w_P))
|
56
|
-
if not is_parabolic(w, parabolic_index):
|
57
|
-
continue
|
58
|
-
|
59
|
-
w = tuple(permtrim(w))
|
60
|
-
|
61
|
-
new_q_part = np.prod(
|
62
|
-
[
|
63
|
-
q_var[index + 1 - count_less_than(parabolic_index, index + 1)] ** qv[index]
|
64
|
-
for index in range(len(qv))
|
65
|
-
if index + 1 not in parabolic_index
|
66
|
-
]
|
67
|
-
)
|
68
|
-
|
69
|
-
try:
|
70
|
-
new_q_part = int(new_q_part)
|
71
|
-
except Exception:
|
72
|
-
pass
|
73
|
-
q_val_part = q_dict[q_part]
|
74
|
-
coeff_dict_update[w] = coeff_dict_update.get(w, 0) + new_q_part * q_val_part
|
75
|
-
coeff_dict = coeff_dict_update
|
76
|
-
|
77
|
-
coeff_perms = list(coeff_dict.keys())
|
78
|
-
coeff_perms.sort(key=lambda x: (inv(x), *x))
|
79
|
-
|
80
|
-
for perm in coeff_perms:
|
81
|
-
val = sympify(coeff_dict[perm]).expand()
|
82
|
-
if val != 0:
|
83
|
-
if ascode:
|
84
|
-
|
85
|
-
print(f"{str(trimcode(perm))} {formatter(val)}")
|
86
|
-
else:
|
87
|
-
print(f"{str(perm)} {formatter(val)}")
|
88
|
-
return raw_result_dict
|
89
|
-
|
90
|
-
|
91
|
-
def main(argv=None):
|
92
|
-
if argv is None:
|
93
|
-
argv = sys.argv
|
94
|
-
try:
|
95
|
-
args, formatter = schub_argparse(
|
96
|
-
"schubmult_q",
|
97
|
-
"Compute products of quantum Schubert polynomials",
|
98
|
-
argv=argv[1:],
|
99
|
-
quantum=True,
|
100
|
-
)
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
perms = args.perms
|
105
|
-
|
106
|
-
for perm in perms:
|
107
|
-
try:
|
108
|
-
for i in range(len(perm)):
|
109
|
-
perm[i] = int(perm[i])
|
110
|
-
except Exception as e:
|
111
|
-
print("Permutations must have integer values")
|
112
|
-
raise e
|
113
|
-
|
114
|
-
ascode = args.ascode
|
115
|
-
pr = args.pr
|
116
|
-
parabolic_index = [int(s) for s in args.parabolic]
|
117
|
-
parabolic = len(parabolic_index) != 0
|
118
|
-
slow = args.slow
|
119
|
-
|
120
|
-
if parabolic and len(perms) != 2:
|
121
|
-
print("Only two permutations supported for parabolic.")
|
122
|
-
exit(1)
|
123
|
-
|
124
|
-
if ascode:
|
125
|
-
for i in range(len(perms)):
|
126
|
-
perms[i] = uncode(perms[i])
|
127
|
-
|
128
|
-
if parabolic:
|
129
|
-
for i in range(len(parabolic_index)):
|
130
|
-
index = parabolic_index[i] - 1
|
131
|
-
if sg(index, perms[0]) == 1 or sg(index, perms[1]) == 1:
|
132
|
-
print(
|
133
|
-
"Parabolic given but elements are not minimal length coset representatives."
|
134
|
-
)
|
135
|
-
exit(1)
|
136
|
-
|
137
|
-
coeff_dict = {tuple(permtrim([*perms[0]])): 1}
|
138
|
-
|
139
|
-
if not slow:
|
140
|
-
for perm in perms[1:]:
|
141
|
-
coeff_dict = schubmult_db(coeff_dict, tuple(permtrim([*perm])))
|
142
|
-
else:
|
143
|
-
for perm in perms[1:]:
|
144
|
-
coeff_dict = schubmult(coeff_dict, tuple(permtrim([*perm])))
|
145
|
-
|
146
|
-
# if mult:
|
147
|
-
# mul_exp = sympify(mulstring)
|
148
|
-
# coeff_dict = mult_poly(coeff_dict, mul_exp)
|
149
|
-
|
150
|
-
if pr or formatter is None:
|
151
|
-
raw_result_dict = _display_full(coeff_dict, args, formatter)
|
152
|
-
if formatter is None:
|
153
|
-
return raw_result_dict
|
154
|
-
except BrokenPipeError:
|
155
|
-
pass
|
156
|
-
|
157
|
-
|
158
|
-
if __name__ == "__main__":
|
159
|
-
import sys
|
160
|
-
main(sys.argv)
|
@@ -1,17 +0,0 @@
|
|
1
|
-
from ._funcs import (
|
2
|
-
schubmult,
|
3
|
-
schubmult_db,
|
4
|
-
mult_poly,
|
5
|
-
factor_out_q_keep_factored,
|
6
|
-
schubpoly_quantum
|
7
|
-
)
|
8
|
-
|
9
|
-
|
10
|
-
__all__ = [
|
11
|
-
"schubmult",
|
12
|
-
"schubmult_db",
|
13
|
-
"mult_poly",
|
14
|
-
"factor_out_q_keep_factored",
|
15
|
-
"schubpoly_quantum"
|
16
|
-
]
|
17
|
-
|