Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quotient ring with old_poly_ring behaves incorrectly #21451

Open
Jex-y opened this issue May 10, 2021 · 1 comment
Open

Quotient ring with old_poly_ring behaves incorrectly #21451

Jex-y opened this issue May 10, 2021 · 1 comment
Labels

Comments

@Jex-y
Copy link

Jex-y commented May 10, 2021

When constructing a quotient ring, sometimes terms that should be dropped by the quotient are left in e.g.:

>>> from sympy import *
>>> d1, d2, d3 = symbols('d_1 d_2 d_3')
>>> InfRing = RR.old_poly_ring(d1,d2) / [d1**2, d2**2]
>>> d_1 = InfRing.convert(d1); d_2 = InfRing.convert(d2)
>>> print((d_2+d_1)**2)
2.0*d_1*d_2 + 1.0*d_2**2 + <1.0*d_1**2,1.0*d_2**2>

The output of this should be:

2.0*d_1*d_2 + <1.0*d_1**2,1.0*d_2**2>

This is not always the case as the following statements are correct:

>>> print(d_1**2)
0 + <1.0*d_1**2,1.0*d_2**2>
>>> print(d_2**2)
0 + <1.0*d_1**2,1.0*d_2**2>
>>> print((d_1 + 1) **2)
2.0*d_1 + 1.0 + <1.0*d_1**2,1.0*d_2**2>
@jksuom
Copy link
Member

jksuom commented May 10, 2021

2.0*d_1*d_2 + 1.0*d_2**2 is one of the weak normal forms of the result. It is not incorrect. It is computed by sdm_nf_mora in distributedmodules. From the docstring:

    Weak normal forms are defined in [SCA, defn 2.3.3]. They are not unique.
    This function deterministically computes a weak normal form, depending on
    the order of `G`.

There are other normal form functions, sdm_nf_buchberger and sdm_groebner, also implemented in distributedmodules but they are not currently applied in agca.modules, presumably for efficiency.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants