triples 0.1.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 (210) hide show
  1. triples/__init__.py +15 -0
  2. triples/benchmarks/__init__.py +0 -0
  3. triples/benchmarks/problems/__init__.py +18 -0
  4. triples/benchmarks/problems/books/__init__.py +7 -0
  5. triples/benchmarks/problems/books/vasile.py +3209 -0
  6. triples/benchmarks/problems/contests/__init__.py +8 -0
  7. triples/benchmarks/problems/contests/chn.py +995 -0
  8. triples/benchmarks/problems/contests/imo.py +405 -0
  9. triples/benchmarks/problems/problem_set.py +84 -0
  10. triples/benchmarks/run_benchmark.py +190 -0
  11. triples/core/__init__.py +45 -0
  12. triples/core/complexity.py +59 -0
  13. triples/core/dispatch.py +239 -0
  14. triples/core/linsos/__init__.py +3 -0
  15. triples/core/linsos/basis.py +728 -0
  16. triples/core/linsos/correction.py +175 -0
  17. triples/core/linsos/lift.py +145 -0
  18. triples/core/linsos/linsos.py +514 -0
  19. triples/core/linsos/models/linearsossolver_length_model.npz +0 -0
  20. triples/core/linsos/models/linearsossolver_prob_model.npz +0 -0
  21. triples/core/linsos/models/linearsossolver_time_model.npz +0 -0
  22. triples/core/linsos/solution.py +382 -0
  23. triples/core/linsos/tangents.py +394 -0
  24. triples/core/linsos/updegree.py +7 -0
  25. triples/core/node.py +391 -0
  26. triples/core/pivoting/__init__.py +4 -0
  27. triples/core/pivoting/pivoting.py +44 -0
  28. triples/core/pivoting/quadratic.py +481 -0
  29. triples/core/pivoting/tests/__init__.py +0 -0
  30. triples/core/pivoting/tests/test_pivoting.py +77 -0
  31. triples/core/preprocess/__init__.py +22 -0
  32. triples/core/preprocess/algebraic.py +140 -0
  33. triples/core/preprocess/elimination.py +308 -0
  34. triples/core/preprocess/features.py +83 -0
  35. triples/core/preprocess/modeling.py +336 -0
  36. triples/core/preprocess/polynomial.py +341 -0
  37. triples/core/preprocess/reparam.py +153 -0
  38. triples/core/preprocess/signs.py +660 -0
  39. triples/core/preprocess/tests/__init__.py +0 -0
  40. triples/core/preprocess/tests/test_elimination.py +57 -0
  41. triples/core/preprocess/tests/test_signs.py +179 -0
  42. triples/core/problem.py +992 -0
  43. triples/core/sdpsos/__init__.py +12 -0
  44. triples/core/sdpsos/abstract.py +586 -0
  45. triples/core/sdpsos/algebra/__init__.py +17 -0
  46. triples/core/sdpsos/algebra/basis.py +241 -0
  47. triples/core/sdpsos/algebra/moment_algebra.py +193 -0
  48. triples/core/sdpsos/algebra/nc_poly_ring.py +122 -0
  49. triples/core/sdpsos/algebra/poly_ring.py +108 -0
  50. triples/core/sdpsos/algebra/pseudo_poly.py +321 -0
  51. triples/core/sdpsos/algebra/state_algebra.py +169 -0
  52. triples/core/sdpsos/manifold.py +426 -0
  53. triples/core/sdpsos/models/sdpsossolver_length_model.npz +0 -0
  54. triples/core/sdpsos/models/sdpsossolver_prob_model.npz +0 -0
  55. triples/core/sdpsos/models/sdpsossolver_time_model.npz +0 -0
  56. triples/core/sdpsos/sdpsos.py +589 -0
  57. triples/core/sdpsos/sohs.py +166 -0
  58. triples/core/sdpsos/solution.py +200 -0
  59. triples/core/sdpsos/sos.py +265 -0
  60. triples/core/sdpsos/sos_moment.py +145 -0
  61. triples/core/sdpsos/tests/__init__.py +0 -0
  62. triples/core/sdpsos/tests/test_sos_obj.py +43 -0
  63. triples/core/shared.py +55 -0
  64. triples/core/solution.py +617 -0
  65. triples/core/structsos/__init__.py +8 -0
  66. triples/core/structsos/constrained/__init__.py +3 -0
  67. triples/core/structsos/constrained/acute.py +401 -0
  68. triples/core/structsos/constrained/linear.py +140 -0
  69. triples/core/structsos/constrained/solver.py +39 -0
  70. triples/core/structsos/constrained/tests/__init__.py +0 -0
  71. triples/core/structsos/constrained/tests/test_constrained.py +28 -0
  72. triples/core/structsos/nvars/__init__.py +9 -0
  73. triples/core/structsos/nvars/linear.py +51 -0
  74. triples/core/structsos/nvars/quadratic.py +236 -0
  75. triples/core/structsos/nvars/quartic.py +240 -0
  76. triples/core/structsos/nvars/solver.py +86 -0
  77. triples/core/structsos/nvars/tests/__init__.py +0 -0
  78. triples/core/structsos/nvars/tests/test_nvars.py +29 -0
  79. triples/core/structsos/pivoting/__init__.py +5 -0
  80. triples/core/structsos/pivoting/bivariate.py +206 -0
  81. triples/core/structsos/quaternary/__init__.py +6 -0
  82. triples/core/structsos/quaternary/cubic.py +179 -0
  83. triples/core/structsos/quaternary/dense_symmetric.py +64 -0
  84. triples/core/structsos/quaternary/quartic.py +166 -0
  85. triples/core/structsos/quaternary/quartic_symmetric.py +588 -0
  86. triples/core/structsos/quaternary/quintic.py +454 -0
  87. triples/core/structsos/quaternary/solver.py +136 -0
  88. triples/core/structsos/quaternary/tests/__init__.py +0 -0
  89. triples/core/structsos/quaternary/tests/test_quaternary.py +28 -0
  90. triples/core/structsos/quaternary/utils.py +10 -0
  91. triples/core/structsos/solution.py +97 -0
  92. triples/core/structsos/sparse.py +104 -0
  93. triples/core/structsos/structsos.py +125 -0
  94. triples/core/structsos/ternary/__init__.py +18 -0
  95. triples/core/structsos/ternary/acyclic.py +17 -0
  96. triples/core/structsos/ternary/cubic.py +579 -0
  97. triples/core/structsos/ternary/dense_symmetric.py +317 -0
  98. triples/core/structsos/ternary/nonic.py +505 -0
  99. triples/core/structsos/ternary/octic.py +32 -0
  100. triples/core/structsos/ternary/octic_symmetric.py +863 -0
  101. triples/core/structsos/ternary/quadratic.py +119 -0
  102. triples/core/structsos/ternary/quartic.py +1120 -0
  103. triples/core/structsos/ternary/quintic.py +1952 -0
  104. triples/core/structsos/ternary/quintic_symmetric.py +785 -0
  105. triples/core/structsos/ternary/septic.py +577 -0
  106. triples/core/structsos/ternary/septic_symmetric.py +514 -0
  107. triples/core/structsos/ternary/sextic.py +996 -0
  108. triples/core/structsos/ternary/sextic_symmetric.py +2302 -0
  109. triples/core/structsos/ternary/solver.py +127 -0
  110. triples/core/structsos/ternary/sparse.py +805 -0
  111. triples/core/structsos/ternary/tests/__init__.py +0 -0
  112. triples/core/structsos/ternary/tests/test_ternary.py +27 -0
  113. triples/core/structsos/ternary/utils.py +234 -0
  114. triples/core/structsos/tests/__init__.py +0 -0
  115. triples/core/structsos/tests/test_univariate.py +83 -0
  116. triples/core/structsos/univariate.py +869 -0
  117. triples/core/structsos/utils.py +259 -0
  118. triples/core/sum_of_squares.py +336 -0
  119. triples/core/symsos/__init__.py +7 -0
  120. triples/core/symsos/basic.py +335 -0
  121. triples/core/symsos/representation.py +160 -0
  122. triples/core/symsos/symmetric.py +400 -0
  123. triples/core/symsos/symsos.py +127 -0
  124. triples/core/symsos/tests/__init__.py +0 -0
  125. triples/core/symsos/tests/test_symsos.py +70 -0
  126. triples/core/tests/__init__.py +0 -0
  127. triples/core/tests/test_dispatch.py +91 -0
  128. triples/core/tests/test_problem.py +42 -0
  129. triples/gui/__init__.py +19 -0
  130. triples/gui/grid.py +437 -0
  131. triples/gui/linebreak.py +355 -0
  132. triples/gui/sos_manager.py +319 -0
  133. triples/gui/visualize.py +112 -0
  134. triples/sdp/__init__.py +22 -0
  135. triples/sdp/abstract.py +305 -0
  136. triples/sdp/arithmetic/__init__.py +26 -0
  137. triples/sdp/arithmetic/eigens.py +283 -0
  138. triples/sdp/arithmetic/linsolve.py +665 -0
  139. triples/sdp/arithmetic/lll.py +152 -0
  140. triples/sdp/arithmetic/matmul.py +399 -0
  141. triples/sdp/arithmetic/matop.py +555 -0
  142. triples/sdp/arithmetic/tests/__init__.py +0 -0
  143. triples/sdp/arithmetic/tests/test_eigens.py +42 -0
  144. triples/sdp/arithmetic/tests/test_matmul.py +121 -0
  145. triples/sdp/backends/__init__.py +21 -0
  146. triples/sdp/backends/backend.py +271 -0
  147. triples/sdp/backends/caller.py +407 -0
  148. triples/sdp/backends/clarabel_sdp.py +84 -0
  149. triples/sdp/backends/cvxopt_sdp.py +97 -0
  150. triples/sdp/backends/cvxpy_sdp.py +152 -0
  151. triples/sdp/backends/mosek_sdp.py +121 -0
  152. triples/sdp/backends/picos_sdp.py +90 -0
  153. triples/sdp/backends/qics_sdp.py +75 -0
  154. triples/sdp/backends/sdpap_sdp.py +67 -0
  155. triples/sdp/backends/settings.py +251 -0
  156. triples/sdp/backends/tests/__init__.py +0 -0
  157. triples/sdp/backends/tests/test_backends.py +279 -0
  158. triples/sdp/dual.py +1284 -0
  159. triples/sdp/ipm.py +509 -0
  160. triples/sdp/primal.py +521 -0
  161. triples/sdp/rationalize.py +385 -0
  162. triples/sdp/tests/__init__.py +0 -0
  163. triples/sdp/tests/test_dual.py +43 -0
  164. triples/sdp/tests/test_primal.py +48 -0
  165. triples/sdp/transforms/__init__.py +15 -0
  166. triples/sdp/transforms/linear.py +280 -0
  167. triples/sdp/transforms/parametric.py +48 -0
  168. triples/sdp/transforms/polytope.py +253 -0
  169. triples/sdp/transforms/transform.py +92 -0
  170. triples/sdp/transforms/transformable.py +198 -0
  171. triples/sdp/utils.py +370 -0
  172. triples/testing/__init__.py +0 -0
  173. triples/testing/doctest_parser.py +522 -0
  174. triples/testing/fix_code_quality.py +57 -0
  175. triples/testing/tests/__init__.py +0 -0
  176. triples/testing/tests/test_dependency.py +66 -0
  177. triples/utils/__init__.py +41 -0
  178. triples/utils/expressions/__init__.py +26 -0
  179. triples/utils/expressions/coeff.py +745 -0
  180. triples/utils/expressions/cyclic.py +1048 -0
  181. triples/utils/expressions/exraw.py +61 -0
  182. triples/utils/expressions/psatz.py +1161 -0
  183. triples/utils/expressions/soscone.py +718 -0
  184. triples/utils/expressions/tests/__init__.py +0 -0
  185. triples/utils/expressions/tests/test_coeff.py +70 -0
  186. triples/utils/expressions/tests/test_cyclic.py +145 -0
  187. triples/utils/monomials.py +1149 -0
  188. triples/utils/normalforms.py +261 -0
  189. triples/utils/pqr.py +202 -0
  190. triples/utils/roots/__init__.py +27 -0
  191. triples/utils/roots/extrema.py +759 -0
  192. triples/utils/roots/monotonic_opt.py +497 -0
  193. triples/utils/roots/num_extrema.py +503 -0
  194. triples/utils/roots/polysolve.py +375 -0
  195. triples/utils/roots/rationalize.py +426 -0
  196. triples/utils/roots/root_list.py +166 -0
  197. triples/utils/roots/roots.py +1161 -0
  198. triples/utils/roots/tests/__init__.py +0 -0
  199. triples/utils/roots/tests/test_extrema.py +56 -0
  200. triples/utils/roots/tests/test_num_extrema.py +77 -0
  201. triples/utils/roots/tests/test_roots.py +124 -0
  202. triples/utils/tests/__init__.py +0 -0
  203. triples/utils/tests/test_text_process.py +113 -0
  204. triples/utils/text_process.py +1131 -0
  205. triples/utils/tree_predictor.py +277 -0
  206. triples-0.1.0.dist-info/METADATA +772 -0
  207. triples-0.1.0.dist-info/RECORD +210 -0
  208. triples-0.1.0.dist-info/WHEEL +5 -0
  209. triples-0.1.0.dist-info/licenses/LICENSE +674 -0
  210. triples-0.1.0.dist-info/top_level.txt +1 -0
triples/__init__.py ADDED
@@ -0,0 +1,15 @@
1
+ from .utils import pl, CyclicSum, CyclicProduct, generate_monoms
2
+
3
+ from .core import sum_of_squares, StructuralSOS, LinearSOS, SDPSOS, SOSPoly
4
+
5
+ from .sdp import SDPProblem, congruence
6
+
7
+ __version__ = "0.1.0"
8
+
9
+ __all__ = [
10
+ '__version__',
11
+
12
+ 'pl', 'CyclicSum', 'CyclicProduct', 'generate_monoms',
13
+ 'sum_of_squares', 'StructuralSOS', 'LinearSOS', 'SDPSOS', 'SOSPoly',
14
+ 'SDPProblem', 'congruence'
15
+ ]
File without changes
@@ -0,0 +1,18 @@
1
+ from .problem_set import ProblemSet, mark
2
+
3
+ from .books import (
4
+ MathematicalInequalitiesVol1,
5
+ MathematicalInequalitiesVol2,
6
+ MathematicalInequalitiesVol3
7
+ )
8
+
9
+ from .contests import (
10
+ CMOProblems, ChinaHighSchoolMathLeague2, CTSTProblems,
11
+ IMOProblems, IMOSLProblems
12
+ )
13
+
14
+ __all__ = ['ProblemSet', 'mark',
15
+ 'MathematicalInequalitiesVol1', 'MathematicalInequalitiesVol2', 'MathematicalInequalitiesVol3',
16
+ 'CMOProblems', 'ChinaHighSchoolMathLeague2', 'CTSTProblems',
17
+ 'IMOProblems', 'IMOSLProblems'
18
+ ]
@@ -0,0 +1,7 @@
1
+ from .vasile import MathematicalInequalitiesVol1, MathematicalInequalitiesVol2, MathematicalInequalitiesVol3
2
+
3
+ __all__ = [
4
+ 'MathematicalInequalitiesVol1',
5
+ 'MathematicalInequalitiesVol2',
6
+ 'MathematicalInequalitiesVol3',
7
+ ]