-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Release Notes for 1.6
These are the release notes for SymPy 1.6. You can also find release notes for previous versions.
SymPy 1.6 was released on 24th May 2020.
This version of SymPy has been tested on Python 3.5, 3.6, 3.7, 3.8 and PyPy. See our Python version support policy for more information on when we plan to drop support for older Python versions.
Note in particular that SymPy 1.5.1 was the last release to support Python 2.7. SymPy 1.6 will not work on Python 2.7. Python 2.7 users should install SymPy 1.5.1 and will not be able to install any further SymPy updates without updating to Python 3.
Install SymPy with
pip install -U sympy
or if you use Anaconda
conda install sympy
Please manually add any backwards compatibility breaks or deprecations here, in addition to the automatic listing below.
-
assumptions
-
Removed deprecated
Q.bounded
(useQ.finite
instead). Deprecated since version1.0
(issue: #9425) (#18390 by @Smit-create) -
Removed deprecated
Q.infinitesimal
(useQ.zero
instead). Deprecated since version1.0
(issue: #9675) (#18390 by @Smit-create) -
Removed deprecated
Q.infinity
(useQ.infinte
instead). Deprecated since version1.0
(issue: #9426) (#18390 by @Smit-create)
-
-
calculus
-
combinatorics
- Using
Permutation.print_cyclic
will raise deprecation warnings (#18033 by @oscarbenjamin, @souravgl0, and @sylee957)
- Using
-
core
-
Deprecated sympify automatically converting custom objects with
__str__
or__repr__
implemented. (#19006 by @sylee957) -
BREAKING CHANGE: Basic.has no longer accepts strings as input. For example in SymPy 1.5 you could do
Symbol('x').has('x')
and the string'x'
passed tohas
would be sympified to a symbol so that the result would beTrue
. In SymPy 1.6 this will raise an error because the string'x'
can not be sympified using strict sympification. (#19251 by @oscarbenjamin) -
Remove deprecated
bounded
,unbounded
andinfinitesimal
. Deprecated since version0.7.6
(issue #8071) (#18503 by @Smit-create) -
Relational is no longer a subclass of Expr and does not produce nonsensical results in arithmetic operations. This affects all Relational subclasses (Eq, Ne, Gt, Ge, Lt, Le). It is no longer possible to call meaningless
Expr
methods likeas_coeff_Mul
onRelational
instances. (#18053 by @oscarbenjamin) -
Expr now uses cooperative dispatch for binary operations so it is possible for non-Expr Basic subclasses to override the behaviour of e.g.
a + b
where one ofa
orb
is an instance of Expr. This also means that any non-Expr Basic subclasses can not depend onExpr.__add__
to createAdd(a, b)
: if a class is not a subclass of Expr and wants to define binary operations with Expr it must do so explicitly in its own__add__
method. For classes depending on this this is not a backward compatible change. (#18116 by @oscarbenjamin)
-
-
matrices
- The
Matrix.is_zero
property has been renamed toMatrix.is_zero_matrix
. -
Matrix.is_zero
is now alwaysFalse
. This is because in generalis_zero
means the numberzero
so a matrix can never bezero
.
To get the old behavior of
M.is_zero
in both old and new versions of sympy usefrom sympy.core.logic import fuzzy_and; fuzzy_and(m.is_zero for m in M)
. (#18464 by @sylee957) - The
-
polys
-
BREAKING CHANGE: Poly and PurePoly now subclass Basic rather than Expr. This means that they no longer have various Expr methods such as
expand
that do not make sense for Poly. Useas_expr
to convert the Poly to an Expr before using Expr methods. (#18613 by @oscarbenjamin) -
BREAKING CHANGE: Poly instances with different domains now always compare unequal with
p1 == p2
andp1.eq(p2)
. Previously Poly instances that had the same expression and generators would compare equal even if the domains were different. In some cases it might be necessary to specify the domain when comparing e.g.if p == Poly(x, x, domain='QQ')
. (#18613 by @oscarbenjamin) -
DEPRECATION: Mixing Poly with non-polynomial Expr in binary operations is now deprecated. For example
Poly(x, x) * exp(x)
will give a deprecation warning but still return the Exprx*exp(x)
as before. If the Expr can be converted to Poly (e.g.Poly(x, x) * x
) then a Poly will be returned. To get an Expr always use theas_expr
method first to convert the Poly to an Expr. To get a Poly always useas_poly
to convert theExpr
to aPoly
. (#18613 by @oscarbenjamin) -
DEPRECATION: Passing Poly as the integrand to the
integrate
function orIntegral
class is now deprecated. Use the integrate method instead e.g.Poly(x, x).integrate(x)
(#18613 by @oscarbenjamin)
-
-
printing
-
Removed deprecated
Ccodeprinter
(UseC89Printer
orC99Printer
instead). Deprecated since version1.1
(Issue : #12220). (#18392 by @risubaba) -
Removed deprecated
file
viewer option inpreview
. Deprecated since version0.7.3
(Issue: #7018) (#18392 by @risubaba) -
Removed deprecated
StringIO
viewer option inpreview
. Deprecated since version0.7.2
(Issue: #7083) (#18392 by @risubaba)
-
-
sets
- Set now uses cooperative dispatch for binary operations so it is possible for non-Set Basic subclasses to override the behaviour of e.g.
a + b
where one ofa
orb
is an instance of Set. This also means that any non-Set Basic subclasses can not depend on e.g.Set.__add__
to createUnion(a, b)
: if a class is not a subclass of Set and wants to define binary operations with Set it must do so explicitly in its own__add__
method. For classes depending on this this is not a backward compatible change. (#18116 by @oscarbenjamin)
- Set now uses cooperative dispatch for binary operations so it is possible for non-Set Basic subclasses to override the behaviour of e.g.
-
other
- Submodule names are no longer imported with
from sympy import *
. They can still be imported directly likefrom sympy import core
or accessed likesympy.core
, or likesys.modules['sympy.simplify']
for modules that share names with SymPy functions. (#18245 by @oscarbenjamin)
- Submodule names are no longer imported with
-
assumptions
-
assumptions
will give the T/F assumptions of a symbol or expression (#19155 by @smichr) -
common_assumptions
returns the T/F assumptions in common amongst the given expressions (#19155 by @smichr) -
Added a
refine_matrixelement
function (#18681 by @Saanidhyavats) -
Updated
Mul.is_imaginary
to support infinite values. (#18192 by @namannimmo10) -
Removed deprecated
Q.bounded
(useQ.finite
instead). Deprecated since version1.0
(issue: #9425) (#18390 by @Smit-create) -
Removed deprecated
Q.infinitesimal
(useQ.zero
instead). Deprecated since version1.0
(issue: #9675) (#18390 by @Smit-create) -
Removed deprecated
Q.infinity
(useQ.infinte
instead). Deprecated since version1.0
(issue: #9426) (#18390 by @Smit-create) -
Matrices can now be checked for antihermitian property by using ask(Q.antihermitian()) which earlier generated incorrect results. (#18303 by @czgdp1807)
-
Improved code in ask function using constructs from cnf module. (#18204 by @JSS95 and @mcpl-sympy)
-
Fixed bug in ask function: In case of user-defined Predicates it generated KeyError while checking for local_facts. Now falls back to Handlers and satask. (#18204 by @JSS95 and @mcpl-sympy)
-
-
calculus
-
continuous_domain
now finds singularities in nested fractions (#19047 by @smichr and @ThomasHickman) -
singularities
has been upgraded to handle more than rational functions (#19047 by @smichr and @ThomasHickman) -
fixes operations of AccumBounds (#18803 by @Ryand1234)
-
periodicity of exponential functions with a non-zero phase component is now calculated. (#18746 by @mohitacecode)
-
Correct the solution of
differentiate_finite
for expressions that contain embedded derivatives. (#17881 by @vezeli) -
Deprecated
evaluate
argument indifferentiate_finite
for making non-conservative finite differences. (#17881 by @vezeli) -
Updated docstrings of maximum, minimum, stationary_points and AccumBounds.intersection (#18581 by @mijo2)
-
Fixes Recursion Error in
AccumulationBounds.__pow__
by adding a check on denominator (#18450 by @Smit-create)
-
-
combinatorics
-
Permutation * PermutationGroup
andPermutationGroup * Permutation
return Coset. (#19139 by @mohitacecode) -
Added Coset Class. (#19077 by @mohitacecode and @sylee957)
-
Added SymmetricPermutationGroup Class. (#19077 by @mohitacecode and @sylee957)
-
Added schur number utilities in combinatorics (#18667 by @mijo2 and @slacker404)
-
Raise exception with wrong size in Permutation. (#18587 by @Smit-create)
-
Added
Permutation.conjugacy_class
andPermutation.conjugacy_classes
for computing conjugacy classes in permutation groups. (#18354 by @lucjon and @sachin-4099)
-
Fixed
Permutation
applying for negative integers. (#18032 by @mrocklin and @sylee957) -
Added
Permutation.apply
to use permutation as a symbolic function. (#18032 by @mrocklin and @sylee957) -
Using
Permutation.print_cyclic
will raise deprecation warnings (#18033 by @oscarbenjamin, @souravgl0, and @sylee957)
- Cycle class is no longer mutable and can be regarded as a sparse representation of a permutation (#17973 by @sachin-4099)
-
-
core
-
BREAKING CHANGE: Basic.has no longer accepts strings as input. For example in SymPy 1.5 you could do
Symbol('x').has('x')
and the string'x'
passed tohas
would be sympified to a symbol so that the result would beTrue
. In SymPy 1.6 this will raise an error because the string'x'
can not be sympified using strict sympification. (#19251 by @oscarbenjamin) -
Mul.is_integer no longer rebuilds arguments into Mul (#19182 by @iammosespaulr)
-
Mul with odd numerator and even denominator is recognized as rational but not integer (#19155 by @smichr)
- Deprecated sympify automatically converting custom objects with
__str__
or__repr__
implemented. (#19006 by @sylee957)
- Adds simplification to
Pow._eval_nseries
resolving incorrect limit evaluation (#18962 by @sachin-4099)
-
doit(deep=False)
now evaluatesAdd
andMul
. (#18829 by @JSS95 and @mcpl-sympy)
-
Reduces sensitivity of computation of order terms in
Pow._eval_nseries
(#18785 by @sachin-4099) -
Pow.is_zero is fixed for some cases involving infinite (or possibly infinite) expressions. (#18728 by @oscarbenjamin)
-
Now finite and infinite are logical opposites in the old assumptions system so e.g. a Symbol declared with finite=False will have infinite=True. (#18726 by @oscarbenjamin)
-
sympify no longer converts numpy arrays with size to scalars (#18651 by @mijo2 and @NeilGirdhar)
-
__getnewargs__()
added toZero
,One
,NegativeOne
,Half
. (#18675 by @mohitacecode) -
simplification of powers with numerical products in the base is improved (#18650 by @sachin-4099)
-
sqrt(x).is_negative
is False whenx
is real (#18597 by @Smit-create) -
Add,_eval_as_leading_term() has been fixed (#18340 by @sachin-4099)
-
Updated the definition of atoms method of class Basic (#18532 by @mijo2)
-
basic - sorting in subs is improved so unsorted arguments will prefer replacing more complicated patterns first (e.g. the second derivative before the first derivative). (#18043 by @Psycho-Pirate)
-
Remove deprecated
bounded
,unbounded
andinfinitesimal
. Deprecated since version0.7.6
(issue #8071) (#18503 by @Smit-create) -
Added check for
AccumBounds
. (#18478 by @smichr and @Smit-create) -
Adding gmpy in integer_nthroot ( It works only for
n < 2**63
) (#18380 by @Smit-create) -
Pow._eval_nseries fixed to accept all real exponents. (#18406 by @Smit-create)
-
integer_ntroot
andigcd
now use gmpy when it is installed (#18276 by @Smit-create) -
Changed some partial derivatives like
diff(f(g(x), h(x)), x)
not to have dummy symbols. (#18326 by @sachin-4099) -
subs
now works correctly with partial derivatives. (#18326 by @sachin-4099) -
Subclass of
Function
can inherit itsnargs
attribute to its subclasses. (#18258 by @JSS95 and @mcpl-sympy) -
Added try-except block in
sympy/core/relational.py
to handleNotImplementedError
and returnConditionSet
(#18211 by @Smit-create) -
Renamed
core/evaluate
tocore/parameters
(#18198 by @JSS95, @mcpl-sympy, and @oscarbenjamin) -
Added
global_parameters
, which is a thread-local storage for global parameters such asevaluate
,distribute
, etc. (#18198 by @JSS95, @mcpl-sympy, and @oscarbenjamin) -
Relational is no longer a subclass of Expr and does not produce nonsensical results in arithmetic operations. This affects all Relational subclasses (Eq, Ne, Gt, Ge, Lt, Le). It is no longer possible to call meaningless
Expr
methods likeas_coeff_Mul
onRelational
instances. (#18053 by @oscarbenjamin) -
Expr now uses cooperative dispatch for binary operations so it is possible for non-Expr Basic subclasses to override the behaviour of e.g.
a + b
where one ofa
orb
is an instance of Expr. This also means that any non-Expr Basic subclasses can not depend onExpr.__add__
to createAdd(a, b)
: if a class is not a subclass of Expr and wants to define binary operations with Expr it must do so explicitly in its own__add__
method. For classes depending on this this is not a backward compatible change. (#18116 by @oscarbenjamin) -
Added global_evaluate[0] condition in add, sub, mul, div functions in Infinity class. (#18109 by @namannimmo10)
-
Moved .as_poly() from Basic to Expr. (#18094 by @dhruvmendiratta6)
-
Fixed a bug in
Factors().as_expr()
that led to simplifications that are not generally valid for complex numbers. (Exponents were always multiplied in power-of-a-power situations.) (#18087 by @gschintgen)
-
-
functions
-
Adjoint of
exp
and transpose ofexp
now work as expected. (#19151 by @akirakyle) -
Adds substitution to
_eval_nseries() function of Abs() class
resolving incorrect limit evaluations (#19037 by @sachin-4099)
-
periodicity of trigonometric functions with a non-zero phase component is now calculated. (#18746 by @mohitacecode)
-
__getnewargs__()
andargs()
added toIdentityFunction
. (#18675 by @mohitacecode) -
Added _eval_nseries() functionality to hyper (#18630 by @dhruvmendiratta6)
- Fix number of terms in exp._eval_nseries. (#18598 by @mohitacecode)
-
Fixes TypeError while using simplify (#18640 by @Smit-create)
-
Added proportional tolerance for falling factorial test (#18456 by @mijo2)
-
polygamma(n, 1/2) with n a positive integer is automatically evaluated (#18451 by @ethankward)
-
floor and ceiling with float arguments now return Integers (#18424 by @mohitacecode)
-
Sympified output numbers for
factorial
andbinomial
used withMod
. (#18339 by @namannimmo10) -
Maximum recursion depth is no longer exceeded when subfactorial is called on large numbers (#17983 by @sachin-4099)
-
-
geometry
-
Line.bisectors will return the two perpendicular lines, bisecting the angles at the intersection of two linear entities and laying in the same plane as them (#19094 by @Jaime02 and @smichr)
-
Added explicit optional parameters to Polygon and convex_hull (#15757 by @oscargus)
-
Added
bisectors
method forPolygon
class. (#18335 by @namannimmo10) -
Add
__call__
method inClass Curve
. (#18250 by @namannimmo10) -
Point.coordinates was added as a meaningful alias for Point.args (#18213 by @Jaime02)
-
-
holonomic
- A cache mismatch error was fixed. (#19248 by @iammosespaulr and @smichr)
-
integrals
-
Handling Float Integrals (#18434 by @Smit-create)
-
Added extra step to evaluate integral if
heurisch()
returnsNone
inheurisch_wrapper()
(#18153 by @risubaba) -
Catch ValueError from meijerg() in _inverse_mellin_transform(). (#18141 by @Smit-create)
-
-
logic
-
to_cnf
/to_dnf
(whensimplify=True) require
force=True` if there are more than 8 variables (#18912 by @smichr) -
simplify_logic
recognizes trivial simplified cases (#18912 by @smichr) -
is_literal
can treatNot
as literal or not by using theliteral_Not
flag (#18912 by @smichr) -
Opposing Relationals are now detected correctly in nested Ands allowing evaluation to False in more cases. (#18811 by @oscarbenjamin)
-
Added a new normal form -
ANFform
. FunctionANFform
converts a list of truth values to an expression in Algebraic Normal Form (ANF). (#13686 by @KonstantinTogoi) -
Added a new method
BooleanFunction.to_anf
that converts an expression to ANF by equivalent transformations. (#13686 by @KonstantinTogoi) -
Added a new function
is_anf
that checks if an expression is ANF. (#13686 by @KonstantinTogoi) -
Added a new function
to_anf
that converts an expression to ANF if it is not ANF. (#13686 by @KonstantinTogoi) -
Added a new function
distribute_xor_over_and
. Given a sentences
consisting of conjunction and exclusive disjunctions of literals, it returns an equivalent exclusive disjunction. (#13686 by @KonstantinTogoi) -
Added a new function
bool_minterm
that returns the k-th minterm of a fixed ordered set of binary variables. (#13686 by @KonstantinTogoi) -
Added a new function
bool_maxterm
that returns the k-th maxterm of a fixed ordered set of binary variables. (#13686 by @KonstantinTogoi) -
Added a new function
bool_monomial
that returns the k-th monomial of a fixed ordered set of binary variables. (#13686 by @KonstantinTogoi)
-
matrices
-
Fixed matrix creation from the list containg numpy ndarray. (e.g.
Matrix([np.array([1, 2]), np.array([1, 2])])
) (#19229 by @sylee957) -
Added
is_strongly_diagonally_dominant
andis_weakly_diagonally_dominant
properties forMatrix
. (#19205 by @sylee957)
- Powers of non-square matrices now always raise an error, even when constructed using
MatPow(...)
. (#19104 by @jlherren)
-
ZeroMatrix will not be logically
False
. (#19110 by @sbt4104) -
Added
connected_components
andconnected_components_decomposition
for matrix which decomposes a matrix into a block diagonal form. (#19045 by @sylee957) -
Added
todok
function to find dictionary of keys format from any dense or sparse matrices. (#19045 by @sylee957) -
Added
BlockDiagMatrix.get_diag_blocks
to provide an user API to get diagonal blocks from the matrix. (#19045 by @sylee957) -
Fixed bug of
mpmath.matrix
transforming into wrong shape if used to createMatrix
. (#18911 by @smichr and @sylee957) -
Improved
eigenvals
andeigenvects
for floating point matrices usingmpmath
. (#18911 by @smichr and @sylee957)
-
Some expressions involving OneMatrix are now simplified. (#19009 by @jlherren)
-
Indexing BlockMatrix now more often produces correct results and remains unevaluated if a correct simplification is not possible. (#19007 by @jlherren)
-
Added a function that rotates matrices by 90 degrees (#18953 by @iammosespaulr and @sylee957)
-
sparsetools -
_doktocsr
now returns a MutableSparseMatrix (#18940 by @smichr) -
Added Golub Kahan Bidiagonalization with Householder Reflections (#18797 by @sudoWin)
-
Added test_solvers.py file which contains all the solvers-related tests. (#18793 by @guptabhaskar)
-
Added
evaluate
option toMatAdd
andMatMul
(#18765 by @JSS95 and @mcpl-sympy)
-
non-square matrices now raise NonSquareMatrixError if inversion is attempted (#18647 by @abhinav28071999)
-
Added
test_subspaces.py
file which contain all the reductions-related tests. (#18713 by @mohitacecode) -
Added
test_reductions.py
file which contain all the reductions-related tests. (#18705 by @mohitacecode) -
Added
test_eigen.py
file which contain all the eigen-related tests. (#18690 by @mohitacecode) -
Added
test_decomposition.py
file which contain all the decomposition-related tests. (#18685 by @mohitacecode) -
Added
test_determinant.py
file which contain all the determinant-related tests. (#18668 by @mohitacecode) -
Faster Matrix Inverse using Block Matrix (#18608 by @abhinav28071999)
-
Faster Matrix exponentiation using Cayley Hamilton Theorem (#18595 by @abhinav28071999)
-
Fixed
BlockDiagMatrix(A).blocks
giving a non-block matrix. (#18621 by @abhinav28071999) -
Added dotprodsimp keyword to MatrixArithmetic.pow (#18600 by @Pristine-Cat)
-
Implemented General Matrix Analytic functions (#18565 by @abhinav28071999)
-
Enabled intermediate matrix product simplification to control expression blowup during certain matrix operations. (#18572 by @Pristine-Cat) (#18147 by @Pristine-Cat) (#18049 by @Pristine-Cat)
-
Added environment variable check
SYMPY_DOTPRODSIMP=0
to turn off the newdotprodsimp
simplification in case the structure of the new results breaks user code. Should be removed after next live release. (#18572 by @Pristine-Cat) -
Pulled out and cleaned up many matrix function implementations from
matrices.py
into individual matrix source filesdeterminant.py
,reductions.py
,subspaces.py
,eigen.py
,decompositions.py
,solvers.py
andinverse.py
. (#18564 by @Pristine-Cat) (#18519 by @Pristine-Cat) (#18425 by @Pristine-Cat) (#18420 by @Pristine-Cat) (#18342 by @Pristine-Cat) -
Immutable matrices return themselves on call to as_immutable(). (#18441 by @Pristine-Cat)
-
Fixed wrapper for NumPy matrices so SymPy iteration and indexing works correctly. (#18160 by @Pristine-Cat)
-
Not backwards compatible: The
Matrix.is_zero
property has been renamed toMatrix.is_zero_matrix
.Matrix.is_zero
is now alwaysFalse
. This is because in generalis_zero
means the number zero so a matrix can never be zero. To get the old behavior ofM.is_zero
in both old and new versions of sympy usefrom sympy.core.logic import fuzzy_and; fuzzy_and(m.is_zero for m in M)
. (#18464 by @sylee957) -
Added
PermutationMatrix
andMatrixPermute
for matrix permutations. (#18032 by @mrocklin and @sylee957) -
Fixed
FunctionMatrix.replace
raisingTypeError: 'property' object is not iterable
when the function is not aLambda
instance. (#17998 by @sylee957) -
FunctionMatrix
andElementwiseApplyFunction
will always wrap the function insideLambda
. (#17998 by @sylee957) -
Cleaned up unnecessary slowdown for
MatMul.doit
when it contains explicit matrices. (#17872 by @sylee957) -
Fixed
MatPow(Inverse(A), 3)
andInverse(MatPow(A, 3))
canonicalized into different objects. (#17872 by @sylee957)
-
-
ntheory
-
the number of digits (like bit length) can now be specified for
digits
(#18961 by @Arpan612 and @smichr) -
Corrects the condition for "Extra strong" Lucas pseudoprime (#18946 by @Arpan612 and @sylee957)
-
count_digits
works only with numbers (not strings) (#18807 by @smichr) -
digits
is now located indigits
instead offactor_
(#18807 by @smichr) -
implemented elliptic curve (#18682 by @abhinav28071999 and @shikil)
-
added new
ntheory
moduledigits.py
containing methods related to arithmetic properties of integers (currently, frequency counters for digits of integers, palindromic numbers) (#18659 by @sr-murthy) -
Made divisor_sigma() symbolically recognize the case:
divisor_sigma(a**j*b**k)
(#18688 by @sachin-4099) -
Added
multiplicty_in_factorial(p, n)
to find the multiplicity ofp
inn!
without calculating the factorial. (#18671 by @sachin-4099) -
implemented gaussian prime test (#18673 by @abhinav28071999)
-
is_nthpow_residue
no longer raises ValueError when a < 0 (#18398 by @abhinav28071999) -
polynomial_congruence
recognizesx**n + a = 0 mod m
as a special case (#18398 by @abhinav28071999) -
Added
polynomial_congruence(expr, m)
to find values congruent (mod m) to a polynomial (#18294 by @abhinav28071999) -
is_nthpow_residue
handles numbers that are not powers of a primitive root. (#18337 by @abhinav28071999) -
Fixes
nthroot_mod
for prime powers (#18274 by @abhinav28071999) -
nthroot_mod
now supports composite moduli (#18199 by @abhinav28071999) -
Added
dra
anddrm
to calculate digital root via addition and multiplication (#16496 by @abhinav28071999 and @smichr) -
Added
quadratic_congruence
solver function (#18195 by @abhinav28071999) -
Make
nthroot_mod
,primitive_root
and_primitive_root_prime_iter
incompatible with composite modulo. (#18194 by @risubaba) -
In
def _sqrt_mod_prime_power(a, p, k):
it is assumed that p is a prime number. And this function callsif not is_quad_residue(a, p):
in line 396. Butis_quad_residue(a, p)
again checks that p is prime or not. This leads to extra computation cost. (#18184 by @abhinav28071999) -
Added check for zero in is_nthpow_residue. (#18129 by @erdOne)
- Added
proper_divisor
andproper_divisor_count
functions (#18085 by @adhoc-king and @czgdp1807)
- Proper exception when accessing index 0 of
sieve
. (#18013 by @JulienPalard)
-
-
parsing
-
added support for unary operators: unary plus(
+
), unary minus(-
), pre/post increment(++
), pre/post decrement(--
) and logical NOT(!
) in C parser (#19140 by @smitgajjar) -
added support for parenthesized expression in C parser (#19140 by @smitgajjar)
-
added support for
binom
(#19147 by @iammosespaulr) -
Added 2 new rules for mathematica parser. (#19135 by @wuyudi)
-
added support for parsing binary operators
+
,-
,*
,/
,%
,=
,==
,!=
,<
,<=
,>
,>=
,&&
and||
in C parser (#19029 by @smitgajjar) -
added support for parsing variable declarations and assignments, where one variable or a literal or any combination of them using binary operators is assigned to another variable in C parser (#19029 by @smitgajjar)
-
added support for variable declaration and assignment of boolean literal (
true
andfalse
) as well as declaration of boolean data type in C parser (#19029 by @smitgajjar) -
Added the assignment case where character is assigned to an integer in C parser (#18925 by @smitgajjar)
-
parse_expr
can now be imported directly from sympy (from sympy import parse_expr
). The various parsing transformers should still be imported fromsympy.parsing.sympy_parser
. (#18074 by @asmeurer)
- updated use of Call() to work in Python >=3.5 by reformatting arguments (#17875 by @czgdp1807 and @gregmedlock)
-
-
physics.continuum_mechanics
-
draw
method follows sign convention of positive moment/counterclockwise application (#18766 by @amartinhernan)
-
-
physics.mechanics
- KanesMethod.forcing no longer contains time derivatives of generalized coordinates if kinematical differential equations are supplied. (#18078 by @moorepants)
-
physics.quantum
-
physics.vector
-
Fixed test failure for test_dyadic with cache off (#18405 by @Smit-create)
-
Added assumptions to dynamicsymbols (#18061 by @Smit-create)
-
Added test for dynamicsymbols (#18061 by @Smit-create)
-
-
plotting
-
Accept user passed
label
of the plots (#19079 by @Smit-create) -
Added backend option (#18677 by @Smit-create)
-
Fixed aspect_ratio in plot (#18537 by @Smit-create)
-
-
polys
-
roots_quintic
now recognizes when there is no analytical solution (#19165 by @smichr) -
any Expr with non-symbol generators will be refused by root-related public functions to minimize confusion (since roots of
cos(x) - 1
andx - 1
are the same). (#19117 by @smichr) -
RootOf results that are returned in root request will have a canonical
x
as their generator (#19117 by @smichr) -
any Expr with non-symbol generators will be refused by root-related public functions to minimize confusion (since roots of
cos(x) - 1
andx - 1
are the same). (#19117 by @smichr) -
RootOf results that are returned in root request will have a canonical
x
as their generator (#19117 by @smichr) -
Fixed an issue when calling factor() with an extension (#19040 by @iammosespaulr)
-
Combine factors of same multiplicity (#18698 by @Smit-create)
-
Fixed initialization of
orig_ext
and addedfrom_AlgebraicField()
toAlgebraicField
. (#18669 by @mohitacecode) -
BREAKING CHANGE: Poly and PurePoly now subclass Basic rather than Expr. This means that they no longer have various Expr methods such as
expand
that do not make sense for Poly. Useas_expr
to convert the Poly to an Expr before using Expr methods. (#18613 by @oscarbenjamin) -
BREAKING CHANGE: Poly instances with different domains now always compare unequal with
p1 == p2
andp1.eq(p2)
. Previously Poly instances that had the same expression and generators would compare equal even if the domains were different. In some cases it might be necessary to specify the domain when comparing e.g.if p == Poly(x, x, domain='QQ')
. (#18613 by @oscarbenjamin) -
DEPRECATION: Mixing Poly with non-polynomial Expr in binary operations is now deprecated. For example
Poly(x, x) * exp(x)
will give a deprecation warning but still returne the Exprx*exp(x)
as before. If the Expr can be converted to Poly (e.g.Poly(x, x) * x
) then a Poly will be returned. To get an Expr always use theas_expr
method first to convert the Poly to an Expr. To get a Poly always useas_poly
to convert theExpr
to aPoly
. (#18613 by @oscarbenjamin) -
DEPRECATION: Passing Poly as the integrand to the
integrate
function orIntegral
class is now deprecated. Use the integrate method instead e.g.Poly(x, x).integrate(x)
(#18613 by @oscarbenjamin) -
add condition for
f == 0
to Piecewise solution for symbolic quartic polynomials (#18571 by @harsh9200) -
Fixed polynomial gcd bug (#18566 by @Smit-create)
-
Added check for expressions containing GoldenRatio and TribonacciConstant (#18535 by @Smit-create)
-
Added
expand
insimplify
method ofExpressionDomain
(#18472 by @Smit-create) -
Fixed the issue of cancel not expanding the product of irrational conjugates and added Tests (#18448 by @iamabhishek0)
-
Prevent creation of CC from changing the context of RealElement. (#18312 by @V1krant)
-
Changes in
Poly.__new__()
to make it handle simplified Matrix (#18159 by @Smit-create) -
interpolate
will no longer return nan whenx
is a supplied coordinate (#18030 by @smichr) -
interpolating_poly
will raise an error ifx
is not symbolic (#18030 by @smichr) -
interpolating_poly
will raise an error ifX
orY
depend onx
(#18030 by @smichr) -
interpolating-poly
will now use only the firstn
points inX
andY
(#18030 by @smichr) -
Added
KSY_precondition()
to test for the Kapur-Saxena-Yang precondition (#17974 by @ctsiagkalis) -
Added
get_KSY_Dixon_resultant()
and auxiliary methods for computing the KSY approach to Dixon's Resultant (#17974 by @ctsiagkalis)
-
-
printing
- the inverse hyperbolic functions now respect the
inv_trig_style
printer setting (#19235 by @eric-wieser)
-
Fixed numpy printer raising error for unevaluated numeric power. (#19170 by @sylee957)
-
Fixed IdentityFunction printing for LaTeX. (#19032 by @sylee957)
-
Added
parenthesize_super
option toLatexPrinter
. (#18256 by @JSS95 and @mcpl-sympy) -
Removing python2 support from PythonCodePrinter (#18381 by @Smit-create)
-
Added support for airy functions in the SciPyPrinter class. (#18908 by @OmarWagih1)
-
allowed ReprPrinter to maintain original expr order via turning ordering off (#18777 by @leerobert)
-
Fix lambdify with
Min
for arrays of more than one dimension (#18774 by @sbt4104) -
Fixed
MatMul
with complex coefficients raising error when printed. (#18744 by @sylee957)
-
fixes incorrect parenthesizes in latex print of integral (#18772 by @Ryand1234)
-
fixes nested differentiation problem in latex format (#18740 by @Ryand1234)
-
Added min and max options for printers to set a range for floating point numbers that can
be printed in fixed-point format. (#18477 by @mijo2) -
Removed deprecated
Ccodeprinter
(UseC89Printer
orC99Printer
instead). Deprecated since version1.1
(Issue : #12220). (#18392 by @risubaba) -
Removed deprecated
file
viewer option inpreview
. Deprecated since version0.7.3
(Issue: #7018) (#18392 by @risubaba) -
Removed deprecated
StringIO
viewer option inpreview
. Deprecated since version0.7.2
(Issue: #7083) (#18392 by @risubaba)
-
Fixed
Range
with symbols raising error when printed withLaTeX
. (#18418 by @sylee957) -
Added NumPy printing for several matrix expressions. (
ZeroMatrix
,OneMatrix
,FunctionMatrix
,HadamardProduct
,KroneckerProduct
,Adjoint
,DiagonalOf
,DiagMatrix
,DiagonalMatrix
) (#18351 by @sylee957 and @vighneshq) -
Added support for
FiniteSet
printing in mathml content markup. (#17545 by @sylee957) -
Added support for
Union
,Intersection
,Complement
, andProductSet
printing for mathml content markup. (#17545 by @sylee957) -
Added a new flag
perm_cyclic
for string, LaTeX, and pretty printers. (#18033 by @oscarbenjamin, @souravgl0, and @sylee957) -
LaTeX and pretty printer will print permutation in 2-line array notation when
perm_cyclic=False
. (#18033 by @oscarbenjamin, @souravgl0, and @sylee957)
- the inverse hyperbolic functions now respect the
-
series
-
Adds simplification to
limitinf() function of gruntz.py
resolvingValueError
(#19004 by @sachin-4099) -
Adds simplification to
limitinf() function of gruntz.py
resolvingValueError
(#18978 by @sachin-4099)
- Corrected docstrings related to latex in FormalPowerSeries (#18812 by @smitgajjar)
- Order(0) now returns an object of Order Type (#18629 by @iamabhishek0)
-
-
sets
- Added a new
DisjointUnion
class to compute the disjoint union of instances ofsympy.sets.sets.Set
(#18861 by @sava-1729)
-
Added is_finite_set property in class Range (#19016 by @sava-1729)
-
Added test case for sets with | operation (#18576 by @rashmi123456789)
-
Fixed bugs in
ComplexRegion.contains()
that could lead to incorrect results when membership is in fact undecidable or at least unknown. (#18308 by @gschintgen) -
Fixed minor issues in
Interval.contains()
(#18426 by @gschintgen) -
Fixed a bug in
FiniteSet
's union handler that could lead to some elements being "dropped" if their membership in the other set can't be determined. (#18356 by @gschintgen) -
Fixed
evalf()
forIntervals
andFiniteSets
having symbolic endpoints or containing symbolic elements. (#18251 by @gschintgen) -
Fixed
FiniteSet._complement()
forIntervals
andS.Reals
. Previously wrong results or exceptions could result from set differences involvingFiniteSets
containing non-reals or symbolic expressions. (#18218 by @gschintgen) -
Fixed and extended intersection handler for
Integer
-basedImageSets
. (#18200 by @gschintgen) -
added appropriate error message when infinite ranges are sliced (#17986 by @arun-y99)
-
Added an
is_subset
handler to check whether aRange
is included in aFiniteSet
. (#18137 by @gschintgen) -
Added a simple cache to
FiniteSet
in order to speed up some membership checks. (#18137 by @gschintgen) -
Fixed
Range.contains()
logic for symbolic values. (#18137 by @gschintgen) -
Fixed
Rationals.boundary
to beReals
. (is_open
andis_closed
now both returnFalse
.) (#18168 by @gschintgen) -
is_open
logic is improved. (#18168 by @gschintgen) -
Set now uses cooperative dispatch for binary operations so it is possible for non-Set Basic subclasses to override the behaviour of e.g.
a + b
where one ofa
orb
is an instance of Set. This also means that any non-Set Basic subclasses can not depend onExpr.__add__
to createUnion(a, b)
: if a class is not a subclass of Set and wants to define binary operations with Set it must do so explicitly in its own__add__
method. For classes depending on this this is not a backward compatible change. (#18116 by @oscarbenjamin) -
SetExpr._eval_func()
is fixed so thatImageSets
with linear maps involving complex numbers are now instantiated correctly. (#18062 by @gschintgen) -
The logic for the Set.is_subset method is made correct. This prevents incorrectly returning True or False but also means that the method returns None more often in cases where a determination should be possible. (#17848 by @oscarbenjamin)
-
There is a new
is_finiteset
property for sets which is a fuzzy bool indicating whether a set has a finite number of elements. (#17848 by @oscarbenjamin)
- Added a new
-
simplify
-
collect
is more careful not to make invalid collection (e.g. factoring Rational out of a power's exponent) (#19165 by @smichr) -
fu
routineTR11
has a helper that allows double angle reduction in fractions (#18635 by @smichr and @V1krant) -
Fixing bug in cancel function (#18107 by @namannimmo10)
-
Fixed IndexError using cse with RootOf (#18273 by @sachin-4099)
- Fix wrong results from
sqrtdenest()
with expressions containingI
. (#18042 by @asmeurer and @oscarbenjamin)
-
-
solvers
- Use matrix exponential to solve homogeneous systems of first order ODEs with constant coefficients. (#18720 by @mijo2 and @oscarbenjamin)
- add a new reduced_separable method (#19122 by @RituRajSingh878)
-
Rewrite equation as expression in
solveset
. (#18670 by @mohitacecode)
-
Updated docstring of public functions in polysys (#18641 by @mijo2)
-
Fixed NoneType Error Bug in solvers.solvers.unrad() (#18324 by @sachin-4099)
-
Fixed
nonlinsolve
's handling of intersections and complements in the final result. (#18308 by @gschintgen) -
Now
dsolve
can solve linear non-homogeneous ODEs involving hyperbolic functions when using the method of undetermined coefficients. (#18410 by @Mohitbalwani26) -
Fixed
checkodesol
for some cases when the solution returned byvariation of parameters
was correct butchekodesol
couldn't simplify it. (#18376 by @Mohitbalwani26) -
Fixed
dsolve
for some cases of linear non-homogeneous ODEs when using the method of undetermined coefficients. (#18309 by @Mohitbalwani26) -
Changed return type from None to [], as in #18199 the return type of nth_root was changed when all_root = True and no root exists (#18285 by @abhinav28071999)
-
ode.py - solve function is used to express the equation in factorised form (#18214 by @Mohitbalwani26 and @smichr)
-
Fixed a bug in
diophantine
where negative coefficients could lead to incomplete solutions in conjunction withpermute=True
. (#18200 by @gschintgen) -
The diophantine solver no longer raises for unsympified inputs. (#18201 by @oscarbenjamin)
-
fixed a bug in
diophantine
when usingpermute=True
which caused incomplete permutations to be returned (#18189 by @abhinav28071999) -
diophantine.py - fixed bug where AttributeError was raised in some cases. (#18167 by @Mohitbalwani26)
-
Solving of hyperbolic equations improved in solveset. (#14053 by @gschintgen, @ishanaj, @oscarbenjamin, and @oscargus)
-
stats
-
Allowing the user to define custom distributions (#19123 by @Smit-create)
-
Added coskewness (#18935 by @Smit-create)
-
Added sampling methods for discrete random variables (#18289 by @Smit-create)
-
Added median function. (#18300 by @Smit-create)
-
Updated some documentation in NormalGamma and JointRV functions (#18589 by @akash9712 and @mijo2)
-
DiscreteUniform
raises ValueError for duplicate args (#18614 by @smichr and @Smit-create) -
sympify expression in compute_expectation (#18577 by @Smit-create)
-
Added moyal distribution (#18446 by @Smit-create)
-
Fixes Wrong Integral result from SingleContinuousPSpace (#18336 by @Smit-create)
-
Fixed domain bug in probability method of ContinuousPspace in
sympy/stats/crv.py
(#18311 by @Smit-create) -
Added Bernoulli Process in
sympy/stats/stochastic_process_types.py
(#18173 by @Smit-create) -
Added
HermiteDistribution
insympy/stats/drv_types.py
(#18233 by @Smit-create) -
Added PowerFunction in
sympy/stats/crv_types.py
(#18152 by @Smit-create) -
Reciprocal distribution has been added to
sympy.stats
(#18131 by @abhinav28071999) -
Added levy distribution in sympy/stats/crv_types.py (#18096 by @Smit-create)
-
Added test of levy distribution in sympy/stats/tests/test_continuous_rv.py (#18096 by @Smit-create)
-
Required change in sympy/stats/init.py (#18096 by @Smit-create)
-
-
tensor
-
Fixed a bug where tensor contractions in calls to
replace_with_arrays
would fail to apply the metric. (#19091 by @cjayross) -
Fix Idx object to accept non-integer bound (#18605 by @Smit-create)
-
Implemented derivatives with respect to symbols in tensor expressions (#18093 by @joha2 and @Upabjojr)
-
Implemented derivatives with respect to tensors in tensor expressions (#18093 by @joha2 and @Upabjojr)
-
Added _eval_simplify method for class ImmutableDenseNDimArray (#18369 by @iamabhishek0)
-
Fixing bug in replacing indices in PartialDerivative tensor objects. (#18242 by @Upabjojr)
-
Tensor module: refactory to allow mixing PartialDerivative and TensAdd. (#18224 by @Upabjojr)
-
Fix PartialDerivative operator to correctly handle the valence (covariant/contravariant) of the deriving variable. (#18166 by @Upabjojr)
-
-
utilities
-
Overflow condition and negative argument for 'ibin' added (#18973 by @Arpan612)
-
iterables -
uniq
will now raise a RuntimeError if a size change of the sequence is detected (#18835 by @smichr) -
iterables
now includesis_palindromic
to check if a sequence (or slice thereof) is palindromic (#18807 by @smichr) -
iterables:
generate_derangements
now handles unsorted input correctly (#18810 by @smichr) -
Code for the test runner is moved to a new
sympy.testing
package. (#18095 by @oscarbenjamin)
-
-
other
-
Replace inspect.getargspec with getfullargspec (#18784 by @sethtroisi)
-
Updated README to include details about how to install SymPy using PyPI (#18518 by @mijo2)
-
Corrected an inconsistency in the "Advanced Expression Manipulation" section of the tutorial. (#18287 by @Smit-create)
-
Submodule names are no longer imported with
from sympy import *
. They can still be imported directly likefrom sympy import core
or accessed likesympy.core
, or likesys.modules['sympy.simplify']
for modules that share names with SymPy functions. (#18245 by @oscarbenjamin) -
README.rst - Added the codecov Badge in readme.rst (#18266 by @Mohitbalwani26)
-
updated the README.rst and doc/README.rst with links to the SymPy Documentation Style Guide. (#17922 by @lglattly)
-
The following people contributed at least one patch to this release (names are given in alphabetical order by last name). A total of 117 people contributed to this release. People with a * by their names contributed a patch for the first time for this release; 73 people contributed for the first time for this release.
Thanks to everyone who contributed to this release!
- abhinav28071999*
- Abhishek*
- adhoc-king
- aditisingh2362*
- Harsh Agarwal
- Sachin Agarwal
- Akash Agrawall*
- alejandro*
- Abhinav Anand
- Mohit Balwani
- BasileiosKal*
- Oscar Benjamin
- Francesco Bonazzi
- Ebrahim Byagowi*
- Thomas A Caswell*
- Ondřej Čertík
- Chanakya-Ekbote*
- Arpan Chattopadhyay*
- Riyan Dhiman*
- Bradley Dowling*
- erdOne*
- faizan2700*
- Smit Gajjar*
- Tim Gates*
- Naman Gera*
- Gina*
- Lauren Glattly
- Sourav Goyal*
- gregmedlock*
- Michal Grňo*
- Bhaskar Gupta*
- Anubhav Gupta*
- Mohit Gupta*
- Oscar Gustafsson
- Johan Guzman*
- Johannes Hartung*
- Ashutosh Hathidara*
- Jean-Luc Herren*
- Thomas Hickman
- Jerry James*
- Shubham Kumar Jha
- Milan Jolly*
- Lucas Jones
- Jonty16117*
- Ishan Joshi
- Vasileios Kalos*
- kamimura*
- Hugo van Kemenade
- Dhruv Kothari*
- Amit Kumar
- Akira Kyle*
- Steven Lee
- S.Y. Lee
- Stephen Loo
- Smit Lunagariya*
- Nikhil Maan
- Colin B. Macdonald
- Vikrant Malik*
- Maria Marginean*
- Alex Meiburg*
- Dhruv Mendiratta*
- Aaron Meurer
- mohit*
- Jason Moore
- Sandeep Murthy*
- Namannimmo*
- Neil*
- Julien Palard*
- ILLIA PCHALINTSAU*
- prshnt19*
- Psycho-Pirate*
- Tomasz Pytel
- Moses Paul R*
- Jaime R*
- rbl*
- Jaime Resano*
- risubaba*
- Riyan*
- Faisal Riyaz
- Matthew Rocklin
- Calvin Jay Ross*
- Denys Rybalka
- Hardik Saini*
- sbt4104*
- Gilles Schintgen
- Nico Schlömer
- Rashmi Shehana*
- Vighnesh Shenoy
- Jason Siefken
- Ritu Raj Singh
- Gagandeep Singh
- Rajiv Ranjan Singh
- slacker404*
- Chris Smith
- Jisoo Song*
- Vatsal Srivastava*
- Kalevi Suominen
- Divyanshu Thakur
- Martin Thoma*
- Shubham Thorat*
- TitanSnow
- tnzl*
- Konstantin Togoi
- Seth Troisi*
- Charalampos Tsiagkalis
- Georgios Giapitzakis Tzintanos*
- V1krant*
- Akash Vaish
- Zlatan Vasović*
- Saanidhya vats*
- vezeli*
- Omar Wagih*
- Ethan Ward
- Eric Wieser*
- wuyudi*
- Srinivasa Arun Yeragudipati
- Velibor Zeli
7af1e11e9fcb72362c47a481dc010e518cfcb60a594d1ee8bd268f86ea7d6cbf sympy-1.6-py3-none-any.whl
9769e3d2952e211b1245f1d0dfdbfbdde1f7779a3953832b7dd2b88a21ca6cc6 sympy-1.6.tar.gz
036dcd3d69ffcb5b257491ee727b30139b49340af8a56fac96243607179d21d5 sympy-docs-html-1.6.zip
a1e35cdfc62a30d912b172c0bcc2f5630c79d43052a864a3267386a892ac483a sympy-docs-pdf-1.6.pdf