schubmult 3.0.0__py3-none-any.whl → 3.0.1__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 +3 -1
- schubmult/perm_lib.py +22 -0
- schubmult/poly_lib/poly_lib.py +32 -0
- schubmult/rings/__init__.py +2 -1
- schubmult/rings/_quantum_schubert_polynomial_ring.py +187 -223
- schubmult/rings/_schubert_polynomial_ring.py +58 -33
- schubmult/schub_lib/quantum_double.py +2 -2
- schubmult/utils/argparse.py +4 -4
- {schubmult-3.0.0.dist-info → schubmult-3.0.1.dist-info}/METADATA +1 -1
- {schubmult-3.0.0.dist-info → schubmult-3.0.1.dist-info}/RECORD +14 -14
- {schubmult-3.0.0.dist-info → schubmult-3.0.1.dist-info}/WHEEL +1 -1
- {schubmult-3.0.0.dist-info → schubmult-3.0.1.dist-info}/entry_points.txt +0 -0
- {schubmult-3.0.0.dist-info → schubmult-3.0.1.dist-info}/licenses/LICENSE +0 -0
- {schubmult-3.0.0.dist-info → schubmult-3.0.1.dist-info}/top_level.txt +0 -0
schubmult/__init__.py
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
__version__ = "3.0.
|
1
|
+
__version__ = "3.0.1"
|
2
2
|
#schubpoly_from_elems?
|
3
3
|
from .perm_lib import Permutation, permtrim, theta, uncode
|
4
4
|
from .poly_lib.poly_lib import efficient_subs, elem_sym_poly, elem_sym_poly_q, q_vector, xreplace_genvars
|
@@ -7,6 +7,7 @@ from .poly_lib.variables import CustomGeneratingSet, GeneratingSet, GeneratingSe
|
|
7
7
|
from .rings._quantum_schubert_polynomial_ring import (
|
8
8
|
QDSx,
|
9
9
|
QPDSx,
|
10
|
+
QPSx,
|
10
11
|
QSx,
|
11
12
|
)
|
12
13
|
from .rings._schubert_polynomial_ring import (
|
@@ -52,6 +53,7 @@ __all__ = [
|
|
52
53
|
"Permutation",
|
53
54
|
"QDSx",
|
54
55
|
"QPDSx",
|
56
|
+
"QPSx",
|
55
57
|
"QSx",
|
56
58
|
"Sx",
|
57
59
|
"apply_peterson_woodward",
|
schubmult/perm_lib.py
CHANGED
@@ -47,6 +47,26 @@ class Permutation(Basic):
|
|
47
47
|
L.sort(key=lambda i: itera[i - 1])
|
48
48
|
return Permutation(L)
|
49
49
|
|
50
|
+
def _latex(self, printer):
|
51
|
+
if Permutation.print_as_code:
|
52
|
+
return printer.doprint(trimcode(self))
|
53
|
+
return printer.doprint(list(self._perm))
|
54
|
+
|
55
|
+
# pattern is a list, not a permutation
|
56
|
+
def has_pattern(self, pattern):
|
57
|
+
if self == Permutation(pattern):
|
58
|
+
return True
|
59
|
+
if len(self._perm) <= len(Permutation(pattern)):
|
60
|
+
return False
|
61
|
+
expanded = list(self) + [i for i in range(len(self)+1,len(pattern)+1)]
|
62
|
+
for i in range(len(expanded)):
|
63
|
+
rmval = expanded[i]
|
64
|
+
perm2 = [*expanded[:i], *expanded[i+1:]]
|
65
|
+
perm2 = tuple([val-1 if val>rmval else val for val in perm2])
|
66
|
+
if Permutation(perm2).has_pattern(pattern):
|
67
|
+
return True
|
68
|
+
return False
|
69
|
+
|
50
70
|
def _sympystr(self, printer):
|
51
71
|
if Permutation.print_as_code:
|
52
72
|
return printer.doprint(trimcode(self))
|
@@ -350,3 +370,5 @@ def split_perms(perms):
|
|
350
370
|
if not did:
|
351
371
|
perms2 += [perm]
|
352
372
|
return perms2
|
373
|
+
|
374
|
+
bad_classical_patterns = [Permutation([1,4,2,3]), Permutation([1,4,3,2]), Permutation([4,1,3,2]), Permutation([3,1,4,2])]
|
schubmult/poly_lib/poly_lib.py
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
from functools import cache, cached_property
|
2
2
|
|
3
3
|
import symengine
|
4
|
+
import sympy
|
4
5
|
from symengine import Mul, Pow, sympify
|
5
6
|
|
6
7
|
import schubmult.perm_lib as pl
|
@@ -56,6 +57,20 @@ zero = sympify(0)
|
|
56
57
|
|
57
58
|
_vars = _gvars()
|
58
59
|
|
60
|
+
def sv_posify(val, var2):
|
61
|
+
var_r = vv.GeneratingSet("r")
|
62
|
+
subs_dict = {}
|
63
|
+
for i in range(1, 100):
|
64
|
+
sm = sympify(var2[1])
|
65
|
+
for j in range(1, i):
|
66
|
+
sm += var_r[j]
|
67
|
+
subs_dict[sympify(var2[i])] = sm
|
68
|
+
val = sympify(sympy.simplify(efficient_subs(sympify(val), subs_dict)))
|
69
|
+
bingle_dict = {}
|
70
|
+
for i in range(1, len(var_r) - 1):
|
71
|
+
bingle_dict[var_r[i]] = var2[i + 1] - var2[i] # sympy.Add(*[_vars.var2[i+1], - _vars.var2[i]],evaluate=False)
|
72
|
+
return val.xreplace(bingle_dict)
|
73
|
+
|
59
74
|
def act(w, poly, genset):
|
60
75
|
if not isinstance(w, pl.Permutation):
|
61
76
|
w = pl.Permutation(w)
|
@@ -148,6 +163,23 @@ def elem_sym_poly_q(p, k, varl1, varl2, q_var=_vars.q_var):
|
|
148
163
|
)
|
149
164
|
|
150
165
|
|
166
|
+
def complete_sym_poly(p, k, vrs):
|
167
|
+
if p == 0 and k>=0:
|
168
|
+
return 1
|
169
|
+
if p != 0 and k == 0:
|
170
|
+
return 0
|
171
|
+
if k < 0:
|
172
|
+
return 0
|
173
|
+
if k == 1:
|
174
|
+
return vrs[0]**p
|
175
|
+
sm = 0
|
176
|
+
mid = k // 2
|
177
|
+
for i in range(p + 1):
|
178
|
+
sm += complete_sym_poly(i, mid, vrs[:mid])*complete_sym_poly(p-i, k-mid, vrs[mid:])
|
179
|
+
return sm
|
180
|
+
|
181
|
+
|
182
|
+
|
151
183
|
def elem_sym_poly(p, k, varl1, varl2, xstart=0, ystart=0):
|
152
184
|
if p > k:
|
153
185
|
return zero
|
schubmult/rings/__init__.py
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
from ._quantum_schubert_polynomial_ring import QDSx, QPDSx, QSx, QuantumDoubleSchubertAlgebraElement, QuantumDoubleSchubertAlgebraElement_basis, make_parabolic_quantum_basis
|
1
|
+
from ._quantum_schubert_polynomial_ring import QDSx, QPDSx, QPSx, QSx, QuantumDoubleSchubertAlgebraElement, QuantumDoubleSchubertAlgebraElement_basis, make_parabolic_quantum_basis
|
2
2
|
from ._schubert_polynomial_ring import DoubleSchubertAlgebraElement, DoubleSchubertAlgebraElement_basis, DSx, Sx
|
3
3
|
from ._utils import poly_ring
|
4
4
|
|
@@ -8,6 +8,7 @@ __all__ = [
|
|
8
8
|
"DoubleSchubertAlgebraElement_basis",
|
9
9
|
"QDSx",
|
10
10
|
"QPDSx",
|
11
|
+
"QPSx",
|
11
12
|
"QSx",
|
12
13
|
"QuantumDoubleSchubertAlgebraElement",
|
13
14
|
"QuantumDoubleSchubertAlgebraElement_basis",
|
@@ -4,7 +4,7 @@ from bisect import bisect_left
|
|
4
4
|
from functools import cache
|
5
5
|
|
6
6
|
import sympy
|
7
|
-
from symengine import S, sympify
|
7
|
+
from symengine import S, Symbol, sympify
|
8
8
|
from sympy import Basic
|
9
9
|
|
10
10
|
import schubmult.rings._schubert_polynomial_ring as spr
|
@@ -12,7 +12,7 @@ import schubmult.rings._utils as utils
|
|
12
12
|
import schubmult.schub_lib.quantum as py
|
13
13
|
import schubmult.schub_lib.quantum_double as yz
|
14
14
|
from schubmult.perm_lib import Permutation, longest_element
|
15
|
-
from schubmult.poly_lib.poly_lib import elem_sym_poly, elem_sym_poly_q, xreplace_genvars
|
15
|
+
from schubmult.poly_lib.poly_lib import complete_sym_poly, elem_sym_poly, elem_sym_poly_q, xreplace_genvars
|
16
16
|
from schubmult.poly_lib.schub_poly import schubpoly_from_elems
|
17
17
|
from schubmult.poly_lib.variables import GeneratingSet, GeneratingSet_base
|
18
18
|
from schubmult.utils.logging import get_logger
|
@@ -31,14 +31,14 @@ class QuantumDoubleSchubertAlgebraElement(spr.BasisSchubertAlgebraElement):
|
|
31
31
|
return spr.BasisSchubertAlgebraElement.__new__(cls, _dict, basis)
|
32
32
|
|
33
33
|
def subs(self, old, new):
|
34
|
-
|
35
|
-
elb = self.as_classical().subs(old, new).as_quantum()
|
36
|
-
logger.debug(f"{elb=}")
|
37
|
-
return elb
|
34
|
+
return self.as_classical().subs(old, new).as_quantum()
|
38
35
|
|
39
36
|
|
40
37
|
# # TODO: not a noncommutative symbol, something else
|
41
38
|
# # Atomic Schubert polynomial
|
39
|
+
_pretty_schub_char = "𝕼𝔖" # noqa: RUF001
|
40
|
+
|
41
|
+
|
42
42
|
class QDSchubPoly(QuantumDoubleSchubertAlgebraElement):
|
43
43
|
is_Atom = True
|
44
44
|
|
@@ -49,6 +49,7 @@ class QDSchubPoly(QuantumDoubleSchubertAlgebraElement):
|
|
49
49
|
def __xnew__(_class, k, basis):
|
50
50
|
obj = QuantumDoubleSchubertAlgebraElement.__new__(_class, sympy.Dict({(Permutation(k[0]), k[1]): 1}), basis)
|
51
51
|
obj._perm = k[0]
|
52
|
+
obj._key = k
|
52
53
|
obj._coeff_var = k[1]
|
53
54
|
# obj._base_var = base_var
|
54
55
|
return obj
|
@@ -63,6 +64,23 @@ class QDSchubPoly(QuantumDoubleSchubertAlgebraElement):
|
|
63
64
|
return printer.doprint(f"QS{self.genset.label}({printer.doprint(self._perm)})")
|
64
65
|
return printer.doprint(f"QDS{self.genset.label}({printer.doprint(self._perm)}, {spr._varstr(self._coeff_var)})")
|
65
66
|
|
67
|
+
def _pretty(self, printer):
|
68
|
+
if self._key[0] == Permutation([]):
|
69
|
+
return printer._print(1)
|
70
|
+
subscript = printer.doprint(int("".join([str(i) for i in self._key[0]])))
|
71
|
+
if self._key[1] == 0 or self._key[1] == utils.NoneVar:
|
72
|
+
return printer._print_Function(sympy.Function(f"{_pretty_schub_char}_{subscript}")(sympy.Symbol(self.genset.label)))
|
73
|
+
return printer._print_Function(sympy.Function(f"{_pretty_schub_char}_{subscript}")(sympy.Symbol(f"{self.genset.label}; {self._key[1]}")))
|
74
|
+
|
75
|
+
def _latex(self, printer):
|
76
|
+
if self._key[0] == Permutation([]):
|
77
|
+
return printer._print(1)
|
78
|
+
# subscript = printer._print(int("".join([str(i) for i in self._key[0]])))
|
79
|
+
subscript = sympy.sstr(self._key[0])
|
80
|
+
if self._key[1] == 0 or self._key[1] == utils.NoneVar:
|
81
|
+
return printer._print_Function(sympy.Function("\\widetilde{\\mathfrak{S}}" + f"_{'{' + subscript + '}'}")(sympy.Symbol(self.genset.label)))
|
82
|
+
return printer._print_Function(sympy.Function("\\widetilde{\\mathfrak{S}}" + f"_{'{' + subscript + '}'}")(sympy.Symbol(f"{self.genset.label}; {self._key[1]}")))
|
83
|
+
|
66
84
|
|
67
85
|
class ParabolicQuantumDoubleSchubertAlgebraElement(spr.BasisSchubertAlgebraElement):
|
68
86
|
def __new__(cls, _dict, basis):
|
@@ -91,6 +109,7 @@ class PQDSchubPoly(ParabolicQuantumDoubleSchubertAlgebraElement):
|
|
91
109
|
def __xnew__(_class, k, basis):
|
92
110
|
obj = ParabolicQuantumDoubleSchubertAlgebraElement.__new__(_class, sympy.Dict({(Permutation(k[0]), k[1]): 1}), basis)
|
93
111
|
obj._perm = k[0]
|
112
|
+
obj._key = k
|
94
113
|
# obj._perm._print_as_code = True
|
95
114
|
obj._coeff_var = k[1]
|
96
115
|
# obj._base_var = base_var
|
@@ -106,11 +125,48 @@ class PQDSchubPoly(ParabolicQuantumDoubleSchubertAlgebraElement):
|
|
106
125
|
return printer.doprint(f"QPS{self.genset.label}{(tuple(self.index_comp))}({printer.doprint(self._perm)})")
|
107
126
|
return printer.doprint(f"QPDS{self.genset.label}{tuple(self.index_comp)}({printer.doprint(self._perm)}, {spr._varstr(self._coeff_var)})")
|
108
127
|
|
128
|
+
def _pretty(self, printer):
|
129
|
+
if self._key[0] == Permutation([]):
|
130
|
+
return printer._print(1)
|
131
|
+
subscript = printer._print(int("".join([str(i) for i in self._key[0]])))
|
132
|
+
# subscript = sympy.sstr(self._key[0])
|
133
|
+
if self._key[1] == 0 or self._key[1] == utils.NoneVar:
|
134
|
+
return printer._print_Function(sympy.Function(f"{_pretty_schub_char}_{subscript}")(sympy.Symbol(f"{self.genset.label} | {self.basis.index_comp}")))
|
135
|
+
return printer._print_Function(sympy.Function(f"{_pretty_schub_char}_{subscript}")(sympy.Symbol(f"{self.genset.label}; {self._key[1]} | {self.basis.index_comp}")))
|
136
|
+
|
137
|
+
def _latex(self, printer):
|
138
|
+
if self._key[0] == Permutation([]):
|
139
|
+
return printer._print(1)
|
140
|
+
# subscript = printer._print(int("".join([str(i) for i in self._key[0]])))
|
141
|
+
subscript = printer._print(self._key[0])
|
142
|
+
supscript = printer._print(sympy.Tuple(*self.index_comp))
|
143
|
+
if self._key[1] == 0 or self._key[1] == utils.NoneVar:
|
144
|
+
return printer._print_Function(sympy.Function("\\widetilde{\\mathfrak{S}}" + f"^{'{'}{supscript}{'}'}_{'{' + subscript + '}'}")(sympy.Symbol(self.genset.label)))
|
145
|
+
return printer._print_Function(sympy.Function("\\widetilde{\\mathfrak{S}}" + f"^{'{'}{supscript}{'}'}_{'{' + subscript + '}'}")(sympy.Symbol(f"{self.genset.label}; {self._key[1]}")))
|
146
|
+
|
109
147
|
|
110
148
|
class QuantumDoubleSchubertAlgebraElement_basis(Basic):
|
111
149
|
def __new__(cls, genset):
|
112
150
|
return Basic.__new__(cls, genset)
|
113
151
|
|
152
|
+
@property
|
153
|
+
def symbol_elem_func(self):
|
154
|
+
def elem_func(p, k, varl1, varl2): # noqa: ARG001
|
155
|
+
if p == 0 and k >= 0:
|
156
|
+
return 1
|
157
|
+
if p < 0 or p > k:
|
158
|
+
return 0
|
159
|
+
return sympy.Add(*[(Symbol(f"e_{p - i}_{k}") if p - i > 0 else 1) * complete_sym_poly(i, k + 1 - p, [-v for v in varl2]) for i in range(p + 1)])
|
160
|
+
|
161
|
+
return elem_func
|
162
|
+
|
163
|
+
def elem_sym_subs(self, kk):
|
164
|
+
elems = []
|
165
|
+
for k in range(1, kk + 1):
|
166
|
+
for p in range(1, k + 1):
|
167
|
+
elems += [(sympy.Symbol(f"e_{p}_{k}"), elem_sym_poly_q(p, k, self.genset[1:], utils.poly_ring(0)))]
|
168
|
+
return dict(elems)
|
169
|
+
|
114
170
|
def _from_dict(self, _dict):
|
115
171
|
return QuantumDoubleSchubertAlgebraElement(_dict, self)
|
116
172
|
|
@@ -210,13 +266,13 @@ class QuantumDoubleSchubertAlgebraElement_basis(Basic):
|
|
210
266
|
if x.genset == self.genset:
|
211
267
|
return self(x.expand(), cv, genset)
|
212
268
|
else:
|
213
|
-
logger.debug("bagelflap")
|
269
|
+
# logger.debug("bagelflap")
|
214
270
|
x = sympify(x)
|
215
271
|
if cv is None or cv == utils.NoneVar:
|
216
272
|
cv = utils.NoneVar
|
217
|
-
logger.debug(f"{x=} {list(genset)=}")
|
273
|
+
# logger.debug(f"{x=} {list(genset)=}")
|
218
274
|
result = py.mult_poly_q({Permutation([]): 1}, x, genset)
|
219
|
-
logger.debug(f"{result=}")
|
275
|
+
# logger.debug(f"{result=}")
|
220
276
|
else:
|
221
277
|
result = yz.mult_poly_q_double({Permutation([]): 1}, x, genset, utils.poly_ring(cv))
|
222
278
|
elem = QuantumDoubleSchubertAlgebraElement({(k, cv): v for k, v in result.items()}, self)
|
@@ -275,48 +331,39 @@ class QuantumSchubertAlgebraElement_basis(QuantumDoubleSchubertAlgebraElement_ba
|
|
275
331
|
elem = self._from_single_dict(result)
|
276
332
|
return elem
|
277
333
|
|
334
|
+
def in_SEM_basis(self):
|
335
|
+
result = S.Zero
|
336
|
+
for k, v in self.coeff_dict.items():
|
337
|
+
if len(k[0]) > len(self._longest):
|
338
|
+
parabolic_index = []
|
339
|
+
start = 0
|
340
|
+
# 1, 2 | 3
|
341
|
+
index_comp = [*self._n, len(k[0]) + 1 - self._N[-1]]
|
342
|
+
for i in range(len(index_comp)):
|
343
|
+
end = start + index_comp[i]
|
344
|
+
parabolic_index += list(range(start + 1, end))
|
345
|
+
# start += int(args.parabolic[i])
|
346
|
+
start = end
|
347
|
+
otherlong = Permutation(list(range(parabolic_index[-1] + 1, 0, -1)))
|
348
|
+
longpar = Permutation(longest_element(parabolic_index))
|
349
|
+
# print(f"{longpar=} {parabolic_index=}")
|
350
|
+
longest = otherlong * longpar
|
351
|
+
# print(f"new longest = {longest=}")
|
352
|
+
else:
|
353
|
+
longest = self._longest
|
354
|
+
result += v * schubpoly_from_elems(k[0], self.genset, utils.poly_ring(k[1]), elem_func=self.basis.symbol_elem_func, mumu=~longest)
|
355
|
+
return result
|
356
|
+
|
278
357
|
|
279
358
|
class ParabolicQuantumDoubleSchubertAlgebraElement_basis(Basic):
|
280
359
|
def __new__(cls, genset, index_comp):
|
281
|
-
obj = Basic.__new__(cls, genset,
|
360
|
+
obj = Basic.__new__(cls, genset, sympy.Tuple(*index_comp))
|
282
361
|
obj._quantum_basis = QuantumDoubleSchubertAlgebraElement_basis(genset)
|
283
362
|
obj._classical_basis = spr.DoubleSchubertAlgebraElement_basis(genset)
|
284
363
|
obj._n = list(index_comp)
|
285
364
|
obj._N = [sum(obj._n[:i]) for i in range(len(obj._n) + 1)]
|
286
|
-
# print(f"{obj._N=}")
|
287
|
-
# obj._D = []
|
288
|
-
# obj._E = {}
|
289
|
-
# from symengine import Matrix
|
290
|
-
# for j in range(1, len(obj._N)):
|
291
|
-
# m_arr = [[0 for i in range(obj._N[j])] for p in range(obj._N[j])]
|
292
|
-
# for i in range(obj._N[j]):
|
293
|
-
# m_arr[i][i] = a[i+1] - t[1] #genset[i+1] - t[1]
|
294
|
-
# if i < obj._N[j] - 1:
|
295
|
-
# m_arr[i][i+1] = -1
|
296
|
-
# for b in range(1, j):
|
297
|
-
# njm1 = obj._N[b + 1] - 1
|
298
|
-
# njp1 = obj._N[b - 1]
|
299
|
-
# # print(f"{b=}")
|
300
|
-
# # print(f"{njm1=} {njp1=}")
|
301
|
-
# if njp1 < obj._N[j] and njm1 < obj._N[j]:
|
302
|
-
# # print(f"{b=} {obj._n[b]=}")
|
303
|
-
# m_arr[njm1][njp1] = -(-1)**(obj._n[b])*q_var[b]
|
304
|
-
# # print(Matrix(m_arr))
|
305
|
-
# poly = Matrix(m_arr).det().simplify()
|
306
|
-
# # print(f"{poly=}")
|
307
|
-
# # def dongle(v):
|
308
|
-
# # return poly.subs(t[1], v)
|
309
|
-
# obj._D += [spunky_basis(poly)]
|
310
|
-
# obj._E[obj._N[j]] = {obj._N[j]: obj._D[-1]}
|
311
|
-
# for i in range(1,obj._N[j]):
|
312
|
-
# obj._E[obj._N[j]][obj._N[j] - i] = -obj._E[obj._N[j]][obj._N[j] - i + 1].divdiff(i)
|
313
|
-
# # print(obj._E)
|
314
|
-
# add_am = 6
|
315
|
-
# index_comp += [add_am]
|
316
|
-
# obj._N += [obj._N[-1] + add_am]
|
317
365
|
parabolic_index = []
|
318
366
|
start = 0
|
319
|
-
# 1, 2 | 3
|
320
367
|
for i in range(len(index_comp)):
|
321
368
|
end = start + index_comp[i]
|
322
369
|
parabolic_index += list(range(start + 1, end))
|
@@ -325,9 +372,27 @@ class ParabolicQuantumDoubleSchubertAlgebraElement_basis(Basic):
|
|
325
372
|
obj._parabolic_index = parabolic_index
|
326
373
|
obj._otherlong = Permutation(list(range(obj._N[-1], 0, -1)))
|
327
374
|
obj._longest = obj._otherlong * longest_element(parabolic_index)
|
328
|
-
# obj._E[0] = obj._from_dict({(Permutation([]),utils.NoneVar): S.One})
|
329
375
|
return obj
|
330
376
|
|
377
|
+
@property
|
378
|
+
def symbol_elem_func(self):
|
379
|
+
def elem_func(p, k, varl1, varl2): # noqa: ARG001
|
380
|
+
if p == 0 and k >= 0:
|
381
|
+
return 1
|
382
|
+
if p < 0 or p > k:
|
383
|
+
return 0
|
384
|
+
return sympy.Add(*[(Symbol(f"e_{p - i}_{k}") if p - i > 0 else 1) * complete_sym_poly(i, k + 1 - p, [-v for v in varl2]) for i in range(p + 1)])
|
385
|
+
|
386
|
+
return elem_func
|
387
|
+
|
388
|
+
def elem_sym_subs(self, kk):
|
389
|
+
elems = []
|
390
|
+
elem_func = self.elem_sym
|
391
|
+
for k in range(1, kk + 1):
|
392
|
+
for p in range(1, k + 1):
|
393
|
+
elems += [(sympy.Symbol(f"e_{p}_{k}"), elem_func(p, k, self.genset[1:], utils.poly_ring(0)))]
|
394
|
+
return dict(elems)
|
395
|
+
|
331
396
|
@property
|
332
397
|
def parabolic_index(self):
|
333
398
|
return self._parabolic_index
|
@@ -379,59 +444,20 @@ class ParabolicQuantumDoubleSchubertAlgebraElement_basis(Basic):
|
|
379
444
|
# )
|
380
445
|
# return res
|
381
446
|
|
382
|
-
def elem_sym(self):
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
return ret
|
397
|
-
|
398
|
-
return elem_func
|
399
|
-
|
400
|
-
def boingle_elem_sym(self):
|
401
|
-
def elem_func(p, k, varl1, varl2):
|
402
|
-
if p == 0 and k >= 0:
|
403
|
-
return S.One
|
404
|
-
if p < 0 or p > k:
|
405
|
-
return S.Zero
|
406
|
-
# print(f"{p=} {k=}")
|
407
|
-
spoink = self._E[k][p]
|
408
|
-
# print(f"{spoink=}")
|
409
|
-
# for i in range(1,k - p + 1):
|
410
|
-
# spoink = -spoink.divdiff(i)
|
411
|
-
return sympify(sympify(spoink.as_polynomial()).xreplace({t[i]: varl2[i - 1] for i in range(1, len(varl2) + 1)})).xreplace({a[i]: varl1[i - 1] for i in range(1, len(varl1) + 1)})
|
412
|
-
# TEMP
|
413
|
-
# varl2 = utils.poly_ring(0)
|
414
|
-
# if p < 0 or p > k:
|
415
|
-
# return 0
|
416
|
-
# if p == 0 and k >= 0:
|
417
|
-
# return 1
|
418
|
-
# if k == self._N[1]:
|
419
|
-
# return elem_sym_poly(p, k, varl1, varl2)
|
420
|
-
# print(f"{p=} {k=} {self._N=}")
|
421
|
-
# ret = 0
|
422
|
-
# j = bisect_left(self._N, k)
|
423
|
-
# if j < len(self._N) and k == self._N[j]:
|
424
|
-
# ret = (-((-1) ** (self._n[j - 1]))) * q_var[j - 1] * elem_func(p - self._N[j] + self._N[j - 2], self._N[j - 2], varl1, varl2)
|
425
|
-
# #ret += elem_func(p, self._N[j-1], varl1, varl2)
|
426
|
-
# # print(f"{self._n[j-1]=}")
|
427
|
-
# for i in range(min(p+1,self._n[j-1]+1)):
|
428
|
-
# # print(f"{p=} {p - i=} {i=} {self._N[j-1]-1=} {self._N[j-1]-1-i=} {len(varl2)=}")
|
429
|
-
# ret += varl1[self._N[j] - 1 - i] * elem_func(p - i, self._N[j-1], varl1, varl2)
|
430
|
-
# else:
|
431
|
-
# # print("Bob jones")
|
432
|
-
# return ret
|
433
|
-
|
434
|
-
return elem_func
|
447
|
+
def elem_sym(self, p, k, varl1, varl2):
|
448
|
+
# print(f"{p=} {k=} {self._N=}")
|
449
|
+
if p < 0 or p > k:
|
450
|
+
return 0
|
451
|
+
if p == 0 and k >= 0:
|
452
|
+
return 1
|
453
|
+
if k <= self._N[1]:
|
454
|
+
return elem_sym_poly(p, k, varl1, varl2)
|
455
|
+
ret = 0
|
456
|
+
j = bisect_left(self._N, k)
|
457
|
+
if j < len(self._N) and k == self._N[j]:
|
458
|
+
ret = (-((-1) ** (self._n[j - 1]))) * q_var[j - 1] * self.elem_sym(p - self._N[j] + self._N[j - 2], self._N[j - 2], varl1, varl2)
|
459
|
+
ret += self.elem_sym(p, k - 1, varl1, varl2) + (varl1[k - 1] - varl2[k - p]) * self.elem_sym(p - 1, k - 1, varl1, varl2)
|
460
|
+
return ret
|
435
461
|
|
436
462
|
# def classical_elem(self, k, coeff_var):
|
437
463
|
# if k <= self._N[1]:
|
@@ -451,6 +477,7 @@ class ParabolicQuantumDoubleSchubertAlgebraElement_basis(Basic):
|
|
451
477
|
def process_coeff_dict(self, coeff_dict):
|
452
478
|
max_len = max(len(w) for w in coeff_dict)
|
453
479
|
parabolic_index = [*self._parabolic_index]
|
480
|
+
# print(f"bagels = {parabolic_index=} {type(self)=}")
|
454
481
|
# parabolic_index += list(range(parabolic_index[-1] + 2, max_len + 1))
|
455
482
|
if max_len > len(self._longest):
|
456
483
|
parabolic_index = []
|
@@ -587,7 +614,7 @@ class ParabolicQuantumDoubleSchubertAlgebraElement_basis(Basic):
|
|
587
614
|
# print(f"new longest = {longest=}")
|
588
615
|
else:
|
589
616
|
longest = self._longest
|
590
|
-
return schubpoly_from_elems(k[0], self.genset, utils.poly_ring(k[1]), elem_func=self.elem_sym
|
617
|
+
return schubpoly_from_elems(k[0], self.genset, utils.poly_ring(k[1]), elem_func=self.elem_sym, mumu=~longest) # yz.schubpoly_quantum(k[0], self.genset, utils.poly_ring(k[1]))
|
591
618
|
|
592
619
|
@cache
|
593
620
|
def cached_positive_product(self, u, v, va, vb):
|
@@ -596,11 +623,23 @@ class ParabolicQuantumDoubleSchubertAlgebraElement_basis(Basic):
|
|
596
623
|
|
597
624
|
@property
|
598
625
|
def double_mul(self):
|
599
|
-
|
626
|
+
from schubmult.schub_lib.quantum_double import _vars
|
627
|
+
|
628
|
+
def do_double_mul(perm_dict, v, var2=_vars.var2, var3=_vars.var3, q_var=_vars.q_var):
|
629
|
+
coeff_dict = yz.schubmult_q_double_fast(perm_dict, v, var2, var3, q_var)
|
630
|
+
return self.process_coeff_dict(coeff_dict)
|
631
|
+
|
632
|
+
return do_double_mul
|
600
633
|
|
601
634
|
@property
|
602
635
|
def single_mul(self):
|
603
|
-
|
636
|
+
from schubmult.schub_lib.quantum_double import _vars
|
637
|
+
|
638
|
+
def do_single_mul(perm_dict, v, q_var=_vars.q_var):
|
639
|
+
coeff_dict = py.schubmult_q_fast(perm_dict, v, q_var)
|
640
|
+
return self.process_coeff_dict(coeff_dict)
|
641
|
+
|
642
|
+
return do_single_mul
|
604
643
|
|
605
644
|
@property
|
606
645
|
def mult_poly_single(self):
|
@@ -662,127 +701,52 @@ def QPDSx(*args):
|
|
662
701
|
return make_parabolic_quantum_basis(args)
|
663
702
|
|
664
703
|
|
665
|
-
|
666
|
-
|
667
|
-
|
668
|
-
|
669
|
-
|
670
|
-
|
671
|
-
|
672
|
-
|
673
|
-
|
674
|
-
|
675
|
-
|
676
|
-
|
677
|
-
#
|
678
|
-
|
679
|
-
|
680
|
-
|
681
|
-
|
682
|
-
|
683
|
-
|
684
|
-
|
685
|
-
|
686
|
-
|
687
|
-
|
688
|
-
|
689
|
-
|
690
|
-
|
691
|
-
|
692
|
-
|
693
|
-
|
694
|
-
|
695
|
-
|
696
|
-
|
697
|
-
|
698
|
-
|
699
|
-
|
700
|
-
|
701
|
-
|
702
|
-
|
703
|
-
|
704
|
-
|
705
|
-
|
706
|
-
|
707
|
-
|
708
|
-
|
709
|
-
|
710
|
-
|
711
|
-
|
712
|
-
|
713
|
-
|
714
|
-
# is_infinite
|
715
|
-
# is_integer
|
716
|
-
# is_irrational
|
717
|
-
# is_meromorphic
|
718
|
-
# is_negative
|
719
|
-
# is_noninteger
|
720
|
-
# is_nonnegative
|
721
|
-
# is_nonpositive
|
722
|
-
# is_nonzero
|
723
|
-
# is_number
|
724
|
-
# is_odd
|
725
|
-
# is_polar
|
726
|
-
# is_polynomial
|
727
|
-
# is_positive
|
728
|
-
# is_prime
|
729
|
-
# is_rational
|
730
|
-
# is_rational_function
|
731
|
-
# is_real
|
732
|
-
# is_scalar
|
733
|
-
# is_symbol
|
734
|
-
# is_transcendental
|
735
|
-
# is_zero
|
736
|
-
# is_polynomial = True
|
737
|
-
# is_Symbol = True
|
738
|
-
|
739
|
-
|
740
|
-
# class SchubAdd(QuantumDoubleSchubertAlgebraElement, Add):
|
741
|
-
# is_Add = True
|
742
|
-
|
743
|
-
# def __new__(cls, *args, evaluate=True, _sympify=True):
|
744
|
-
# obj = Add.__new__(cls, *args, evaluate=evaluate, _sympify=_sympify)
|
745
|
-
# if evaluate:
|
746
|
-
# return obj.doit()
|
747
|
-
# return obj
|
748
|
-
|
749
|
-
# def doit(self):
|
750
|
-
# ret = self.args[0]
|
751
|
-
# for arg in self.args[1:]:
|
752
|
-
# if arg.is_Add or arg.is_Mul:
|
753
|
-
# arg = arg.doit()
|
754
|
-
# ret = _do_schub_add(ret, arg)
|
755
|
-
# return ret
|
756
|
-
|
757
|
-
# # def _sympystr(self, printer):
|
758
|
-
# # return _def_printer._print(f"SchubAdd({self.args}")
|
759
|
-
|
760
|
-
|
761
|
-
# class SchubMul(QuantumDoubleSchubertAlgebraElement, Mul):
|
762
|
-
# is_Mul = True
|
763
|
-
|
764
|
-
# def __new__(cls, *args, evaluate=True, _sympify=True):
|
765
|
-
# if len(args) == 0:
|
766
|
-
# return 1
|
767
|
-
# # args, a, b = Mul.flatten(list(args))
|
768
|
-
# # if len(args) == 0:
|
769
|
-
# # return 1
|
770
|
-
# obj = Mul.__new__(cls, *args, evaluate=evaluate, _sympify=_sympify)
|
771
|
-
|
772
|
-
# if evaluate:
|
773
|
-
# return obj.doit()
|
774
|
-
# return obj
|
775
|
-
|
776
|
-
# def doit(self):
|
777
|
-
# ret = self.args[0]
|
778
|
-
# for arg in self.args[1:]:
|
779
|
-
# if arg.is_Add or arg.is_Mul:
|
780
|
-
# arg = arg.doit()
|
781
|
-
# ret = _do_schub_mul(ret, arg)
|
782
|
-
# return ret
|
783
|
-
|
784
|
-
|
785
|
-
# Basic._constructor_postprocessor_mapping[DoubleSchubertAlgebraElement] = {
|
786
|
-
# "Mul": [get_postprocessor(Mul)],
|
787
|
-
# "Add": [get_postprocessor(Add)],
|
788
|
-
# }
|
704
|
+
class ParabolicQuantumSchubertAlgebraElement_basis(ParabolicQuantumDoubleSchubertAlgebraElement_basis):
|
705
|
+
def __new__(cls, genset, index_comp):
|
706
|
+
return ParabolicQuantumDoubleSchubertAlgebraElement_basis.__new__(cls, genset, index_comp)
|
707
|
+
|
708
|
+
def __hash__(self):
|
709
|
+
return hash((*self.args, utils.NoneVar))
|
710
|
+
|
711
|
+
def _from_single_dict(self, _dict):
|
712
|
+
return ParabolicQuantumDoubleSchubertAlgebraElement({(k, utils.NoneVar): v for k, v in _dict.items()}, self)
|
713
|
+
|
714
|
+
def __call__(self, x):
|
715
|
+
genset = self.genset
|
716
|
+
# logger.debug(f"{x=} {type(x)=}")
|
717
|
+
if not genset:
|
718
|
+
genset = self.genset
|
719
|
+
if isinstance(x, list) or isinstance(x, tuple):
|
720
|
+
perm = Permutation(x)
|
721
|
+
if not is_parabolic(perm, self.parabolic_index):
|
722
|
+
raise ValueError(f"Permutation must be parabolic: {perm} is not")
|
723
|
+
elem = self._from_dict({(perm, utils.NoneVar): 1})
|
724
|
+
elif isinstance(x, Permutation):
|
725
|
+
if not is_parabolic(x, self.parabolic_index):
|
726
|
+
raise ValueError(f"Permutation must be parabolic: {x} is not")
|
727
|
+
elem = self._from_dict({(x, utils.NoneVar): 1})
|
728
|
+
elif isinstance(x, ParabolicQuantumDoubleSchubertAlgebraElement):
|
729
|
+
return x
|
730
|
+
else:
|
731
|
+
dct = self.classical_basis(x, utils.NoneVar)
|
732
|
+
elem = 0
|
733
|
+
if not isinstance(dct, spr.BasisSchubertAlgebraElement):
|
734
|
+
return dct
|
735
|
+
try:
|
736
|
+
for k, v in dct.coeff_dict.items():
|
737
|
+
if elem == 0:
|
738
|
+
elem = v * self.classical_in_basis(k)
|
739
|
+
else:
|
740
|
+
elem += v * self.classical_in_basis(k)
|
741
|
+
except ValueError:
|
742
|
+
raise ValueError(f"Could not convert {x=} to quantum parabolic")
|
743
|
+
return elem
|
744
|
+
|
745
|
+
|
746
|
+
def make_single_parabolic_quantum_basis(index_comp):
|
747
|
+
return ParabolicQuantumSchubertAlgebraElement_basis(GeneratingSet("x"), index_comp)
|
748
|
+
|
749
|
+
|
750
|
+
@cache
|
751
|
+
def QPSx(*args):
|
752
|
+
return make_single_parabolic_quantum_basis(args)
|
@@ -17,7 +17,7 @@ import schubmult.schub_lib.double as yz
|
|
17
17
|
import schubmult.schub_lib.schub_lib as schub_lib
|
18
18
|
import schubmult.schub_lib.single as py
|
19
19
|
from schubmult.perm_lib import Permutation, inv
|
20
|
-
from schubmult.poly_lib.poly_lib import elem_sym_poly, xreplace_genvars
|
20
|
+
from schubmult.poly_lib.poly_lib import complete_sym_poly, elem_sym_poly, xreplace_genvars
|
21
21
|
from schubmult.poly_lib.schub_poly import schubpoly_classical_from_elems, schubpoly_from_elems
|
22
22
|
from schubmult.poly_lib.variables import CustomGeneratingSet, GeneratingSet, GeneratingSet_base, MaskedGeneratingSet
|
23
23
|
from schubmult.utils.logging import get_logger
|
@@ -157,7 +157,6 @@ class BasisSchubertAlgebraElement(Expr):
|
|
157
157
|
obj.precedence = 1000
|
158
158
|
else:
|
159
159
|
obj.precedence = 40
|
160
|
-
# obj.prune()
|
161
160
|
obj._basis = basis
|
162
161
|
return obj
|
163
162
|
|
@@ -198,22 +197,35 @@ class BasisSchubertAlgebraElement(Expr):
|
|
198
197
|
else:
|
199
198
|
dict2 = self.basis.mult_poly_double({k[0]: v}, poly, self.genset, utils.poly_ring(k[1]))
|
200
199
|
res_dict2 = add_perm_dict(res_dict2, {(k2, k[1]): v for k2, v in dict2.items()})
|
201
|
-
logger.debug(f"{res_dict2=}")
|
200
|
+
# logger.debug(f"{res_dict2=}")
|
202
201
|
return self.basis._from_dict(res_dict2)
|
203
202
|
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
203
|
+
def in_SEM_basis(self):
|
204
|
+
result = S.Zero
|
205
|
+
for k, v in self.coeff_dict.items():
|
206
|
+
result += v * schubpoly_from_elems(k[0], self.genset, utils.poly_ring(k[1]), elem_func=self.basis.symbol_elem_func)
|
207
|
+
return result
|
208
|
+
|
209
|
+
def in_classical_EM_basis(self):
|
210
|
+
result = S.Zero
|
211
|
+
for k, v in self.coeff_dict.items():
|
212
|
+
result += v * schubpoly_classical_from_elems(k[0], self.genset, utils.poly_ring(k[1]), elem_func=self.basis.symbol_elem_func)
|
213
|
+
return result
|
213
214
|
|
214
215
|
def _sympystr(self, printer):
|
216
|
+
if printer.order in ("old", "none"): # needed to avoid infinite recursion
|
217
|
+
return printer._print_Add(self, order="lex")
|
218
|
+
return printer._print_Add(self)
|
219
|
+
|
220
|
+
def _pretty(self, printer):
|
221
|
+
if printer.order in ("old", "none"): # needed to avoid infinite recursion
|
222
|
+
return printer._print_Add(self, order="lex")
|
223
|
+
return printer._print_Add(self)
|
224
|
+
|
225
|
+
def _latex(self, printer):
|
226
|
+
if printer.order in ("old", "none"): # needed to avoid infinite recursion
|
227
|
+
return printer._print_Add(self, order="lex")
|
215
228
|
return printer._print_Add(self)
|
216
|
-
# return self._cached_sympystr(printer)
|
217
229
|
|
218
230
|
def as_terms(self):
|
219
231
|
if len(self.coeff_dict.keys()) == 0:
|
@@ -577,27 +589,14 @@ class DoubleSchubertAlgebraElement(BasisSchubertAlgebraElement):
|
|
577
589
|
# return self.doit().expand()
|
578
590
|
# return expand(Add(*[v * schubpoly(k[0], self.genset, utils.poly_ring(k[1])) for k, v in self.coeff_dict.items()]))
|
579
591
|
|
580
|
-
def in_SEM_basis(self):
|
581
|
-
result = S.Zero
|
582
|
-
for k, v in self.coeff_dict.items():
|
583
|
-
result += v * schubpoly_from_elems(k[0], self.genset, utils.poly_ring(k[1]), elem_func=self.basis.symbol_elem_func)
|
584
|
-
# print(f"{result=}")
|
585
|
-
# gens = []
|
586
|
-
# for k in range(1, 10):
|
587
|
-
# gens += [sympy.Symbol(f"e_{p}_{k}") for p in range(1,k+1)]
|
588
|
-
# #print(f"{gens=}")
|
589
|
-
# ply = sympy.poly(sympy.sympify(expand(result)), *gens)
|
590
|
-
# floss = 0
|
591
|
-
# for m, c in ply.as_dict().items():
|
592
|
-
# floss += c * sympy.prod([gens[i]**m[i] for i in range(len(m))])
|
593
|
-
# return floss
|
594
|
-
return result
|
595
|
-
|
596
592
|
@cached_property
|
597
593
|
def max_gens(self):
|
598
594
|
return max([max(k[0].descents()) for k in self.coeff_dict.keys()])
|
599
595
|
|
600
596
|
|
597
|
+
_pretty_schub_char = "𝔖" # noqa: RUF001
|
598
|
+
|
599
|
+
|
601
600
|
# Atomic Schubert polynomial
|
602
601
|
class DSchubPoly(DoubleSchubertAlgebraElement):
|
603
602
|
is_Atom = True
|
@@ -641,6 +640,22 @@ class DSchubPoly(DoubleSchubertAlgebraElement):
|
|
641
640
|
return printer.doprint(f"S{self.genset.label}({printer.doprint(self._key[0])})")
|
642
641
|
return printer.doprint(f"DS{self.genset.label}({printer.doprint(self._key[0])}, {_varstr(self._key[1])})")
|
643
642
|
|
643
|
+
def _pretty(self, printer):
|
644
|
+
if self._key[0] == Permutation([]):
|
645
|
+
return printer._print(1)
|
646
|
+
subscript = printer._print(int("".join([str(i) for i in self._key[0]])))
|
647
|
+
if self._key[1] == 0 or self._key[1] == utils.NoneVar:
|
648
|
+
return printer._print_Function(sympy.Function(f"{_pretty_schub_char}_{subscript}")(sympy.Symbol(self.genset.label)))
|
649
|
+
return printer._print_Function(sympy.Function(f"{_pretty_schub_char}_{subscript}")(sympy.Symbol(f"{self.genset.label}; {self._key[1]}")))
|
650
|
+
|
651
|
+
def _latex(self, printer):
|
652
|
+
if self._key[0] == Permutation([]):
|
653
|
+
return printer._print(1)
|
654
|
+
subscript = printer._print(self._key[0])
|
655
|
+
if self._key[1] == 0 or self._key[1] == utils.NoneVar:
|
656
|
+
return printer._print_Function(sympy.Function("\\mathfrak{S}" + f"_{'{' + subscript + '}'}")(sympy.Symbol(self.genset.label)))
|
657
|
+
return printer._print_Function(sympy.Function("\\mathfrak{S}" + f"_{'{' + subscript + '}'}")(sympy.Symbol(f"{self.genset.label}; {self._key[1]}")))
|
658
|
+
|
644
659
|
|
645
660
|
# def elem_func(p, k, vx, vy):
|
646
661
|
# return DSx(elem_func_q(p, k, vx, vy), "y")
|
@@ -655,15 +670,22 @@ class DoubleSchubertAlgebraElement_basis(Basic):
|
|
655
670
|
|
656
671
|
@property
|
657
672
|
def symbol_elem_func(self):
|
658
|
-
def elem_func(p, k, varl1, varl2):
|
673
|
+
def elem_func(p, k, varl1, varl2): # noqa: ARG001
|
659
674
|
if p == 0 and k >= 0:
|
660
675
|
return 1
|
661
676
|
if p < 0 or p > k:
|
662
677
|
return 0
|
663
|
-
return sympy.Add(*[(Symbol(f"e_{p - i}_{k}") if p - i > 0 else 1) *
|
678
|
+
return sympy.Add(*[(Symbol(f"e_{p - i}_{k}") if p - i > 0 else 1) * complete_sym_poly(i, k + 1 - p, [-v for v in varl2]) for i in range(p + 1)])
|
664
679
|
|
665
680
|
return elem_func
|
666
681
|
|
682
|
+
def elem_sym_subs(self, kk):
|
683
|
+
elems = []
|
684
|
+
for k in range(1, kk + 1):
|
685
|
+
for p in range(1, k + 1):
|
686
|
+
elems += [(sympy.Symbol(f"e_{p}_{k}"), elem_sym_poly(p, k, self.genset[1:], utils.poly_ring(0)))]
|
687
|
+
return dict(elems)
|
688
|
+
|
667
689
|
# def in_SEM_basis(self, elem):
|
668
690
|
# return
|
669
691
|
|
@@ -754,7 +776,7 @@ class DoubleSchubertAlgebraElement_basis(Basic):
|
|
754
776
|
xsm,
|
755
777
|
ysm - p2,
|
756
778
|
)
|
757
|
-
logger.debug(f"{res=}")
|
779
|
+
# logger.debug(f"{res=}")
|
758
780
|
return res
|
759
781
|
|
760
782
|
return elem_func
|
@@ -830,7 +852,7 @@ class DoubleSchubertAlgebraElement_basis(Basic):
|
|
830
852
|
# print("splinterfish")
|
831
853
|
result = yz.mult_poly_double({Permutation([]): 1}, x, genset, utils.poly_ring(cv))
|
832
854
|
elem = self._from_dict({(k, cv): v for k, v in result.items()})
|
833
|
-
logger.debug(f"Returning {elem=}")
|
855
|
+
# logger.debug(f"Returning {elem=}")
|
834
856
|
return elem
|
835
857
|
|
836
858
|
|
@@ -962,6 +984,9 @@ class SchubertAlgebraElement_basis(DoubleSchubertAlgebraElement_basis):
|
|
962
984
|
def __new__(cls, genset):
|
963
985
|
return DoubleSchubertAlgebraElement_basis.__new__(cls, genset)
|
964
986
|
|
987
|
+
def __hash__(self):
|
988
|
+
return hash((*self.args, utils.NoneVar))
|
989
|
+
|
965
990
|
def _from_single_dict(self, _dict):
|
966
991
|
return DoubleSchubertAlgebraElement({(k, utils.NoneVar): v for k, v in _dict.items()}, self)
|
967
992
|
|
@@ -94,9 +94,9 @@ def single_variable(coeff_dict, varnum, var2=_vars.var2, q_var=_vars.q_var):
|
|
94
94
|
def mult_poly_q_double(coeff_dict, poly, var_x=_vars.var1, var_y=_vars.var2, q_var=_vars.q_var):
|
95
95
|
if not isinstance(var_x, GeneratingSet_base):
|
96
96
|
var_x = CustomGeneratingSet(var_x)
|
97
|
-
logger.debug(f"{poly=} {list(var_x)=}")
|
97
|
+
# logger.debug(f"{poly=} {list(var_x)=}")
|
98
98
|
if var_x.index(poly) != -1:
|
99
|
-
logger.debug(f"yay {var_x.index(poly)=}")
|
99
|
+
# logger.debug(f"yay {var_x.index(poly)=}")
|
100
100
|
return single_variable(coeff_dict, var_x.index(poly), var_y, q_var)
|
101
101
|
if isinstance(poly, Mul):
|
102
102
|
ret = coeff_dict
|
schubmult/utils/argparse.py
CHANGED
@@ -3,7 +3,7 @@ from argparse import SUPPRESS, ArgumentParser, RawDescriptionHelpFormatter
|
|
3
3
|
|
4
4
|
import sympy
|
5
5
|
|
6
|
-
# from sympy import
|
6
|
+
# from sympy import init_printing
|
7
7
|
from schubmult.utils.logging import init_logging
|
8
8
|
|
9
9
|
# Indexed._sympystr = lambda x, p: f"{p.doprint(x.args[0])}_{x.args[1]}"
|
@@ -215,17 +215,17 @@ def schub_argparse(prog_name, description, argv, quantum=False, yz=False):
|
|
215
215
|
|
216
216
|
if args.disp_mode == "latex":
|
217
217
|
formatter = ( # noqa: E731
|
218
|
-
lambda bob, width=None: sympy.latex(_sympy(bob)).replace("\\left", "").replace("\\right", "")
|
218
|
+
lambda bob, width=None: sympy.latex(_sympy(bob), order="old").replace("\\left", "").replace("\\right", "")
|
219
219
|
)
|
220
220
|
elif args.disp_mode == "pretty":
|
221
221
|
# pretty we need to keep centered
|
222
222
|
formatter = ( # noqa: E731
|
223
|
-
lambda bob, width=None: sympy.pretty(_sympy(bob))
|
223
|
+
lambda bob, width=None: sympy.pretty(_sympy(bob), order="old")
|
224
224
|
if width is None
|
225
225
|
else sympy.pretty(_sympy(bob), order="rev-lex" if args.same else "none", use_unicode=False).replace("\n", "\n" + " ".join(["" for i in range(width)]))
|
226
226
|
)
|
227
227
|
elif args.disp_mode == "basic":
|
228
|
-
formatter = lambda bob, width=None: sympy.sstr(_sympy(bob)) # , order="rev-lex" if args.same else "none") # noqa: E731
|
228
|
+
formatter = lambda bob, width=None: sympy.sstr(_sympy(bob), order="old") # , order="rev-lex" if args.same else "none") # noqa: E731
|
229
229
|
elif args.disp_mode == "raw":
|
230
230
|
formatter = None
|
231
231
|
init_logging(debug=args.debug)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: schubmult
|
3
|
-
Version: 3.0.
|
3
|
+
Version: 3.0.1
|
4
4
|
Summary: Package for algebraic computation with single, double, and quantum Schubert polynomials
|
5
5
|
Author-email: Matt Samuel <schubmult@gmail.com>
|
6
6
|
Maintainer-email: Matt Samuel <schubmult@gmail.com>
|
@@ -1,12 +1,12 @@
|
|
1
|
-
schubmult/__init__.py,sha256=
|
2
|
-
schubmult/perm_lib.py,sha256=
|
1
|
+
schubmult/__init__.py,sha256=SqufaRbFLZue-oOMqDUpEVJagcTJoAi5XY5Az_YC1bw,2385
|
2
|
+
schubmult/perm_lib.py,sha256=2yUV3nquNnGPLpAJJBCg7SFF-y-eP0zcCxC9hy6keDg,10431
|
3
3
|
schubmult/poly_lib/__init__.py,sha256=DUA70oCWv64lqhezrpKgA6813Dp5LTM1bkMrpOoqjTU,674
|
4
|
-
schubmult/poly_lib/poly_lib.py,sha256=
|
4
|
+
schubmult/poly_lib/poly_lib.py,sha256=ZgZWY9Q2TBdk5lH2Jtg7LJO-WETtVcYfr8aSpaEKdMU,7839
|
5
5
|
schubmult/poly_lib/schub_poly.py,sha256=_GXApXSbmlF0neSZOY9fCFXxSmYJEoHv_PvJJzIhy5E,4586
|
6
6
|
schubmult/poly_lib/variables.py,sha256=cnR9Kvzbh7LA0Mvi292h2eMW7d3s2GU9DKvP3M44HNE,6005
|
7
|
-
schubmult/rings/__init__.py,sha256=
|
8
|
-
schubmult/rings/_quantum_schubert_polynomial_ring.py,sha256=
|
9
|
-
schubmult/rings/_schubert_polynomial_ring.py,sha256=
|
7
|
+
schubmult/rings/__init__.py,sha256=Xaf8JB64C0tjlb_F8WQqHFGp3MM5LteFgkxNETImMiU,630
|
8
|
+
schubmult/rings/_quantum_schubert_polynomial_ring.py,sha256=H71XoK96-Bfel-uel5BPQLIL_Kazjjej3StgXeDBAd0,29951
|
9
|
+
schubmult/rings/_schubert_polynomial_ring.py,sha256=mokenMrZJq0nrzV8xZ23xrIQJTYpFdbUCCct1vpIbCE,39338
|
10
10
|
schubmult/rings/_tensor_schub_ring.py,sha256=-ahCinjsAyK6EvfPD8T4nB4KJ8syISEbtYL-n34q16I,3952
|
11
11
|
schubmult/rings/_utils.py,sha256=hCB9sMJfgINLvqbJbpGd5bnGQL3sb6G1nr1Dr5O-qwM,1787
|
12
12
|
schubmult/sage/__init__.py,sha256=bgRIEllThsrH0kYJnEAR_cirTGGfdPojOUajbZjJhq4,906
|
@@ -16,7 +16,7 @@ schubmult/sage/_indexing.py,sha256=L6ShyDI7ceMSga8jel5mzAWBxfmsXC9uJZYpZ_WrnOI,1
|
|
16
16
|
schubmult/schub_lib/__init__.py,sha256=kFtT2ghMrgFACzJSraeJYGcvGlb3uXt_GJIl36tmOw8,1118
|
17
17
|
schubmult/schub_lib/double.py,sha256=x7l84DJ4e0VW90z7GbdRNpF7FUcKGPXhXWOxBLXBLh0,51663
|
18
18
|
schubmult/schub_lib/quantum.py,sha256=RcjpAtyxVndo-kR-H31gjtmjaLNq2PWSglvw6LnKOR0,9998
|
19
|
-
schubmult/schub_lib/quantum_double.py,sha256=
|
19
|
+
schubmult/schub_lib/quantum_double.py,sha256=Ex4Azr-aPGLajFcuOFFNCBKYrDt7fcp7lc_B9SOhGbE,36774
|
20
20
|
schubmult/schub_lib/schub_lib.py,sha256=Sca_PAOD0ABEyixpgYpFxPxfCPZnKchFGeKUZIstIyc,22815
|
21
21
|
schubmult/schub_lib/single.py,sha256=3ZJzC9dSFc6Ux_DcuSKekwK7D9ZyrCd5OUEiIKW8LZk,5210
|
22
22
|
schubmult/schub_lib/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -28,14 +28,14 @@ schubmult/scripts/schubmult_py.py,sha256=ARQn4Ucl5n8dz_q77gjkrazVSDjUMQHkx5EK7Sx
|
|
28
28
|
schubmult/scripts/schubmult_q.py,sha256=ntzcVmFjRbXGKTddkhdNVpxcMTTtK4CeOI4BeIVjePQ,3287
|
29
29
|
schubmult/scripts/schubmult_q_double.py,sha256=SANQEvlA5XJUWUh8sd_ObwMOEmct0GLSMbjDAvUTOB4,6086
|
30
30
|
schubmult/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
31
|
-
schubmult/utils/argparse.py,sha256=
|
31
|
+
schubmult/utils/argparse.py,sha256=ZY85ZR-h8TOUQuzTVlvRfh07QQ032B3c649rLYZHrp8,7205
|
32
32
|
schubmult/utils/logging.py,sha256=h-CgHSl7kPscs9VKp0WjJ4fcrtPplnJYDyrL2klPJJ4,503
|
33
33
|
schubmult/utils/parsing.py,sha256=ygkkLqZ1KsNQBPeiF6gkEJYMwjmkqkwfGuIP0Wtawnk,599
|
34
34
|
schubmult/utils/perm_utils.py,sha256=mf5VOwLREn_UQWMa67lOsmmwHMJClt_rjsVPIE2yE9w,2716
|
35
35
|
schubmult/utils/test_utils.py,sha256=vEIuAkb-mFEs1gow9E76JrRbcEDvxvsTDzp4pPUoT5w,1860
|
36
|
-
schubmult-3.0.
|
37
|
-
schubmult-3.0.
|
38
|
-
schubmult-3.0.
|
39
|
-
schubmult-3.0.
|
40
|
-
schubmult-3.0.
|
41
|
-
schubmult-3.0.
|
36
|
+
schubmult-3.0.1.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
37
|
+
schubmult-3.0.1.dist-info/METADATA,sha256=ZOHi7RDDLffv5Xnq9FUQfua55DxflmWoNB3O6CsjVPk,77074
|
38
|
+
schubmult-3.0.1.dist-info/WHEEL,sha256=pxyMxgL8-pra_rKaQ4drOZAegBVuX-G_4nRHjjgWbmo,91
|
39
|
+
schubmult-3.0.1.dist-info/entry_points.txt,sha256=9iaFSlTd5xZf52635CKaBqmgJTY_NZLkF6AMnL_T84c,240
|
40
|
+
schubmult-3.0.1.dist-info/top_level.txt,sha256=IkujyjRu8lbpoSTdPE8DmMJ9sbyXHpo9L0RHL7nOzM0,10
|
41
|
+
schubmult-3.0.1.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|