Release Notes for 1.8 - sympy/sympy GitHub Wiki
These are the release notes for SymPy 1.8. You can also find release notes for previous versions.
SymPy 1.8 was released on 9th April 2021.
This version of SymPy has been tested on Python 3.6, 3.7, 3.8, 3.9, 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.8 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
Highlights
There are many changes in 1.8 (see below).
Backwards compatibility breaks and deprecations
Please manually add any backwards compatibility breaks or deprecations here, in addition to the automatic listing below.
-
assumptions
-
parsing
Changes
-
assumptions
-
Q.infinite
now correctly evaluates toTrue
foroo
,-oo
, andzoo
. (#21242 by @JSS95) -
Assumption predicates now correctly evaluates to
None
forS.NaN
. (#21242 by @JSS95)
-
Relational objects do not need to be wrapped by
Q.is_true
to be asked or refined anymore (#21198 by @JSS95) -
Q.is_true
wrapping overAppliedPredicate
now just return the argument. (#21152 by @JSS95) -
refine arg(x) when x is real and nonzero (#21055 by @zanzibar7)
-
assumptions/relation
module is introduced. This module implements binary relation as predicate. (#20965 by @JSS95) -
AskHandler()
,register_handler()
andremove_handler()
are deprecated. Handler now must be multipledispatch instance. (#20835 by @JSS95) -
Predicate
now uses a single handler which is multipledispatch instance. (#20656 by @JSS95 and @YounghyeonKim) -
Predicate
can now take multiple arguments. (#20656 by @JSS95 and @YounghyeonKim) -
Predicate("...")
now returnsUndefinedPredicate
instance. To define a predicate, you must make a subclass ofPredicate
. (#20656 by @JSS95 and @YounghyeonKim)
-
-
calculus
- Using
maximum
with a piecewise expression over a domain no longer fails due to a bug fix inPiecewise.as_expr_set_pairs
. (#20121 by @Maelstrom6)
- Using
-
codegen
-
allowing for multi-dimensional arrays as arguments/locals in c code generation (#21190 by @rols121)
-
create_expand_pow_optimization is now customizable with respect to requirement on base. (#20788 by @bjodah)
-
Support flattening of elementwise additions of array expressions. (#20841 by @Upabjojr)
-
Fixes to array-expressions in order to properly work with ZeroArray and ZeroMatrix. (#20834 by @Upabjojr)
-
Fixing matrix expression recognition from array-expressions. (#20834 by @Upabjojr)
-
Minor fixes to the way the AST of array expressions is built (#20826 by @Upabjojr)
-
Add normalization of CodegenArrayDiagonal when it's nested with CodegenArrayPermuteDims and CodegenArrayContraction. (#20627 by @Upabjojr)
-
Increased support for the normalization of array expressions and permutations of indices. (#20203 by @Upabjojr)
-
parse_matrix_expression( ) is now able to parse traces of matrices. (#20193 by @Upabjojr)
-
-
combinatorics
- Added a section to the permutation docs about containment in permutation groups. (#20480 by @wsdookadr)
-
concrete
- A bug leading to incorrect evaluation of a summation of an exponential function was fixed. (#20531 by @BhaskarJoshi-01 and @oscarbenjamin)
-
core
-
Fixed a bug in
Pow._eval_nseries
that addedOrder
terms to exact expansions (#21078 by @0sidharth) -
Fixed a bug in
Expr.round
that could lead to infinite recursion inintegrate
. (#21053 by @Nisarg-Chaudhari) -
Removed deprecated
ClassRegistry
(#20896 by @0sidharth) -
get_integer_part
no longer has a threshold on the approximation to closest integer based on difference, allowingfloor
to give more accurate results for smallerevalf
precisions also (#20863 by @0sidharth) -
A bug causing
match
to fail for expressions with different signs was fixed. Previously this resulted insolve
raising an exception for some inputs. (#20842 by @hailcpy) -
Make S(0.0) == S.false return False (#20801 by @AaronStiff)
-
gcd correctly handles unevaluated Mul (#20700 by @AaronStiff)
-
Fixed a bug leading to infinite recursion in the old assumptions under
evaluate(False)
. (#20721 by @0sidharth) -
Fixed
_eval_is_zero()
functionality when imaginary numbers are involved. (#20663 by @prince776)
- Kind classification of objects is introduced. This feature is experimental, and can be replaced or deleted in the future. (#20549 by @JSS95)
-
Make class Eq with sets as arguments work with simplify(). (#20438 by @oscarbenjamin and @sidhu1012)
-
Fixed a few broken cases of expr.is_integer (#20322 by @coproc)
-
-
functions
-
riemaan xi function (#20901 by @abh2k and @mayankray2020)
-
Added
nseries
expansion for besselj and bessely (#20886 by @0sidharth) -
Fixed leading term calculation of
sin
functions to handle angles outside(-pi, pi)
(#21042 by @0sidharth) -
Added
aseries
expansion to error functions (#20888 by @0sidharth) -
Changes
_eval_nseries
ofAbs
to no longer return aPiecewise
(#20754 by @0sidharth) -
Modified
_eval_nseries
to handle infinity and added_eval_as_leading_term
infloor
andceiling
(#20803 by @0sidharth) -
Added Generalized Incomplete, Generalized Regularized and Central Beta functions (#20569 by @naveensaigit)
-
Added
_eval_nseries
support tosign
(#20775 by @0sidharth)
-
geometry
- Fix
AssertError
for vertical tangent (#21221 by @hirenchalodiya1)
- Fix
-
integrals
-
Fixed a bug that led to
RecursionError
in integrals involving hyperbolic functions. (#21250 by @akshanshbhatt) -
The heurisch integration method was made faster by improvements in the sparse linear systems solver. (#20989 by @oscarbenjamin)
-
A bug leading to incorrect results when integrating Piecewise expressions where a condition simplifies to True was fixed. (#20518 by @kc611)
-
-
logic
simplify_logic
faster in most cases, especially for larger expressions. (#20245 by @oscarbenjamin and @oscargus)
-
matrices
-
Fixed a bug that led to the wrong derivative result in matrix expressions. (#21208 by @akshanshbhatt)
-
The eye and zero functions have been made much faster for large matrices. (#21006 by @hyadav2k)
-
Added two new functions upper_triangular and lower_triangular, that return upper and lower triangular parts of a matrix. (#20911 by @ks147)
-
Minus one, integers, rational numbers multiplied with MatAdd is automatically distributed. (#20741 by @sidhu1012)
-
Added function returning Wilkinson matrix (#20922 by @ks147)
-
Implemented Singular Value decomposition for matrices (#20761 by @ks147)
-
Implemented Upper Hessenberg Decomposition for a matrix (#20829 by @ks147)
-
Added function to calculate Generalized Schur Complement for Block Matrices (#20406 by @naveensaigit)
-
Added functions to compute LDU, UDL and LU decompositions for Block Matrices (#20406 by @naveensaigit)
-
Fixed issues with dot product for
Matrix.orthogonalize
with complex vectors. (#20342 by @sylee957) -
Fixed zero division issues for
Matrix.QRdecomposition
with zero columns coming first than nonzero columns. (#20342 by @sylee957)
- Added a function to compute the permanent of a matrix (#20377 by @naveensaigit)
-
Changed behaviour of eq() of class DenseMatrix (#20175 by @sidhu1012)
-
det
has a new option'gauss-ge'
which is much faster in many cases (#21052 by @hyadav2k)
-
-
ntheory
-
Added documentation of ecm and qs functions (#20820 by @abh2k and @mayankray2020)
-
Fixed a bug in the
is_gaussian_prime
function for python complex numbers (e.g.1+1j
). (#20912 by @techiepriyansh) -
primerange
now accepts a single argument i.e.,primerange(input_arg)
is valid and is same asprimerange(2, input_arg)
. (#20807 by @mayankray2020) -
Added motzkin numbers (#20670 by @abh2k and @mayankray2020)
-
-
parsing
-
Fix
parse_expr
parsing of expressions with methods when using theimplicit_multiplications
transformation. (#21021 by @asmeurer) -
Include the transformed code in the error message when the evaluation in
parse_expr
fails. (#21021 by @asmeurer)
-
Extended the LaTeX parser with support for complex conjugates (via
\overline{...}
). (#20900 by @costika1234) -
Latex parser does not evaluate
sqrt
expressions anymore. (#20497 by @kristianmitk and @taskbase)
-
-
physics.continuum_mechanics
-
physics.optics
- Fixed bugs related to basic operations on
TWave
(#20967 by @0sidharth)
- Fixed bugs related to basic operations on
-
physics.quantum
-
physics.units
-
Fix bug when input argument to a function is an integer (#21089 by @mgreminger)
-
Change default behavior for functions (all function arguments must be dimensionless by default) (#21089 by @mgreminger)
-
sin, cos, tan, cot, sec, and csc functions may have a dimensionless or angle input argument (#21089 by @mgreminger)
-
Exponents must now be dimensionless (#21089 by @mgreminger)
-
Constants such as pi and E are now treated as dimensionless (raised exception previously) (#21089 by @mgreminger)
-
Numbers with an imaginary component are now treated as dimensionless (raised exception previously) (#21089 by @mgreminger)
-
Fixed a bug with derived units and dimensions in check_dimensions. (#20301 by @schymans)
-
Fix bug in convert_to returning wrong units in some cases where the linear equation system between canonical units is unsolvable. (#20442 by @Upabjojr)
-
-
physics.vector
- Fix documentation for v1pt_theory (#21050 by @oliverlee)
- Introduced new methods on ReferenceFrame:
.orient_axis()
,.orient_explicit()
,.orient_body_fixed()
,.orient_space_fixed()
, and.orient_quaternion()
..orient()
calls out to each new method and it is recommended to use the new methods. (#20318 by @moorepants, @sidhu1012, and @sksingh1202)
-
Added .xreplace() to Vector Class. (#20446 by @sidhu1012)
-
Added .xreplace() to Dyadic Class. (#20446 by @sidhu1012)
-
Added .evalf() to Vector class (#20396 by @oscarbenjamin, @Saanidhyavats, and @sidhu1012)
-
Added .evalf() to Dyadic class (#20396 by @oscarbenjamin, @Saanidhyavats, and @sidhu1012)
-
plotting
- Added handling for
OverflowError
(when plotting functions likeexp(1/x)
). (#20939 by @techiepriyansh)
- Added handling for
-
polys
-
Added internal representation as both dense and sparse matrix (#21146 by @ks147 and @oscarbenjamin)
-
A new sparse implementation of DomainMatrix is added. (#20780 by @oscarbenjamin)
-
make is_disjoint strict so that inequalities evaluated with solve() return consistent results (#20906 by @AaronStiff)
-
The DomainMatrix class has moved from
sympy.polys.domainmatrix
tosympy.polys.matrices
and should now be imported asfrom sympy.polys.matrices import DomainMatrix
. (#20759 by @oscarbenjamin) -
A new polys FiniteExtension domain is added. (#20631 by @oscarbenjamin)
- numberfields: implemented new algorithm for
primitive_element
in caseex=True
. (#20274 by @jksuom and @oscarbenjamin)
-
added boilerplate index method for FracField (#20503 by @wsdookadr)
-
Use assumption system instead of structural equality check in
__bool__
method ofExpression
domain element (fixing cases wherePoly(...).is_zero
would incorrectly returnFalse
) (#20428 by @ehren)
-
-
printing
-
The pretty printer was made faster when printing large sequences (e.g. tuples, sets etc). (#21169 by @oscarbenjamin)
-
Fixed a bug which led to latex printing error in singularity function expressions. (#21171 by @akshanshbhatt and @moorepants)
-
Replaced the Theano printer with an Aesara printer (#21087 by @brandonwillard)
-
Symbols with Unicode character names and no underscores, like
ω0
now properly pretty print subscripts. (#20916 by @costika1234) -
Fix the printing of the vertical bar in
ImageSet
,ConditionSet
, andComplexRegion
so that it is the full height in the pretty and LaTeX printers. (#20868 by @asmeurer) -
Fix the tag for the degree of a root with a rational base in MathML output. (#18699 by @czgdp1807 and @wyattpeak)
-
irrational powers are no longer printed with square root sign, they are printed as fractional powers (#20639 by @0sidharth)
-
Allow spreading assignments across multiple symbols when printing multi-member objects. (#19973 by @micahscopes)
-
Support various array constructor types when printing arrays to GLSL. (#19973 by @micahscopes)
-
Fixes a bug when printing negative expressions to GLSL with operators printed as functions. (#19973 by @micahscopes)
-
Support a custom
0
substitution for printing expressions representing various GLSL types. (#19973 by @micahscopes) -
make cxxcode correctly print the first argument of Min/Max functions (#20558 by @FFroehlich)
-
-
sets
-
Added basic denesting functionaility for sets of the form
ConditionSet(x, Contains(x, ...))
. (#20121 by @Maelstrom6) -
ConditionSet.contains(x)
now returnsFalse
ifx
is not in the base set (even if its substitution into the condition will cause an error). (#20121 by @Maelstrom6) -
FiniteSet.evalf
with a subs argument now does the substitution. Previously, the argument was ignored. (#20321 by @Maelstrom6) -
Add
.simplify
toFiniteSet
. (#20666 by @sidhu1012) -
Make 'is_subset' work for ProductSet (#20438 by @oscarbenjamin and @sidhu1012)
-
changed behavior of Rationals.contains(float) to indeterminate (#20565 by @gopalamn)
-
tests modified to include new behavior (#20565 by @gopalamn)
-
.evalf()
precisions withx
andFiniteSet(x)
is same now. (#20451 by @sidhu1012)
-
-
simplify
- Fix simplify calls sympify without rational parameter (#21019 by @eagleoflqj)
-
solvers
-
Fixed a bug in
solve
that expanded hyperbolic function constants to equivalentexp
form. (#21250 by @akshanshbhatt) -
Handle x**r=0 case in invert_complex (#21071 by @eagleoflqj)
-
Fixed a bug in solveset, which led to infinite recursion for solving some expressions involving radicals. (#21032 by @almighty123789)
-
The new sparse DomainMatrix implementation is used in linsolve to make it much faster when solving large sparse systems of linear equations. (#20780 by @oscarbenjamin)
-
Modified symbols sorting in solvers._solve_system to ensure solve and linsolve solve the same way (#20928 by @AaronStiff)
-
Added solver for 2nd order nonlinear autonomous ODE. (#20696 by @naveensaigit)
-
speed improvement in a substep of rsolve_hyper (when computing constant solutions to constant coefficient recurrences). (#20426 by @ehren)
-
Fixed incorrect solutions from rsolve for higher order recurrences (#20440 by @naveensaigit)
-
-
stats
-
Refactory and simplification of sampling backends for random variables. (#20494 by @czgdp1807 and @Upabjojr)
-
Expectation can now be calculated across multiple Uniform RVs evaluating to zero (#20771 by @kc611 and @oscarbenjamin)
-
Implemented Matrix Student's t-distribution (#20651 by @ks147)
-
Fixed simplification bug in Stochastic Processes by introducing abstract Distribution class (#20626 by @0sidharth and @czgdp1807)
-
API changed for
StochasticProcess.distribution
which now expects a timestamp argument instead ofRandomIndexedSymbol
object. (#20626 by @0sidharth and @czgdp1807) -
Implemented FlorySchulz Distribution (#20619 by @mayankray2020)
-
implemented LogCauchy Distribution (#20632 by @mayankray2020)
-
Implemented Logit-Normal probability distribution (#20607 by @ks147)
-
Fixes
cdf
computation of Discrete random variables by using integer limits (#20055 by @abhaydhiman and @czgdp1807) -
Added 2 new distributions in frv_types. (#20514 by @naveensaigit)
-
added support for fundamental matrix for regular markov chains (#20190 by @czgdp1807 and @povinsahu1909)
-
Added support for multiple RandomIndexedSymbols in DiscreteMarkovChain (#20213 by @naveensaigit)
-
-
tensor
- Introduced objects ArraySymbol and ArrayElement for array expressions equivalent to MatrixSymbol and MatrixElement in the matrix expression module. (#20943 by @Upabjojr)
-
Add class ZeroArray for array expressions of zero-valued elements. (#20827 by @Upabjojr)
-
Make Array differentiation(
derive_by_array
) work with non sympy expressions. (#20676 by @sidhu1012) -
Added tensordiagonal( ) function to perform diagonalization of array expressions. (#20465 by @Upabjojr)
- Adding an array with any other type now consistently gives NotImplemented. (#20223 by @sidhu1012)
-
utilities
-
Added official support for using CuPy to GPU accelerate lambdify functions. (#21155 by @thomasaarholt)
-
Added Replacer class to simplify the creation of replacement expressions with MatchPy. (#20794 by @Upabjojr)
-
Added tests for optional parameter in MatchPy patterns. (#20751 by @Upabjojr)
-
Added string printers for MatchPy-compatible wildcards in sympy.utilities.matchpy_connector (#20649 by @Upabjojr)
-
Added WildDot, WildPlus and WildStar classes to MatchPy connector. These classes correspond to the dot, dot-plut and dot-star expressions in regular expression, but operate on SymPy expression trees and are aware of associative and commutative properties, features supported through the MatchPy library. (#20612 by @Upabjojr)
-
minlex no longer accepts is_set or small arguments (#20433 by @MarkCBell)
-
minlex and least_rotation now accept
key=
arguments similar tosorted
. (#20433 by @MarkCBell)
-
-
vector
- Fixed a bug with integral over ImplicitRegion objects (#20867 by @almighty123789)
-
other
- Expanding documentation to include all class members with docstrings (#20984 by @paulmand3l)