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

New set of sympy's fixes #275

Merged
merged 80 commits into from Jul 18, 2016

Conversation

@skirpichev
Copy link
Collaborator

skirpichev commented May 13, 2016

// stuff from 2015, previous pr: #116

Also

@skirpichev skirpichev referenced this pull request May 16, 2016

Closed

Rename project and adapt imports (sympy -> diofant) #135

6 of 6 tasks complete

@skirpichev skirpichev force-pushed the skirpichev:sympy-backports4 branch 3 times, most recently from f28f7b4 to f1ff3cb May 21, 2016

@skirpichev skirpichev force-pushed the skirpichev:sympy-backports4 branch 2 times, most recently from 9380e83 to 429bc1f Jun 25, 2016

@skirpichev skirpichev modified the milestone: First public release Jul 4, 2016

oliverlee and others added some commits Aug 11, 2015

Use xreplace instead of subs in Derivative instantiation
Speedup differentiation of expressions by using xreplace
instead of subs.

// minor edits by skirpichev

Signed-off-by: Sergey B Kirpichev <skirpichev@gmail.com>
pretty/latex printing of S.Naturals0
// minor edits by skirpichev

Signed-off-by: Sergey B Kirpichev <skirpichev@gmail.com>
Simplify dup_mirror
Signed-off-by: Sergey B Kirpichev <skirpichev@gmail.com>
Add support of ITE in lambdify()
// minor edits by skirpichev

Signed-off-by: Sergey B Kirpichev <skirpichev@gmail.com>
Tuple constructor should not take the argument **assumptions
Signed-off-by: Sergey B Kirpichev <skirpichev@gmail.com>
Fixed indenation error in summations.py
Also added test for issue sympy/sympy#9908

// minor edits by skirpichev

Signed-off-by: Sergey B Kirpichev <skirpichev@gmail.com>
PEP8ify facts.py
Signed-off-by: Sergey B Kirpichev <skirpichev@gmail.com>
Docstring Python escaping backslash in latex strings sdded
Signed-off-by: Sergey B Kirpichev <skirpichev@gmail.com>
Pass on kwargs in symarray to Symbol
// minor edits by skirpichev

Signed-off-by: Sergey B Kirpichev <skirpichev@gmail.com>
Shortcut cancelling fractions with integer one
Fractions with integer one in either the numerator or the denominator
would make it possible to cancelled out any common factor from the
numerator and the denominator.  However, in the current implementation,
there is no special treatment for this situation.  The computation of
the GCD with integer one would take a long time by using the Euclidean
algorithm, as in the issue sympy/sympy#9341.

As a result, in this commit, when called with expressions, the cancel
function will directly return the quotient when an integer unity is
found.  This could solve issue #9314.  And when the function is called
with polynomials directly or called with tuples, this short-cut will not
be invoked to better preserve its original behaviour in internal use.

Add one as special case in computing GCD of DMP

In the GCD computation of dense multivariate polynomials, previously in
function `sympy.polys.euclidtools._dmp_rr_trivial_gcd`, only the special
cases with one of the polynomials being zero is specially treated as
trivial case.  However, the polynomial of constant unity is the unit of
the multiplication operation in the ring, so it cannot possibly have
other GCD with any polynomial.  So now one is being handled as a special
case as well to skip the later expensive operations.

Signed-off-by: Sergey B Kirpichev <skirpichev@gmail.com>
Typo
0.125 is 1/8 and not 1/4

Signed-off-by: Sergey B Kirpichev <skirpichev@gmail.com>
Fix a typo
Signed-off-by: Sergey B Kirpichev <skirpichev@gmail.com>
Fix row_del function in MutableDenseMatrix
// edited by skirpichev

Signed-off-by: Sergey B Kirpichev <skirpichev@gmail.com>
Fix Mod._eval_is_integer helper
When one cannot determine it is an integer, it should
return None, and not False.  This closes issue sympy/sympy#10024.

Signed-off-by: Sergey B Kirpichev <skirpichev@gmail.com>
docs changes in rv.py
Signed-off-by: Sergey B Kirpichev <skirpichev@gmail.com>
Added type check to look for objects with _getitem_
Fixes sympy/sympy#7985

// edited by skirpichev: dict (unhashable) -> Dict in tests

Signed-off-by: Sergey B Kirpichev <skirpichev@gmail.com>
Extended support for matrix power to non-diagonalizable matrices
// edited by skirpichev (stylistic fixes)

Signed-off-by: Sergey B Kirpichev <skirpichev@gmail.com>

asmeurer and others added some commits Jul 7, 2013

Minor cleanups in risch.py
Remove unused variables, and fix a potential nondeterminism issue.

// edited by skirpichev

Signed-off-by: Sergey B Kirpichev <skirpichev@gmail.com>
Make risch_integrate(x**x, x) work
Previously, this did not work, because it could not recognize x**x as
exp(x*log(x)) unless there already was a log(x) in the expression
somewhere. Now, we manually add log(x) to the extension as soon as we see a
nonelementary monomial of this form (with a symbolic base).

Of course, x**x has no elementary integral, but now risch_integrate is capable
of determining this without explicitly rewriting it as exp(x*log(x)). I don't
know of any examples of integrands that have elementary integrals of this form
with symbolic bases that don't also include the log of the base, but I haven't
looked very hard.

Also update the doctest in risch_integrate() to use this, because that's what
I wanted to use in the first place (I just never got around to fixing this).

// edited by skirpichev: added filtering for symlogs

Signed-off-by: Sergey B Kirpichev <skirpichev@gmail.com>
changed slow decoration of tests
// edited by skirpichev

Signed-off-by: Sergey B Kirpichev <skirpichev@gmail.com>
Do not allow subs to target args of RootOf
Closes sympy/sympy#10092

// edited by skirpichev

Signed-off-by: Sergey B Kirpichev <skirpichev@gmail.com>
Add support for diff in ITE
// edited by skirpichev

Signed-off-by: Sergey B Kirpichev <skirpichev@gmail.com>
Changed the use of pyglet plot module
This example uses, as of now, the old pyglet plotting module
which is not working right now.
Changed so that it uses the new plot API.

Fixes sympy/sympy#10243

// edited by skirpichev

Signed-off-by: Sergey B Kirpichev <skirpichev@gmail.com>
Selection of integer-valued solutions
Quadratic equations with nonsquare discriminant are solved by
transforming to generalized Pell equations ``X**2 - D*Y**2 = N``.
The rational solutions of the two equations correspond to each other.
In addition, the transformation can be chosen such that all integer-
valued solutions of the original equation correspond to integer-valued
solutions of the Pell equation.
However, not all integer-valued solutions of the Pell equation
correspond to integer-valued solutions of the original equation,
because the rational coefficients of the inverse transformation are
not integers, in general.

The integer-valued solutions of the generalized Pell equation are as
follows. There is a finite number of fundamental solutions ``(X, Y)``,
and all solutions are obtained as coefficients of 1 and ``d = sqrt(D)``
in ``(X + d*Y)*(U + d*V)`` for all solutions of the Pell equation
``U**2 - D*V**2 = 1``. On the other hand, the solutions of the
Pell equation are given by the powers ``U_i + d*V_i = (U + d*V)**i``
of a single primitive solution ``(U, V)`` and their negatives.

The integer solutions of the original equation are then found with
the following steps.

    1. Find the fundamental solutions of the generalized Pell equation.

    2. Find the primitive solution ``(U, V)`` of Pell's equation.

    3. Find the least positive integer ``k`` such that ``(U_k, V_k)``
       is congruent to ``(1, 0)`` modulo the lcm ``L`` of the
       denominators of the coefficients of the inverse transformation.

    4. For each fundamental solution ``(X, Y)`` find the solutions
       ``(x_i, y_i)`` of the original equation corresponding to
       ``X_i + d*Y_i = (X + d*Y)*(U + d*V)**i for i in range(k)``.

    5. For each pair ``(x_i, y_i)`` of integer-valued solutions
       add all solutions corresponding to
       ``(X_i + d*Y_i)*(U_k + d*V_k)**t`` for all integers ``t``.

// edited by skirpichev

Signed-off-by: Sergey B Kirpichev <skirpichev@gmail.com>
Added mutable N-dim arrays, sparse and dense
Signed-off-by: Sergey B Kirpichev <skirpichev@gmail.com>
Added immutable N-dim arrays.
// edited by skirpichev: fix hashing

Signed-off-by: Sergey B Kirpichev <skirpichev@gmail.com>
Array shape is now an argument, after the iterable.
Signed-off-by: Sergey B Kirpichev <skirpichev@gmail.com>
.is_group for PermutationGroup returns True
docs fixes, `in` operator now works correctly for PermutationGroup

.elements for PermutationGroup introduced

equality of two PermutationGroups

Two Permutation Groups are equal if the set of elements generated
by the generators of two groups are equal

// edited by skirpichev

Signed-off-by: Sergey B Kirpichev <skirpichev@gmail.com>
latex printing of Cycle, Permutation
Now
>>> init_printing(use_unicode=True)
>>> Cycle(1, 2, 4)(5, 6)
(1 2 4)(5 6)
>>> latex(Cycle(1, 2, 4)(5, 6))
'\\left( 1\\; 2\\; 4\\right)\\left( 5\\; 6\\right)'

same printing for Permutation
tests fixes

fixes sympy/sympy#10210

// edited by skirpichev

Signed-off-by: Sergey B Kirpichev <skirpichev@gmail.com>
Changes to fix helper arg in autowrap
Closes sympy/sympy#10274

// edited by skirpichev

Signed-off-by: Sergey B Kirpichev <skirpichev@gmail.com>
Dense N-dim arrays now support slicing.
// edited by skirpichev

Signed-off-by: Sergey B Kirpichev <skirpichev@gmail.com>
Replace linear diophantine solver
1) fix runtime error (closes sympy/sympy#9539)
2) always return a valid solution when a solution exists.

// edited by skirpichev

Signed-off-by: Sergey B Kirpichev <skirpichev@gmail.com>
imageset for Piecewise under Interval added
// edited by skirpichev

Signed-off-by: Sergey B Kirpichev <skirpichev@gmail.com>
fixed trivial typo in explanation
There was a small grammatical error.

Signed-off-by: Sergey B Kirpichev <skirpichev@gmail.com>
Improve test coverage for sympy/tensor/array
Drop untested and/or inaccessible code, add some
trivial tests.

@skirpichev skirpichev force-pushed the skirpichev:sympy-backports4 branch from d95be0a to 4bdc45d Jul 17, 2016

@skirpichev skirpichev merged commit b2c204f into diofant:master Jul 18, 2016

3 checks passed

codecov/patch 90% of diff hit (target 90%)
Details
codecov/project 90% (+<1%) compared to 7caf8d9
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@skirpichev skirpichev deleted the skirpichev:sympy-backports4 branch Jul 18, 2016

@skirpichev skirpichev referenced this pull request Dec 7, 2016

Merged

Backport some sympy fixes #390

89 of 99 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment