schubmult 2.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 (36) hide show
  1. schubmult/__init__.py +1 -0
  2. schubmult/_base_argparse.py +174 -0
  3. schubmult/perm_lib.py +999 -0
  4. schubmult/sage_integration/__init__.py +25 -0
  5. schubmult/sage_integration/_fast_double_schubert_polynomial_ring.py +528 -0
  6. schubmult/sage_integration/_fast_schubert_polynomial_ring.py +356 -0
  7. schubmult/sage_integration/_indexing.py +44 -0
  8. schubmult/schubmult_double/__init__.py +18 -0
  9. schubmult/schubmult_double/__main__.py +5 -0
  10. schubmult/schubmult_double/_funcs.py +1590 -0
  11. schubmult/schubmult_double/_script.py +407 -0
  12. schubmult/schubmult_double/_vars.py +16 -0
  13. schubmult/schubmult_py/__init__.py +10 -0
  14. schubmult/schubmult_py/__main__.py +5 -0
  15. schubmult/schubmult_py/_funcs.py +111 -0
  16. schubmult/schubmult_py/_script.py +115 -0
  17. schubmult/schubmult_py/_vars.py +3 -0
  18. schubmult/schubmult_q/__init__.py +12 -0
  19. schubmult/schubmult_q/__main__.py +5 -0
  20. schubmult/schubmult_q/_funcs.py +304 -0
  21. schubmult/schubmult_q/_script.py +157 -0
  22. schubmult/schubmult_q/_vars.py +18 -0
  23. schubmult/schubmult_q_double/__init__.py +14 -0
  24. schubmult/schubmult_q_double/__main__.py +5 -0
  25. schubmult/schubmult_q_double/_funcs.py +507 -0
  26. schubmult/schubmult_q_double/_script.py +337 -0
  27. schubmult/schubmult_q_double/_vars.py +21 -0
  28. schubmult-2.0.0.dist-info/METADATA +455 -0
  29. schubmult-2.0.0.dist-info/RECORD +36 -0
  30. schubmult-2.0.0.dist-info/WHEEL +5 -0
  31. schubmult-2.0.0.dist-info/entry_points.txt +5 -0
  32. schubmult-2.0.0.dist-info/licenses/LICENSE +674 -0
  33. schubmult-2.0.0.dist-info/top_level.txt +2 -0
  34. tests/__init__.py +0 -0
  35. tests/test_fast_double_schubert.py +145 -0
  36. tests/test_fast_schubert.py +38 -0
schubmult/__init__.py ADDED
@@ -0,0 +1 @@
1
+ __version__ = "2.0.0"
@@ -0,0 +1,174 @@
1
+ from argparse import ArgumentParser, SUPPRESS, RawDescriptionHelpFormatter
2
+
3
+
4
+ def schub_argparse(prog_name, description, quantum=False, yz=False):
5
+ parser = ArgumentParser(
6
+ prog=prog_name,
7
+ description=description,
8
+ epilog=f"""Example:
9
+ {prog_name} 5 1 7 3 2 6 4 - 2 1 6 3 5 4 {"" if not yz else "[ --display-positive]"}
10
+ or equivalently
11
+ {prog_name} --code 4 0 4 1 0 1 - 1 0 3 0 1 {"" if not yz else "[ --display-positive]"}
12
+ {" or alternatively" if not quantum else ""}
13
+ {prog_name if not quantum else ""} {"--coprod --code 2 0 3 0 1 - 2 4 " if not quantum else ""} {"" if not yz or quantum else "[ --display-positive]"}
14
+ """,
15
+ formatter_class=RawDescriptionHelpFormatter,
16
+ )
17
+
18
+ parser.add_argument(
19
+ "perms",
20
+ nargs="+",
21
+ action="append",
22
+ help="Space-delimited permutations separated by hyphens, e. g. 3 4 1 2 - 5 1 2 4 3",
23
+ metavar="hyphen-separated list of perms",
24
+ )
25
+ parser.add_argument("-", nargs="+", action="append", dest="perms", help=SUPPRESS)
26
+
27
+ parser.add_argument(
28
+ "-np",
29
+ "--no-print",
30
+ action="store_false",
31
+ default=True,
32
+ dest="pr",
33
+ help="Compute the result but do not print it",
34
+ )
35
+
36
+ parser.add_argument(
37
+ "--code",
38
+ action="store_true",
39
+ default=False,
40
+ dest="ascode",
41
+ help="Permutations represented by the Lehmer code",
42
+ )
43
+
44
+ parser.add_argument(
45
+ "--mult",
46
+ nargs="+",
47
+ required=False,
48
+ default=None,
49
+ help="Some additional terms in the ring to multiply by",
50
+ )
51
+
52
+ if not quantum:
53
+ parser.add_argument(
54
+ "--coprod",
55
+ action="store_true",
56
+ default=False,
57
+ help="Compute the coproduct (different syntax: one permutation, then a hyphen, the variable index positions to split on)",
58
+ )
59
+
60
+ if yz:
61
+ parser.add_argument(
62
+ "--display-positive",
63
+ action="store_true",
64
+ default=False,
65
+ dest="display_positive",
66
+ help="Display the result in terms of the positive roots, or if mixed variable attempt to display the result as a positive algebraic combination of terms of the form y_i - z_j",
67
+ )
68
+
69
+ parser.add_argument(
70
+ "--optimizer-message",
71
+ action="store_true",
72
+ default=False,
73
+ dest="msg",
74
+ help="Display debug output during integer optimization for --display-positive",
75
+ )
76
+
77
+ parser.add_argument(
78
+ "--down", action="store_true", default=False, help="Reverse multiplication"
79
+ )
80
+
81
+ parser.add_argument(
82
+ "-nc",
83
+ "--no-check",
84
+ action="store_false",
85
+ default=True,
86
+ dest="check",
87
+ help="Do not check if positive result matches the original",
88
+ )
89
+
90
+ parser.add_argument(
91
+ "--mixed-var",
92
+ action="store_false",
93
+ dest="same",
94
+ help="Used mixed variables y and z",
95
+ )
96
+
97
+ parser.add_argument(
98
+ "--expand",
99
+ action="store_true",
100
+ default=False,
101
+ dest="expa",
102
+ help="Expand the output rather than leaving it as originally computed (slow)",
103
+ )
104
+
105
+ if quantum:
106
+ parser.add_argument(
107
+ "--parabolic",
108
+ nargs="+",
109
+ required=False,
110
+ default=[],
111
+ help="Generators of the parabolic subgroup to compute quantum coeffs for",
112
+ )
113
+
114
+ parser.add_argument(
115
+ "--basic-pieri",
116
+ action="store_true",
117
+ default=False,
118
+ dest="slow",
119
+ help="Do not apply conjectural computation optimization to quantum",
120
+ )
121
+ if yz:
122
+ parser.add_argument(
123
+ "--nil-hecke",
124
+ type=int,
125
+ required=False,
126
+ default=None,
127
+ dest="nilhecke",
128
+ metavar="N",
129
+ help="Substitute up to N of Fomin-Gelfand-Postnikov commuting difference operators",
130
+ )
131
+
132
+ parser.add_argument(
133
+ "--nil-hecke-apply",
134
+ type=int,
135
+ required=False,
136
+ default=None,
137
+ dest="nilhecke_apply",
138
+ metavar="N",
139
+ help="Substitute commuting difference operators for perm1, then apply to Schub indexed by perm2",
140
+ )
141
+
142
+ parser.add_argument(
143
+ "--display-mode",
144
+ type=str,
145
+ required=False,
146
+ choices=["basic", "pretty", "latex"],
147
+ default="basic",
148
+ dest="disp_mode",
149
+ help="Method of displaying the output. Default basic",
150
+ )
151
+
152
+ args = parser.parse_args()
153
+ args.mulstring = ""
154
+
155
+ if args.mult is not None:
156
+ args.mulstring = " ".join(args.mult)
157
+ args.mult = True
158
+
159
+ for perm in args.perms:
160
+ try:
161
+ for i in range(len(perm)):
162
+ perm[i] = int(perm[i])
163
+ except Exception as e:
164
+ print("Permutations must have integer values")
165
+ raise e
166
+ import sympy
167
+
168
+ formatter = lambda bob: str(bob) # noqa: E731
169
+ if args.disp_mode == "latex":
170
+ formatter = lambda bob: sympy.latex(sympy.sympify(bob)).replace("\\left", "").replace("\\right", "") # noqa: E731
171
+ elif args.disp_mode == "pretty":
172
+ formatter = lambda bob: sympy.pretty(sympy.sympify(bob)) # noqa: E731
173
+
174
+ return args, formatter