I don't use crt very often and I can't speak to the usefulness of this
function, but it does seem odd to me that crt() has mod as the first
argument. I would expect it to be the second argument.

Aaron Meurer

On Wed, Jan 22, 2020 at 2:19 PM Chris Smith <[email protected]> wrote:
>
> There are several APIs for crt-like functions as described in the `crt` 
> docstring:
>
> crt(mod, rem)
> gf_crt(rem, mod)
> solve_congruence(*rem_mod_pairs)
>
>
> There is a new function, `crt_cartesian` being introduced by this PR. e.g.
>
>     >>> from sympy.ntheory.modular import crt_cartesian
>     >>> from sympy.utilities.iterables import cartes
>     >>> rem = [[3, 5], [3, 7]]
>     >>> crt_cartesian(rem, [7, 11])
>      [3, 73, 47, 40]
>     >>> [(p%7, p%11) for p in _]
>     [(3, 3), (3, 7), (5, 3), (5, 7)]
>     >>> assert _ == list(cartes(*rem))
>
>
>
> Does anyone use such a calculation? Should the API of the new function be the 
> same as `crt`? reversed? a dictionary of `{modulus m: list of residuals wrt 
> modulus m}`? Should the output include the product of `mod` like crt does?
>
> --
> You received this message because you are subscribed to the Google Groups 
> "sympy" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/sympy/b1f77e73-1fd5-4338-9776-beaf99be4bde%40googlegroups.com.

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/CAKgW%3D6K9616EYPVBaV%2BR%3Dji4LbykSm8cdgtOjva4XabuhSpT_w%40mail.gmail.com.

Reply via email to