Release Notes for 1.4
These are the release notes for SymPy 1.4. You can also find release notes for previous versions.
SymPy 1.4 was released on April 9, 2019.
This version of SymPy has been tested on Python 2.7, 3.4, 3.5, 3.6, 3.7 and PyPy. See our Python version support policy for more information on when we plan to drop support for older Python versions. SymPy 1.4 will be the last version of SymPy to support Python 3.4, which has reached its end of life.
Install SymPy with
pip install -U sympy
or if you use Anaconda
conda install sympy
There are many changes in 1.4 (see below). Some of the highlights are
-
Logic expressions with relations can now be simplifed in a better way which has impact on e.g. simplification of piecewise expressions
-
The MathML Presentation printer has seen a major improvement with support configuration and about a hundred new functions.
-
Union
andIntersection
have been improved to, among other improvements, support Python sets. -
The test procedure has been changed to include code coverage and code quality checks leading to a number of issues being identified and removed.
-
Unicode support, especially for Python 2.7, has been improved.
-
subs
andSubs
have been improved in a number of ways. -
SymPy objects now renders as LaTeX automatically in Jupyter notebooks.
init_printing
is still required to LaTeX render non-SymPy objects such as lists of expressions or Python ints.
Please feel free to manually add any major changes for this release here, in addition to the automatic change listed below.
Please manually add any backwards compatibility breaks or deprecations here, in addition to the automatic listing below.
-
Deprecate keyword arguments 'rows' and 'cols' for jordan_block #16208.
-
Deprecate support for same primes in rsa_public_key and rsa_private_key #16172.
-
Deprecate _cache_is_diagonalizable and _cache_eigenvects #16163.
-
sympy.physics.quantum.matrixutils uses deprecated np.matrix #15563.
-
Deprecate .data property in favor of the new .replace_with_arrays method in the tensor module #15278.
-
The deprecated unitsystems module has been removed.
-
The deprecated TIDS class have been removed.
-
algebras
-
Added documentation page (#15917 by @Geektrovert and @whitesource-bolt-for-github[bot])
-
Improve docstring for
from_axis_angle
,from_rotation_matrix
,add
,mult
, andpow
inquaternion.py
(#15750 by @GaurangTandon) -
fix sign mistake in Quaternion.to_rotation_matrix method (#15349 by @2torus)
-
-
assumptions
-
calculus
-
fix periodicity of exponential of form exp(I*x) (#16068 by @FrackeR011)
-
Added is_convex (#15776 by @czgdp1807)
-
Improve docstring for
function_range
,not_empty_in
,_periodicity
, andperiodicity
inutil.py
(#15658 by @GaurangTandon) -
Improve docstring for
continuous_domain
inutil.py
(#15620 by @GaurangTandon) -
Fixed a bug in the iteration over the set of critical points (#15537 by @normalhuman)
-
-
categories
-
codegen
-
Fixed scaling of Octave/Matlab's incomplete gamma function. (#16534 by @cbm755)
-
Improvements in parsing of indexed expressions into codegen array utilities. (#15611 by @Upabjojr)
-
Allow permutation of dimensions to be sunk into the expression tree. (#15490 by @Upabjojr)
-
Parser in array utils now supports multiple Kronecker deltas. (#15489 by @Upabjojr)
-
Fixing bug in permutation of dimensions. (#15480 by @Upabjojr)
-
Added classes to support generation of array operations in printers. (#15427 by @Upabjojr)
-
Fix wrong result in create_expand_pow_optimization() (#15338 by @zachetienne)
-
-
combinatorics
-
Fixed the input of FpGroup for trivial case (#16083 by @fchapoton)
-
Elementary and polycyclic groups has been added to perm_groups.py (#16248 by @divyanshu132)
-
PermutationGroup.is_normal
did not perform a check if the group that is tested to be a normal subgroup is even a subgroup. (#15800 by @FabianBall) -
When the identity group (a
PermutationGroup
that is generated by the identity permutation) was tested to be a normal subgroup of any other group,PermutationGroup.is_normal
gave the incorrect result (False
instead ofTrue
). (#15800 by @FabianBall)
-
-
concrete
-
Avoid infinities in _eval_sum_hyper by simplifying before substitution. (#15990 by @divyanshu132)
-
bound_symbols
returns the bound symbols of the expr (#15300 by @smichr) -
Sum returned by
gosper_sum
is checked for singularities caused due to denominator and correct sum at that point is returned as a Piecewise. (#14132 by @jashan498) -
Sum.dummy_eq added to allow comparisons of Sums that have a dummy symbol in them (#15239 by @smichr)
-
core
-
count_ops
no longer handles objects with strings in their.args
(all elements of.args
for SymPy objects should beBasic
subclasses). (#15121 by @asmeurer and @smichr) -
Matrices are now handled in Add/Mul using postprocessors. (#15948 by @asmeurer and @smichr)
-
The experimental
_constructor_postprocessor_mapping
API no longer applies postprocessors from subexpressions. Note that this API is experimental and may change or be removed in a future version of SymPy without deprecation. (#15948 by @asmeurer and @smichr) -
Replace with more than one symbol is exact unless
exact
is explicitly made False (#16322 by @smichr) -
Improve compatibility for unicode strings (#16096 by @divyanshu132 and @smichr)
-
Improve of unicode strings by subs in python 2 (#16205 by @gaetano-guerriero)
-
Derivative with
count == wrt
now responds to subs (#16171 by @RituRajSingh878) -
Removed special cache for integers and used standard cache. (#15803 by @debugger22 and @NoumbissiValere)
-
Improved Unicode text handling by subs (#16093 by @supreet11agrawal)
-
Compatibility - as_int now rejects (by default) non-literal integer input. This means many number theory functions now raise TypeError on integral float inputs like
7.0
. (#16081 by @smichr) -
The
Relational
propertycanonical
now gives the same result in more cases which is helpful in some other methods. (#16004 by @oscargus) -
Replace np.asscalar in sympify (#16064 by @divyanshu132)
-
Relationals now have a property
negated
, which returns the opposite to the relation, similar to~
. (#15924 by @oscargus) -
Fix
is_zero
becomingFalse
on some expressions withAdd
. (#15875 by @smichr and @sylee957) -
UndefinedFunction class modified to give correct results to f.name for functions of type
Function('f')
(#15460 by @czgdp1807) -
replace
no longer accepts string inputs. This fixes some performance issues that occurred when callingreplace
with non-SymPy inputs such as Python functions. (#15769 by @asmeurer) -
Fixed a bug in
mod
(#15599 by @rationa-kunal and @smichr) -
sqrt(I)
is left unchanged instead of being rewritten to(-1)**(1/4)
(#15668 by @AnimeshSinha1309) -
Substitution of powers of symbols is applied to those symbols as well (#15565 by @normalhuman)
-
Number.__divmod__
now works like the builtin divmod for negative numbers (#15567 by @FrackeR011) -
Fixed a bug in the creation of higher order derivatives that cannot be evaluated. (#15519 by @normalhuman)
-
Fixed a bug in the substitution of powers of a real variable. (#15535 by @normalhuman)
-
Fixed a bug in evaluation of sums with floating-point zeros. (#15514 by @normalhuman)
-
Replaced
_gcdcache
withlru_cache
innumbers.py
(#15453 by @FrackeR011) -
Increased size of
lru_cache
from 100 to 1024 (#15453 by @FrackeR011) -
Subs involving changing
UndefinedFunction
toFunction
inDerivative
wrt variables will now create aSubs
instance (#15049 by @smichr) -
Error message for differentiation wrt bad variable no longer raised if the count is 0 and no longer refers to the count (#15049 by @smichr)
-
Error message for differentiation wrt variable that has a negative count (#15049 by @smichr)
-
Derivative
hascanonical
property which returnsDerivative
withvariable_count
canonically sorted (#15049 by @smichr) -
Derivative.variables
is not a reliable way to see which are the variables of differentiation: it gives an expanded list of those variables, e.gf(x,y).diff(x,2,y).variables -> (x,x,y)
or raises an error if some order of differentiation is symbolic, e.g.f(x).diff(x,y).variables -> TypeError
(#15049 by @smichr) -
Derivative
has_wrt_variables
which lists, in order, the variables of differentiation, even if the count is symbolic. (#15049 by @smichr) -
Defined function and non-elementary derivatives (like
Derivative(f(g(x)), x)
) give False for_diff_wrt
(#15049 by @smichr) -
Subs involving
Subs
now give a result that should be the same whether doit is applied before or after the subs, e.g.Subs(x*y, x, x + 1).subs(x, y).doit() == Subs(x*y, x, x + 1).doit().subs(x, y)
(#15049 by @smichr) -
A change of symbols is now possible with Subs so
Subs(x, x, 1).subs(x, y) -> Subs(y, y, 1)
(#15049 by @smichr) -
Function.fdiff
returnsSubs
less often, e.g.f(g(x)).diff(x)
no longer creates aSubs
instance (#15049 by @smichr) -
Expr
has a default attributeis_scalar=True
which makesExpr().diff(Expr()) == 1
(#15049 by @smichr) -
Bug involving derivatives of non-commutative expressions is fixed (#15049 by @smichr)
-
Mul
now implements the nth derivative in terms of multinomials (#15049 by @smichr) -
piecewise_fold
is canonical wrt ordering of finalPiecewise
arguments (#15049 by @smichr) -
Piecewise
uses information fromEq
orAnd
conditions to simplify the corresponding expression, e.g.(f(x), Eq(x, 0)) -> (f(0), Eq(x, 0))
(#15049 by @smichr) -
And
will simplify args of typeEq
andNe
when simple opportunities are presented, e.g.And(Eq(x, 0), Eq(x, y)) -> And(Eq(x, 0), Eq(y, 0))
(#15049 by @smichr) -
dummy_eq
now compares expressions with canonical dummy variables (#15300 by @smichr) -
canonical_variables
now returns non-clashing Symbols with simple names (#15300 by @smichr) -
The new part of subs args are now sympified as in 1.0 (#15371 by @smichr)
-
Added proper passing of
H0
in publicrewrite
method (#15314 by @arunsin019 and @arunsin997) -
Added parameter in all public
_eval_rewrite_as_Piecewise
methods (#15314 by @arunsin019 and @arunsin997) -
kwargs are now passed to all rewrite methods (#15317 by @smichr)
-
Fixed bug that occurred when integrating certain functions over an interval (#15295 by @apalmer1377)
-
Derivative._sort_variable_count
is more canonical and preserves the order of derivatives and symbols when necessary (#15241 by @smichr) -
factor(F(x)*F(y) - F(y)*F(x)) != 0
now forF = Function('F', commutative=False)
(#15232 by @raineszm) -
sympify
keyword arguments now work properly when sympifyingNumPy
types (#15099 by @asmeurer) -
Application
will recurse into args to do subs (#15222 by @smichr) -
Subs.has
gives structural (not mathematical) answer (#15222 by @smichr) -
Subs
hash includes null subs information (#15222 by @smichr) -
FunctionClass
no longer raises an error when trying to do xreplace (#15049 by @smichr)
-
-
crypto
-
diffgeom
-
functions
-
enhance conversion of gamma and upper_gamma back to sage (#10685 by @fchapoton)
-
Unnecessary evaluations will be trimmed out, if
evaluate=False
is passed to Min, Max. (#16252 by @sylee957) -
Differentiation of abs(function) automatically attempts to rewrite in terms of sign (#16185 by @RituRajSingh878)
-
A second doit will be done automatically if the first changed a Derivative but left Derivatives behind (#16185 by @RituRajSingh878)
-
Min and Max.rewrite(Piecewise) no longer require the arguments to have the real assumption set. (#15932 by @oscargus)
-
use logcombine to combine "logs with irrational coefficients" (#15954 by @RituRajSingh878)
-
fixed simplification of an evaluated tangent (#15961 by @jmig5776)
-
Min / Max return Infinity / NegativeInfinity when no args are given. (#15809 by @jmig5776)
-
change function for "True" and "False" (#15703 by @RituRajSingh878 and @smichr)
-
change function for reducing expression (#15709 by @RituRajSingh878)
-
Exponential function with a logarithmic factor in its argument can be rewritten as a power. (#15661 by @normalhuman)
-
added class
carmichael
insympy/functions/combinatorial/numbers.py
(#15321 by @avishrivastava11 and @rohitx007) -
added tests -
test_carmichael
insympy/functions/combinatorial/tests/test_comb_numbers.py
(#15321 by @avishrivastava11 and @rohitx007) -
added class
carmichael
insympy/functions/combinatorial/__init1__.py
(#15321 by @avishrivastava11 and @rohitx007)
-
-
geometry
-
forbid creation of circles with imaginary radius (#16158 by @FrackeR011)
-
radius of Circle is made Rational unless evaluate=False (#15816 by @RituRajSingh878 and @smichr)
-
Added Auxiliary Circle Feature For Ellipse (#16028 by @iamrajiv and @smichr)
-
hash function of Polygon modified (#15754 by @FrackeR011)
-
in idiff added support for the case when y is a Function (#15678 by @smichr and @verastrass)
-
distance
when called from object of Point type can return distance from line . (#15542 by @FrackeR011 and @smichr) -
Implemented private method for finding equation of Ellipse using
_slope
as parameter (#15286 by @avishrivastava11 and @smichr) -
implementation for conversion to
line
object andcircle
object inLine.py
andCircle.py
respectively (#15273 by @avishrivastava11 and @smichr) -
Modified Ellipse to return Segment when either hradius or vradius is zero (#15269 by @Bavish2201)
-
Changed the Circle class to return Point, specifically center, when radius is zero (#15264 by @czgdp1807)
-
-
holonomic
-
integrals
-
Fix connector to new version of MatchPy. (#16356 by @asmeurer and @Upabjojr)
-
Fix AssertionError in heurisch.py (#16021 by @FrackeR011)
-
Added functionality to pass both Polygon type object and a list to point_sort in intpoly.py (#15846 by @sharma-kunal and @smichr)
-
Added a flag
heurisch
tointegrate
. It can be used to disable the parallel/heuristic Risch algorithm, or to use this algorithm exclusively. (#15672 by @normalhuman) -
Improved the logic of substitutions involving logarithms (#15641 by @normalhuman)
-
Added standard non-elementary antiderivatives to manualintegrate. (#15619 by @normalhuman)
-
adjusted the logic of Abs->Piecewise rewrite for definite integrals (#15602 by @normalhuman)
-
expanded the options for power substitution
u = x**k
in manual integration (#15600 by @normalhuman) -
prevented creation of infinite chains of integration by parts (#15576 by @normalhuman)
-
manual integration algorithm is prevented from making infinite circular substitutions (#15565 by @normalhuman)
-
Applying
integrate
to anEquality
object integrates both sides. (#15530 by @normalhuman and @smichr) -
Fixed a bug in the handling of convergence conditions in some integral transforms. (#15541 by @normalhuman)
-
-
interactive
-
By default, LaTeX output in the Jupyter notebook is framed with
$\displaystyle ...$
. This prevents it from being centered in PDF output from nbconvert (see https://github.com/jupyter/notebook/issues/4060). (#15625 by @mgeier) -
SymPy objects now render as LaTeX automatically in the Jupyter notebook.
init_printing()
is still required to make Python builtin numeric types (such asint
andfloat
) render as LaTeX, Python container types (such aslist
anddict
) containing SymPy objects render as LaTeX, to change the printer settings, or to get LaTeX printing in the qtconsole. (#15368 by @asmeurer) -
The latex_mode flag of init_printing() now works in the notebook (#15367 by @asmeurer)
-
The default latex_mode in the notebook is now
'equation*'
(previously it was'plain'
). This makes some expressions, such as definite integrals, render slightly larger. (#15367 by @asmeurer)
-
-
logic
-
SOPform
andPOSform
can now use integers and dicts to indicate terms. (#16133 by @oscargus) -
Boolean simplification algorithm fixed to reduce the number of terms. (#16133 by @oscargus)
-
Improved simplification of Boolean functions with relations in them (#15912 by @oscargus)
-
simplify_logic
now has a limit of 8 variables, which can be overridden by settingforce=True
. (#16134 by @oscargus) -
boolmap differentiations between Xor(x, y) and ~Xor(x, y) (#15225 by @smichr)
-
-
matrices
-
MatrixSymbol.args[0]
is now aSymbol
instead of a string.MatrixSymbol.name
is still a string. (#15121 by @asmeurer and @smichr) -
fixing some common bugs with derivatives of matrix expressions. (#16408 by @Upabjojr)
-
Uncomment matrix derivative test w.r.t Trace. (#16372 by @Upabjojr)
-
Added a new function
rank_decomposition
. (#16209 by @smichr and @sylee957) -
Improved speed for
singular_values
for matrices (#16238 by @sylee957) -
Changed keywords for
jordan_block
explicit. Note that these will become keyword-only in the future when SymPy drops Python 2 support. (#16102 by @smichr and @sylee957) -
Improved the documentation of
jordan_block
(#16102 by @smichr and @sylee957) -
Raise
ValueError
when keyword arguments'eigenval'
and'eigenvalue'
have inconsistent value. (#16102 by @smichr and @sylee957) -
Fixed
diagonalize
andis_diagonalizable
giving wrong results for mutable matrices. (#15887 by @sylee957) -
Fixed possible cases where
jordan_form
can compute wrong result. (#15868 by @sylee957) -
LUsolve()
will raiseNotImplementedError
for rank-deficient square matrices (#16077 by @sylee957) -
gauss_jordan_solve() accepts B with multiple columns (#16063 by @dandiez)
-
_eval_Eq added for MatExpr (#16052 by @divyanshu132 and @smichr)
-
MatAdd()
andMatMul()
now return generic zero and identity matrices with no specified shape. (#15994 by @asmeurer) -
improve docstring of matrices.py (#15950 by @divyanshu132)
-
degenerate explicit matrices no longer raise an exception when raised to a symbolic power (#15712 by @jmig5776)
-
Added more methods
LU
,QR
,PINV
,LDL
,CH
forMatrix.solve
(#15866 by @sylee957) -
rankcheck
inLUdecomposition_Simple
correctly raisesValueError
when the last row is found rank deficient. (#15794 by @sylee957) -
Modified
QRdecomposition
to handle rank-deficient matrices and matrices with more columns than rows. (#15722 by @sylee957) -
Fix unused return value of 'cancel' in bareiss leading to a hang with certain determinants. (#15752 by @ehren)
-
Fixed wrong results on performing
.normalized
on zero vectors (#15739 by @sylee957) -
Added options for
solve_least_squares
to select more methods. (#15727 by @smichr and @sylee957) -
fixing derivative of trace of matrices for some special cases. (#15695 by @Upabjojr)
-
Added elementwise application of functions to matrix expressions. (#15627 by @Upabjojr)
-
Derivatives of matrix expressions do not rely on indexed expressions anymore. The algorithm now calculates the result implicitly. (#15615 by @Upabjojr)
-
KroneckerProduct._entry
now works with matrices with symbolic shapes (#15562 by @asmeurer) -
Extend pinv() with the implementation for rank deficient matrices. (#15475 by @klaasvanaarsen)
-
matrix expressions involving transpose and powers are now automatically reduced (#15404 by @sidhantnagpal)
-
Transponse(A*B)**5
now requires invocation of.doit()
method to carry out reductions (#15404 by @sidhantnagpal) -
Added support for overdetermined systems to LUsolve (#15485 by @normalhuman)
-
dot function can also calculate hermitian inner product. (#15393 by @amsuhane and @cbm755)
-
Cholesky and LDL decompositions are now available in their non-Hermitian form: representing a symmetric matrix by the product of a lower triangular matrix and its transpose. (#15473 by @normalhuman)
-
improve speed of
.solve()
inmatrices.py
(#15341 by @FrackeR011) -
Reverts backwards incompatible change introduced in SymPy 1.2 and 1.3 for matrix differentiation and moves Matrix by Matrix differentiation to expected to fail. (#15390 by @moorepants and @Upabjojr)
-
fixed tools like expand( ) on matrix expressions. (#15373 by @Upabjojr)
-
MatrixExpr
operations via*, **, +
or.doit()
produce more simplified expressions (#15142 by @valglad) -
Inverse.args
are a 2-tuple(matrix, -1)
to be consistent withMatPow
(#15142 by @valglad) -
Keep inverses in matrix expressions unexpanded with keyword
inv_expand
; for example,Inverse(A*B).doit() == B**-1*A**-1
butInverse(A*B).doit(inv_expand=False) == (A*B)**-1
(#15142 by @valglad) -
Added
iszerofunc
parameter for_eval_det_bareiss()
(#15207 by @sylee957)
-
-
ntheory
-
Added Functions for Amicable Number (#16142 by @iamrajiv and @smichr)
-
actor_: added funtions
abundance
,is_abundant
andis_deficient
(#16109 by @jhanwar and @smichr) -
added ischeck functions for both perfect number and mersenne prime using list of mersenne prime exponents. (#16101 by @jhanwar and @smichr)
-
fix _discrete_log_pollard_rho method for wrong results (#16009 by @divyanshu132)
-
trailing function improved for n < 2**300 (#15909 by @adhoc-king and @smichr)
-
Improvement of small_trailing array precomputation (#15908 by @adhoc-king)
-
primepi can take symbolic and real arguments (#15555 by @ethankward)
-
added method
is_euler_pseudoprime
insympy/ntheory/primetest.py
(#15321 by @avishrivastava11 and @rohitx007)
-
-
parsing
-
physics.continuum_mechanics
-
Fixed wrong result with for plural fixed supports. (#15674 by @tehen-ni-ishi)
-
Added text and plots to the beam sphinx docs. (#15310 by @moorepants)
-
Fixed wrong result with high order loads with end points. (#15304 by @moorepants)
-
-
physics.optics
- Added two new functions to
physics.optics.utils
:
-
critical_angle()
calculates the onset of total internal reflection, "TIR" when possible (n2 < n1) -
fresnel_coefficients()
calculates real reflection and transmission coefficients when out of TIR and complex ones when the ray is TIR'ed (#16057 by @Trave11er)
- Added two new functions to
-
physics.paulialgebra
-
physics.quantum
-
qapply
now works forc_part*TensorProduct
(#15878 by @ellisonbg and @oscargus) -
IntQubit now has a keyword argument "nqubit" in its constructor to avoid ambiguity (#15933 by @ssmi1975)
-
-
physics.units
-
corrected scale factor Kilogram to 1 as per SI unit. (#15685 by @RituRajSingh878)
-
derived units and dimensions are included in si.py (#14927 by @schymans)
-
-
physics.unitsystems
-
physics.vector
-
Added apostrophe on the ASCII printing of derivatives of physics.vector instead of the (Unicode) Newton dots. (#15962 by @parkereberry1923 and @shivanikohlii)
-
printing of arbitrary order vector derivatives is fixed (#15849 by @oscargus)
-
-
plotting
-
pygletplot is working again, although there seems to be issues on OS X. (#16513 by @asmeurer and @oscargus)
-
Now if backend
use_python_math
isTrue
thencomplex_wrap_evalf
will beFalse
. -
Added explicit optional arguments to plot_implicit and improved/corrected the documentation (#15756 by @oscargus)
-
Added outputs to all plotting examples in the sphinx docs. (#15366 by @iamprayush)
-
changed extend example and added new plots (#15357 by @iamprayush)
-
added an example output to the sphinx documentation (#15347 by @iamprayush)
-
Fixed
xlim
andylim
fromplot()
not properly handling sympy's number classes. (#15265 by @sylee957)
-
-
polys
-
added
fraction
flag infactor()
(#16302 by @Yathartha22) -
handling regression in
factor()
withdeep=True
from1.3
(#16277 by @Yathartha22) -
returning same equation for Eq(root, Symbol) instead of False. (#15923 by @RituRajSingh878 and @smichr)
-
Remove get_monomials_set of MacaulayResultant (#16025 by @akritas and @jksuom)
-
multivariate_resultants improved. (#16013 by @akritas and @jksuom)
-
Division and remainder of ANPs now works. (#15863 by @oscargus)
-
quo_z now returns correctly in case of multinomials. (#15863 by @oscargus)
-
fixed a bug with a call to
spoly
ingroebnertools.py
(#15834 by @damianosSemmle) -
preserve exponent of -1 in _minpoly_compose (#15762 by @jksuom)
-
subresultants_qq_zz: completed references and updated quo_z. (#15721 by @akritas and @jksuom)
-
Additions and extensions to subresultants_qq_zz. (#15699 by @akritas and @jksuom)
-
The flag
deep=True
offactor
results in a more thorough factorization than previously. (#15670 by @normalhuman) -
degree(expr, x)
raises PolynomialError ifexpr
is not a polynomial inx
. (#15596 by @normalhuman) -
RootOf no longer accepts an expression with a non-Symbol generator (#15320 by @smichr)
-
replace method will not raise an error when trying to replace a generator that is not present (#15246 by @smichr)
-
-
printing
-
Units are printed in a slightly better format in the LaTeX printer (#16514 by @oscargus)
-
srepr now correctly prints subclasses of
Add
andMul
. (#15121 by @asmeurer and @smichr) -
Fixed
mathematica_code
mutating the dictionary passed to the argumentuserfuncs
(#16309 by @sylee957) -
Fixed
mathematica_code
ignoring list items passed touserfuncs
. (#16309 by @sylee957) -
Added LaTeX, MathML presentation, and pretty printing of
Laplacian
(#16293 by @oscargus) -
Added LaTeX, MathML presentation, and pretty printing of
bell
,bernoulli
,fibonacci
,lucas
, andtribonacci
numbers (#16293 by @oscargus) -
Added printing methods for elliptic_e, elliptic_f, elliptic_pi, Ei, expint, jacobi, gegenbauer, chebyshevt, chebyshevu, legendre, assoc_legendre, laguerre, assoc_laguerre and hermite type objects for MathML presentation printer (#16284 by @pragyanmehrotra and @smichr)
-
change numpy matmul function. This fixes things like
lambdify(A, 2*A)
whereA
is aMatrixSymbol
. (#15953 by @RituRajSingh878) -
improved pretty printing of PI used for product of series (#16281 by @AnimeshSinha1309)
-
Added support for printing MatrixElement type objects for MathML presentation printer (#16271 by @pragyanmehrotra)
-
Added MathML presentation printing for
nan
andzoo
(#16274 by @oscargus) -
Added MathML presentation printing for matrix functions (e.g.
Adjoint
) and special matrices (e.g.Identity
) (#16274 by @oscargus) -
Added MathML presentation printing for
SingularityFunction
(#16274 by @oscargus) -
Many functions with single character representations added to MathML Presentation printer (#16099 by @oscargus and @smichr)
-
Better MathML presentation printing of
Float
(#16099 by @oscargus and @smichr) -
Infinite
Range
objects no longer pretty print as ifoo
were included in the set. (#16270 by @asmeurer) -
\text
is consistently used instead of\mathrm
in LaTeX printer to get non-italic text. (#16056 by @oscargus) -
Added option to select output format for
re
andim
in LaTeX printer:gothic_re_im
(#16056 by @oscargus) -
MathML presentation printing of classes in sympy.vector (#16214 by @oscargus)
-
Added support for
DenseNDimArray
andSparseNDimArray
formathematica_code
(#16221 by @sylee957) -
printing C code for Min and Max objects with many arguments is much faster (#15617 by @clyring and @MaltNCigars)
-
MathML Presentation printing of integrals improved. (#16210 by @oscargus)
-
Corrected LaTeX and pretty printing of
Gradient
(#16211 by @oscargus) -
Added MathML presentation printing for Range, Min, Max, exp, true, false, None (#16126 by @oscargus)
-
Added MathML presentation printer method for printing Indexed objects (#16106 by @pragyanmehrotra)
-
Added MathML presentation printer method for printing IndexedBase objects (#16106 by @pragyanmehrotra)
-
Added MathML presentation printer methods for printing tuple objects (#16106 by @pragyanmehrotra)
-
Added Lambda, floor, ceiling and exp functions to the mathml printer (#16139 by @shubhamabhang77)
-
Issue with printing of minus signs in MathML presentation printer corrected. (#16141 by @oscargus)
-
MathML printing pf negative powers more consistent with LaTeX output. (#16141 by @oscargus)
-
Fixed
mathematica_code
printingComplexInfinity
aszoo
(#16128 by @sylee957) -
Fixed
mathematica_code
printingIndeterminate
asnan
(#16128 by @sylee957) -
Fixed
mathematica_code
printingTribonacciConstant
asTribonacciConstant
, now uses explicit formula. (#16128 by @sylee957) -
mathematica_code
will give warning(* Not supported in Wolfram Language: *)
for classes not implemented or not printable. (#16128 by @sylee957) -
Added the Fold_frac_powers and fold_short_frac flags to the mathml presentation printer (#16075 by @shubhamabhang77)
-
Added MathML presentation printer for
re
,im
,Abs
,Determinant
,Interval
, andTuple
(#16065 by @oscargus and @smichr) -
MathML presentation printing for logic functions (
And
,Or
, etc) (#16047 by @oscargus and @smichr) -
MathML presentation printing for set functions (
Union
,Intersection
, etc.) andFiniteSet
(#16047 by @oscargus and @smichr) -
MathML presentation printing for
polylog
andlerchphi
(#16047 by @oscargus and @smichr) -
remove one useless assignment (#16072 by @fchapoton)
-
Presentation MathML printing for
factorial
,binomial
, andconjugate
(#16069 by @oscargus) -
Added support for printing domains in the MathML presentation printer (#16037 by @oscargus)
-
changed the print order of additions of form
k - expr
(used to print as-expr + k
) (#15985 by @nickovs) -
Added to ln_notation and mul_symbol flag to mathml presentation printer. (#16017 by @shubhamabhang77)
-
MathML presentation printer now generates correct sub- and superscripts. (#15976 by @oscargus)
-
LaTeX-printing of
ConditionSet
withFiniteSet
now works. (#15978 by @oscargus) -
LaTeX printer can now print sequences with symbolic bounds (#15980 by @oscargus)
-
Corrected and improved MathML presentation printing of multiple derivatives. (#16003 by @oscargus)
-
Added the mat_delim flag in presentation printer of mathml. (#15991 by @shubhamabhang77)
-
New Latex, pretty, and MathML printer option
mat_symbol_style
which when set to 'bold' leads toMatrixSymbol
printed as bold (#15891 by @oscargus and @smichr) -
MatrixSymbol
andRandomSymbol
now prints better for MathML (#15891 by @oscargus and @smichr) -
better (smaller) spacing when generating LaTeX for lists, tuples, and dicts. (#15970 by @asmeurer and @oscargus)
-
Representation of the imaginary unit,
I
in sympy, can be redefined in the LaTeX-printer through the optional argumentimaginary_unit
. Default is"i"
. (#15936 by @oscargus) -
Added the flag root_notation to the MathML printerchanges made in mathml.py. If set to False, exponents of the form 1/n are printed in fractional form. It is set as True (default), the exponents are printed in root form. (#15901 by @oscargus and @shiksha11)
-
change numpy matmul function. This fixes things like
lambdify(A, 2*A)
whereA
is aMatrixSymbol
. (#15835 by @RituRajSingh878) -
Corrected Unicode symbols for three and four dots above in pretty printer (dddot and ddddot modifiers) (#15892 by @oscargus)
-
Modifier is now put on the middle character in case of multi-character symbol names (#15892 by @oscargus)
-
add init to MathMLPresentationPrinter (#15906 by @Bavish2201)
-
MathML printer now has a working fallback for Basic (#15814 by @oscargus)
-
Fortran printer for FunctionPrototype does not give a syntax error anymore (although an exception as multiline prining is not yet supported) (#15814 by @oscargus)
-
changes made in latex.py and pretty.py. Root_notation in both latex.py and pretty.py has boolean datatype. If set as False, exponents of the form 1/n are printed in fractonal form.It is set as True by default printing the exponents in root form. (#15842 by @oscarbenjamin and @shiksha11)
-
test for NumPy matrix multiply (#15687 by @RituRajSingh878)
-
Code printers will properly behave for sparse matrices, if not supported (#15791 by @sylee957)
-
LaTeX printing now consistently does not use a space after
\left
and\right
(#15779 by @oscargus) -
When printing to LaTeX,
ceiling
,floor
, <> and Dirac ket |a>now always add\left
and\right
(#15780 by @oscargus) -
mathematica_code
can print dense and sparse matrices (#15792 by @sylee957) -
catch ValueError from unevaluated integrals (#15719 by @RituRajSingh878)
-
pretty printer (#15686 by @RituRajSingh878)
-
use
\documentclass{standalone}
by default when using LaTeX to render expressions (#15679 by @mgeier) -
Changed printing using str() and repr() of S.Integers, S.Reals, S.Naturals and S.Naturals0 to the names of the sets themselves (#15635 by @AnimeshSinha1309)
-
Added support for orthogonal polynomials to SciPy code printer (#15656 by @normalhuman)
-
correctly matches Bessel functions to SciPy analogues in SciPy code printer (#15613 by @normalhuman)
-
fixed MatrixElement printers for the cases with special indices. (#15609 by @Upabjojr)
-
MatMuls with KroneckerProducts now parenthesize correctly (#15592 by @rationa-kunal)
-
MatrixSymbol powers and inverses are printed as the corresponding NumPy methods (#15586 by @normalhuman)
-
Fix omission of necessary parentheses with MatMul (#15446 by @JMSS-Unknown and @Upabjojr)
-
added more NumPy printers for objects in sympy.codegen.array_utils (#15452 by @Upabjojr)
-
Fix latex printing of ProductSet when exponent has more than one digit (#15456 by @jlumpe)
-
added a method to correctly LaTeX print the trace of a MatrixSymbol (#15308 by @ethankward)
-
fixed a bug in LaTeX.py where subexpressions of an unimplemented basic expression were not printed correctly (#15308 by @ethankward)
-
added Mathematica code printers for Max and Min (#15345 by @ajdunlap)
-
Fixed
NumPyPrinter._print_im
(#15401 by @bjodah and @ViacheslavP) -
Improved performance of function printing in the code printers. (#15379 by @moorepants)
-
Subs with singleton args prints without wrapping variable/point as tuple (#15244 by @smichr)
-
Added Mod to the supported Fortran functions. (#15231 by @moorepants)
-
unicode printers for tensorial expressions (#15249 by @Upabjojr)
-
Added
scalar=True
option totheanocode.theano_function
to create a function which returns scalars instead of 0-dimensional arrays. (#14949 by @jlumpe)
-
-
series
-
Improves fourier.FiniteFourierSeries class (#16131 by @ShubhamKJha)
-
catch ValueError from core in limit. (#16157 by @divyanshu132)
-
added a check for finite fourier series in
fourier_series
(#15979 by @asmeurer and @ShubhamKJha) -
Improved the computation of limits of oscillating sequences (#15646 by @normalhuman)
-
Limit computation no longer falls back on sequential limits. Previously undocumented parameter
sequence
ofLimit.doit()
is removed. Uselimit_seq
for limits of sequences. (#15569 by @normalhuman) -
The limits of Fresnel integrals at infinity are now correct. (#15549 by @normalhuman)
-
Implemented order at negative infinity:
O(expression, (x, -oo))
. (#15540 by @normalhuman) -
Fixed a bug in the computation of Taylor series of expressions with a fractional power of the variable. (#15521 by @normalhuman)
-
The orders of magnitude
O(x**n, (x, oo))
are now correctly compared to each other withOrder.contains
. (#15476 by @normalhuman) -
added a heuristic method for solving indefinite forms in limits (#14939 by @maurogaravello)
-
implemented expression-based recursive sequence class (#15184 by @rwbogl)
-
-
sets
-
Union
andIntersection
now work with Python sets as input. (#16344 by @asmeurer) -
Union
andIntersection
no longer automatically denest arguments. This means to pass a list or generator toUnion
/Intersection
, you must useUnion(*list_of_sets)
. (#16344 by @asmeurer) -
Union
andIntersection
now subclass fromLatticeOp
. (#16344 by @asmeurer) -
Handle non-set objects in
Eq
withInterval
orFiniteSet
. (#16344 by @asmeurer) -
fix an infinite recursion issue that could occur taking the intersection of finite sets with symbolic elements. (#16344 by @asmeurer)
-
Intersection
no longer returns an object with an unnecessaryUniversalSet
in some cases (for instance,Intersection(FiniteSet(0, x), FiniteSet(x, y))
now returnsFiniteSet(x, 0)
instead ofUnion({x}, Intersection(FiniteSet(0), UniversalSet()))
). (#16344 by @asmeurer)
-
-
simplify
-
fixed docstring of
logcombine
function of simplify (#15861 by @jmig5776) -
change simplify function for
Ne
. (#15851 by @RituRajSingh878 and @smichr) -
When a,b are noncommutative, simplify(exp(a)*exp(b)) no longer returns exp(a+b). (#15558 by @clyring and @MaltNCigars)
-
collect method modified to give correct results for expressions belonging to Add class (#15472 by @czgdp1807 and @smichr)
-
Raise exception when collecting a noncommutative symbol (#15447 by @JMSS-Unknown)
-
fixed a bug in the hyperexpand function (#15459 by @normalhuman)
-
change order of TR10i and TRmorrie in trigsimp (#15346 by @FrackeR011)
-
nc_simplify
can get better simplifications and now works on instances ofMatrixExpr
(#15142 by @valglad)
-
-
solvers
-
Fix
linear_eq_to_matrix
on distributed terms. (#16578 by @cbm755) -
Rename order_reducible to nth_order_reducible (#16399 by @oscarbenjamin)
-
check for variable number of functions and equations in ode.py (#16168 by @divyanshu132)
-
dsolve can now choose from multiple general solutions based in initial conditions. (#16170 by @sharma-kunal)
-
dsolve, constantsimp and odesimp no longer renumber inregration constants found in the original ODE. (#16012 by @oscarbenjamin, @saurabhkgp21, and @smichr)
-
replaced var[0] with v1[0] in diophantine.py (#16117 by @FrackeR011)
-
New reducible hint in dsolve to solve ODEs that only depend on derivatives of the dependent variable by substitution. (#15992 by @oscarbenjamin, @smichr, and @XtremeGood)
-
fix nth_algebraic solver so it doesn't clobber integration constants from the source ODE. (#16008 by @oscarbenjamin)
-
checkodesol is more robust when checking solutions involving Integrals (#15957 by @jmig5776, @oscarbenjamin, and @smichr)
-
Added support for solving some special types of exponential equations (#15735 by @jmig5776 and @smichr)
-
Raise NonImplementedError when
solveset
fails with polynomials over inexact domain. (#15895 by @sharma-kunal) -
Return the correct RootOf form of solution for constant coefficient ODEs with unsolvable characteristic polynomials. (#15645 by @oscarbenjamin)
-
get_numbered_constants
indsolve
now considers functions, in case you have a function named, for example,C1(t)
. (#15504 by @avishrivastava11) -
nsolve accepts a SymPy Matrix as the initial guess. (#15529 by @normalhuman)
-
dsolve now raises NotImplementedError instead of IndexError for a particular type of invalid ODE. (#15430 by @oscarbenjamin)
-
fix solving linear ODEs with constant irrational coefficients (#15408 by @oscarbenjamin)
-
dsolve now rescales ODEs so that the Euler solver can be used in more cases (#15434 by @oscarbenjamin)
-
Add an 'nth_algebraic' solver for ODEs that can be solved by algebra and integration (#15255 by @oscarbenjamin)
-
improved checkodesol handling of expressions with unexpanded derivatives (#15290 by @oscarbenjamin)
-
Fixed a bug where
dsolve
would return no solutions to a linear system of n first order ODEs (#15326 by @sirnicolaf) -
linear_coeffs
returns list of coeffs by default instead of dict (#15317 by @smichr) -
improved _invert method to help solver to solve 2-D linear system (#15315 by @ayushmankoul)
-
linear_coeffs
added to solveset (#15212 by @czgdp1807 and @smichr) -
nonlinear terms encountered by
linear_eq_to_matrix
will raise an error; repeated symbols and non-symbols will also raise an error (#15212 by @czgdp1807 and @smichr) -
as a convenience,
linear_eq_to_matrix
now accepts a single Expr as its first argument. (#15212 by @czgdp1807 and @smichr)
-
-
stats
-
PDF of Gumbel distribution corrected. (#16529 by @czgdp1807)
-
CDF of Gumbel distribution added. (#16529 by @czgdp1807)
-
Improved parameter handling by univariate continuous distributions (#16159 by @supreet11agrawal)
-
Corrected documentation for Cauchy distribution (#16159 by @supreet11agrawal)
-
Benini distribution now takes positive parameter values (#16108 by @supreet11agrawal)
-
fixed bugs in finite discrete random variable types (#15958 by @supreet11agrawal)
-
reason for not importing stats with
from sympy import *
has been included (#15683 by @czgdp1807) -
code of sympy.stats.Probability has been simplified (#15610 by @czgdp1807)
-
-
tensor
-
fix the formatting of the tensor.indexed documentation (#15879 by @martin-ueding)
-
Added "name" property for Idx objects. (#15524 by @normalhuman)
-
Support for rewriting tensorial expressions into summation of indexed expressions. (#15388 by @Upabjojr)
-
Symmetry parameter in tensorhead construction is now optional. (#15389 by @Upabjojr)
-
Added class TensorElement to represent components of tensor expressions. (#15316 by @Upabjojr)
-
add support for partial derivatives of tensors. (#15258 by @Upabjojr)
-
Added support for slice assignments to N-dimensional arrays. (#15333 by @Upabjojr)
-
Deprecate .data property in favor of the new .replace_with_arrays method. (#15278 by @Upabjojr)
-
Added support for replacement of tensor expressions with arrays. (#15271 by @Upabjojr)
-
fix problems with indices of tensor polynomials. (#15252 by @Upabjojr)
-
minor fix to the LaTeX and pretty printers (#15253 by @Upabjojr)
-
unicode printers for tensorial expressions (#15249 by @Upabjojr)
-
Remove automatic expansions of tensorial expressions. (#15250 by @Upabjojr)
-
-
utilities
-
make variable names in generated cython code unique (#16331 by @anpandey)
-
Test runner no longer forces
__future__
division so that the test behaviour is the same under the runner as when imported normally. (#15587 by @oscarbenjamin) -
strlines
added: prints a string into shorter lines in a format that can be copied and used in an equality test (#16253 by @smichr) -
Added a function
unchanged
which evaluates if expression is changed or not (#16189 by @supreet11agrawal) -
rotations
function added to iterables.py (#16136 by @divyanshu132 and @smichr) -
added high-level documentation to the docstring of
lambdify
to help clarify what it does and how it works. (#13485 by @asmeurer) -
Make doctests runnable under pytest with doctestplus (#15768 by @oscarbenjamin)
-
Make Sympy's tests runnable under pytest. (#15720 by @oscarbenjamin)
-
Added context manager
TmpFileManager
and decorator functioncleanup_tmp_files
in a new moduletmpfiles.py
. (#15354 by @sylee957) -
Make tests compatible with pytest (#15577 by @oscarbenjamin)
-
Added new utilities for handling warnings in tests. These have been used for a general clean up of warning handling code in the tests. (#15503 by @oscarbenjamin and @smichr)
-
Fix unintentional int division across the test suite (#15515 by @oscarbenjamin)
-
made SympyDeprecationWarning picklable so tests can be run in subprocesses (#15506 by @oscarbenjamin)
-
Fixed regression with autowrap helpers kwarg. (#15391 by @moorepants)
-
lambdify and lambdastr now work with Derivative (#15382 by @SirJohnFranklin and @smichr)
-
lambdastr will detect if dummify should be true; override by setting dummify=False (#15382 by @SirJohnFranklin and @smichr)
-
ordinal will convert an int to its ordinal representation, e.g. 12 -> 12th (#15247 by @smichr)
-
-
vector
- added Laplacian class to represent unevaluated laplacian. (#16199 by @FrackeR011)
-
other
-
SymPy is now distributed on PyPI as a wheel in addition to a source tarball. (#16388 by @asmeurer)
-
The release files on GitHub now use SHA 256 hashes instead of MD5 hashes. (#16388 by @asmeurer)
-
Use the cdnjs.cloudflare.com CDN for Mathjax in the online documentation (#15955 by @oscarbenjamin)
-
Set the monospace font to DejaVu Sans Mono (if it is installed) in the docs (#15742 by @jmig5776)
-
Fixed Some Grammatical Mistakes in README.rst (#15697 by @iamrajiv)
-
sympy.pi is no longer shadowed by another symbol called pi in the TeXmacs integration (#15466 by @mardukbp)
-
The script tm_sympy is now executed by the Python interpreter in $PATH (#15465 by @mardukbp)
-
The following people contributed at least one patch to this release (names are given in alphabetical order by last name). A total of 104 people contributed to this release. People with a * by their names contributed a patch for the first time for this release; 66 people contributed for the first time for this release.
Thanks to everyone who contributed to this release!
- 2torus*
- Shubham Abhang*
- adhoc-king*
- Saurabh Agarwal
- Supreet Agrawal*
- Alkiviadis G. Akritas
- alejandrogroso@hotmail.com*
- amsuhane*
- Fredrik Andersson*
- azure-pipelines[bot]*
- Fabian Ball
- Oscar Benjamin
- Parker Berry*
- Marduk Bolaños*
- Francesco Bonazzi
- Ondřej Čertík
- Frédéric Chapoton*
- Matthew Craven*
- Björn Dahlgren
- damianos*
- dandiez*
- Nabanita Dash*
- Prayush Dawda*
- Robert Dougherty-Bliss*
- Alexander Dunlap*
- Zachariah Etienne*
- etkewa@gmail.com*
- eward
- Isuru Fernando
- Mauro Garavello
- Matthias Geier*
- Noumbissi valere Gille Geovan*
- Valeriia Gladkova
- Brian E. Granger
- Andrey Grozin*
- Nicolás Guarín-Zapata
- Gaetano Guerriero*
- Oscar Gustafsson*
- Daniel Ingram*
- Susumu Ishizuka*
- Alpesh Jamgade*
- Shubham Kumar Jha*
- jhanwar*
- JMSS-Unknown
- Yathartha Joshi
- kkkkx*
- klaasvanaarsen*
- Shivani Kohli*
- Ayushman Koul
- Leonid Kovalev
- Bavish Kulur*
- Ritesh Kumar*
- S.Y. Lee
- Vera Lozhkina*
- Jared Lumpe
- Colin B. Macdonald
- Vishesh Mangla*
- Pragyan Mehrotra*
- Ehren Metcalfe
- Aaron Meurer
- Jogi Miglani*
- Sudhanshu Mishra
- Mohitbalwani26*
- Jason Moore
- Sidhant Nagpal
- Takumasa Nakamura*
- Abdullah Javed Nesar
- Austin Palmer
- Ankit Pandey*
- Samnan Rahee*
- Zach Raines
- rationa-kunal*
- Faisal Riyaz*
- Martin Roelfs*
- Mikel Rouco*
- Safiya03*
- Stan Schymanski
- Rohit Sharma*
- sharma-kunal*
- shiksha11*
- Avi Shrivastava
- Jason Siefken
- Jashanpreet Singh
- Gagandeep Singh
- Ritu Raj Singh*
- Arun Singh*
- Rajiv Ranjan Singh*
- Animesh Sinha*
- SirJohnFranklin*
- sirnicolaf*
- Gleb Siroki
- Chris Smith
- Nicko van Someren*
- Anthony Sottile*
- Bhavya Srivastava*
- Kalevi Suominen
- Gaurang Tandon*
- Nimish Telang
- Divyanshu Thakur*
- Martin Ueding*
- ViacheslavP*
- Ethan Ward
- Jonathan Warner*
- whitesource-bolt-for-github[bot]*