passagemath-brial 10.6.31rc3__cp314-cp314-macosx_13_0_x86_64.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.

Potentially problematic release.


This version of passagemath-brial might be problematic. Click here for more details.

Files changed (39) hide show
  1. passagemath_brial-10.6.31rc3.dist-info/METADATA +97 -0
  2. passagemath_brial-10.6.31rc3.dist-info/RECORD +39 -0
  3. passagemath_brial-10.6.31rc3.dist-info/WHEEL +6 -0
  4. passagemath_brial-10.6.31rc3.dist-info/top_level.txt +2 -0
  5. passagemath_brial.dylibs/libbrial.3.0.7.dylib +0 -0
  6. passagemath_brial.dylibs/libbrial_groebner.3.0.7.dylib +0 -0
  7. passagemath_brial.dylibs/libgmp.10.dylib +0 -0
  8. passagemath_brial.dylibs/libm4ri.1.dylib +0 -0
  9. passagemath_brial.dylibs/libpng16.16.dylib +0 -0
  10. passagemath_brial.dylibs/libz.1.3.1.dylib +0 -0
  11. sage/all__sagemath_brial.py +9 -0
  12. sage/libs/all__sagemath_brial.py +1 -0
  13. sage/libs/polybori/__init__.pxd +2 -0
  14. sage/libs/polybori/decl.pxd +401 -0
  15. sage/libs/polybori/pb_wrap.h +133 -0
  16. sage/rings/all__sagemath_brial.py +1 -0
  17. sage/rings/polynomial/all__sagemath_brial.py +1 -0
  18. sage/rings/polynomial/pbori/PyPolyBoRi.py +123 -0
  19. sage/rings/polynomial/pbori/__init__.py +44 -0
  20. sage/rings/polynomial/pbori/blocks.py +443 -0
  21. sage/rings/polynomial/pbori/cnf.py +241 -0
  22. sage/rings/polynomial/pbori/easy_polynomials.py +56 -0
  23. sage/rings/polynomial/pbori/fglm.py +93 -0
  24. sage/rings/polynomial/pbori/frontend.py +70 -0
  25. sage/rings/polynomial/pbori/gbcore.py +634 -0
  26. sage/rings/polynomial/pbori/gbrefs.py +127 -0
  27. sage/rings/polynomial/pbori/heuristics.py +35 -0
  28. sage/rings/polynomial/pbori/interpolate.py +115 -0
  29. sage/rings/polynomial/pbori/interred.py +35 -0
  30. sage/rings/polynomial/pbori/ll.py +292 -0
  31. sage/rings/polynomial/pbori/nf.py +662 -0
  32. sage/rings/polynomial/pbori/parallel.py +298 -0
  33. sage/rings/polynomial/pbori/pbori.cpython-314-darwin.so +0 -0
  34. sage/rings/polynomial/pbori/pbori.pxd +127 -0
  35. sage/rings/polynomial/pbori/pbori.pyx +8107 -0
  36. sage/rings/polynomial/pbori/randompoly.py +105 -0
  37. sage/rings/polynomial/pbori/rank.py +27 -0
  38. sage/rings/polynomial/pbori/specialsets.py +112 -0
  39. sage/rings/polynomial/pbori/statistics.py +31 -0
@@ -0,0 +1,56 @@
1
+ # sage_setup: distribution = sagemath-brial
2
+ # sage.doctest: needs sage.rings.polynomial.pbori
3
+ from .interpolate import variety_lex_leading_terms, nf_lex_points
4
+ from .pbori import easy_linear_factors
5
+
6
+
7
+ def easy_linear_polynomials(p):
8
+ r"""
9
+ Get linear polynomials implied by given polynomial.
10
+
11
+ EXAMPLES::
12
+
13
+ sage: from sage.rings.polynomial.pbori.frontend import x
14
+ sage: from sage.rings.polynomial.pbori.easy_polynomials import easy_linear_polynomials
15
+ sage: easy_linear_polynomials(x(1)*x(2) + 1)
16
+ [x(1) + 1, x(2) + 1]
17
+ sage: easy_linear_polynomials(x(1)*x(2) + 0)
18
+ []
19
+ sage: easy_linear_polynomials(x(0)*x(1) + x(0)*x(2) + 1)
20
+ [x(0) + 1, x(1) + x(2) + 1]
21
+ """
22
+ res = []
23
+ if p.deg() >= 2:
24
+ if p.vars_as_monomial().deg() > 8:
25
+ res.extend(q + 1 for q in easy_linear_factors(p + 1))
26
+ else:
27
+ res = easy_linear_polynomials_via_interpolation(p)
28
+ return res
29
+
30
+
31
+ def easy_linear_polynomials_via_interpolation(p):
32
+ r"""
33
+ Get linear polynomials implied by given polynomial using interpolation of the variety.
34
+
35
+ TESTS::
36
+
37
+ sage: from sage.rings.polynomial.pbori.frontend import x
38
+ sage: from sage.rings.polynomial.pbori.easy_polynomials import easy_linear_polynomials_via_interpolation
39
+ sage: easy_linear_polynomials_via_interpolation(x(1)*x(2) + 1)
40
+ [x(1) + 1, x(2) + 1]
41
+ sage: easy_linear_polynomials_via_interpolation(x(1)*x(2) + 0)
42
+ []
43
+ sage: easy_linear_polynomials_via_interpolation(x(0)*x(1) + x(0)*x(2) + 1)
44
+ [x(0) + 1, x(1) + x(2) + 1]
45
+ """
46
+ res = []
47
+ p_vars = p.vars_as_monomial()
48
+ space = p_vars.divisors()
49
+ zeros = p.zeros_in(space)
50
+ lex_leads = variety_lex_leading_terms(zeros, p_vars)
51
+ for m in lex_leads:
52
+ if m.deg() == 1:
53
+ red = m + nf_lex_points(m, zeros)
54
+ if red.lead_deg() == 1: # normal ordering
55
+ res.append(red)
56
+ return res
@@ -0,0 +1,93 @@
1
+ # sage_setup: distribution = sagemath-brial
2
+ # sage.doctest: needs sage.rings.polynomial.pbori
3
+ from .pbori import BooleSet, FGLMStrategy
4
+ from .PyPolyBoRi import BoolePolynomialVector, Polynomial
5
+
6
+
7
+ def _fglm(I, from_ring, to_ring):
8
+ r"""
9
+ Unchecked variant of fglm
10
+ """
11
+ vec = BoolePolynomialVector(I)
12
+ return FGLMStrategy(from_ring, to_ring, vec).main()
13
+
14
+
15
+ def fglm(I, from_ring, to_ring):
16
+ r"""
17
+ Convert *reduced* Groebner Basis in ``from_ring`` to a GroebnerBasis
18
+ in ``to_ring``.
19
+
20
+ It acts independent of the global ring, which is restored at the end of the
21
+ computation.
22
+
23
+ TESTS::
24
+
25
+ sage: from sage.rings.polynomial.pbori import *
26
+ sage: from sage.rings.polynomial.pbori.PyPolyBoRi import OrderCode
27
+ sage: dp_asc = OrderCode.dp_asc
28
+ sage: r=declare_ring(['x','y','z'],dict())
29
+ sage: old_ring = r
30
+ sage: new_ring = old_ring.clone(ordering=dp_asc)
31
+ sage: (x,y,z) = [old_ring.variable(i) for i in range(3)]
32
+ sage: ideal=[x+z, y+z]# lp Groebner basis
33
+ sage: from sage.rings.polynomial.pbori.fglm import fglm
34
+ sage: list(fglm(ideal, old_ring, new_ring))
35
+ [y + x, z + x]
36
+ """
37
+ for poly in I:
38
+ if poly.ring().id() != from_ring.id():
39
+ raise ValueError("Ideal I must be from the first ring argument")
40
+ return _fglm(I, from_ring, to_ring)
41
+
42
+
43
+ def vars_real_divisors(monomial, monomial_set):
44
+ r"""
45
+ Return all elements of ``monomial_set``, which result multiplied by a variable in monomial.
46
+
47
+ EXAMPLES::
48
+
49
+ sage: from sage.rings.polynomial.pbori.pbori import *
50
+ sage: from sage.rings.polynomial.pbori.PyPolyBoRi import OrderCode
51
+ sage: dp_asc = OrderCode.dp_asc
52
+ sage: from sage.rings.polynomial.pbori.PyPolyBoRi import Ring
53
+ sage: r = Ring(1000)
54
+ sage: x = r.variable
55
+ sage: b = BooleSet([x(1)*x(2),x(2)])
56
+ sage: from sage.rings.polynomial.pbori.fglm import vars_real_divisors
57
+ sage: vars_real_divisors(x(1)*x(2)*x(3),b)
58
+ {{x(1),x(2)}}
59
+ """
60
+ return BooleSet(Polynomial(monomial_set.divisors_of(monomial)).
61
+ graded_part(monomial.deg() - 1))
62
+
63
+
64
+ def m_k_plus_one(completed_elements, variables):
65
+ r"""
66
+ Calculate `m_{k+1}` from the FGLM algorithm.
67
+
68
+ Calculate `m_{k+1}` from the FGLM algorithm as described in Wichmann [Wich1997]_.
69
+
70
+ .. NOTE::
71
+
72
+ It would be nice to be able to efficiently extract the smallest term of a polynomial.
73
+
74
+ EXAMPLES::
75
+
76
+ sage: from sage.rings.polynomial.pbori.pbori import *
77
+ sage: from sage.rings.polynomial.pbori.PyPolyBoRi import OrderCode
78
+ sage: from sage.rings.polynomial.pbori.fglm import m_k_plus_one
79
+ sage: dp_asc = OrderCode.dp_asc
80
+ sage: from sage.rings.polynomial.pbori.PyPolyBoRi import Ring
81
+ sage: r = Ring(1000)
82
+ sage: x = r.variable
83
+ sage: from sage.rings.polynomial.pbori.PyPolyBoRi import Monomial
84
+ sage: s = BooleSet([x(1)*x(2),x(1),x(2),Monomial(r),x(3)])
85
+ sage: variables = BooleSet([x(1),x(2),x(3)])
86
+ sage: m_k_plus_one(s,variables)
87
+ x(2)*x(3)
88
+ sage: r2 = r.clone(ordering=dp_asc)
89
+ sage: m_k_plus_one(r2(s).set(),r2(variables).set())
90
+ x(1)*x(3)
91
+ """
92
+ return sorted(completed_elements.cartesian_product(variables).diff(
93
+ completed_elements))[0]
@@ -0,0 +1,70 @@
1
+ # sage_setup: distribution = sagemath-brial
2
+ # sage.doctest: needs sage.rings.polynomial.pbori
3
+ # Import basic functionality
4
+ r"""
5
+ This module defines an initial ring, and patches the declare_ring to use
6
+ a given context.
7
+
8
+ EXAMPLES::
9
+
10
+ sage: from sage.rings.polynomial.pbori.frontend import x
11
+ sage: x(0)
12
+ x(0)
13
+ sage: x(0)*x(0)
14
+ x(0)
15
+ sage: x(0) + x(0)
16
+ 0
17
+ sage: x(9999)
18
+ x(9999)
19
+ sage: x(9999)*x(9999)
20
+ x(9999)
21
+ sage: x(9999) + x(9999)
22
+ 0
23
+
24
+ sage: from sage.rings.polynomial.pbori.frontend import x, polybori_start
25
+ sage: context = dict(globals())
26
+ sage: polybori_start(context)
27
+ ipbori...
28
+ sage: r = context['declare_ring']('abc')
29
+ sage: context['a']
30
+ a
31
+ sage: r.variable(0)
32
+ a
33
+ """
34
+
35
+
36
+ from .PyPolyBoRi import Ring
37
+ from .pbori import VariableFactory
38
+ from .blocks import declare_ring as orig_declare_ring
39
+
40
+
41
+ def block_scheme_names(blocks):
42
+ r"""
43
+ Helper for Singular interface.
44
+ """
45
+ context = {}
46
+ from .blocks import declare_block_scheme
47
+ declare_block_scheme(blocks, context)
48
+
49
+ return list(context.keys())
50
+
51
+
52
+ ipbname = 'ipbori'
53
+
54
+
55
+ def polybori_start(global_context):
56
+ def declare_ring(blocks, context=None):
57
+ if context is None:
58
+ context = global_context
59
+
60
+ return orig_declare_ring(blocks, context)
61
+ declare_ring.__doc__ = orig_declare_ring.__doc__
62
+ global_context["declare_ring"] = declare_ring
63
+
64
+ print(ipbname + """ -- The interactive command line tool of PolyBoRi/BRiAL %s
65
+ """ % global_context.get("polybori_version", ''))
66
+
67
+
68
+ # Here come the defaults
69
+ r = Ring(10000)
70
+ x = VariableFactory(r)