Release Notes for 1.4

SymPy Bot edited this page Nov 18, 2018 · 103 revisions

These are the release notes for SymPy 1.4.

SymPy 1.4 has not been released yet.

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.

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

Please feel free to manually add any major changes for this release here, in addition to the automatic change listed below.

Backwards compatibility breaks and deprecations

Please manually add any backwards compatibility breaks or deprecations here, in addition to the automatic listing below.


  • algebras

    • fix sign mistake in Quaternion.to_rotation_matrix method (#15349 by @2torus)
  • assumptions

    • improved matrix assumptions so ask can make deductions about instances of MatPow (#15142 by @valglad)
  • codegen

    • 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)

  • concrete

    • 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

    • replaced _gcdcache with lru_cache in (#15453 by @FrackeR011)

    • increased size of lru_cache from 100 to 1024 (#15453 by @FrackeR011)

    • Derivative has faster quick exit for 0 (#15049 by @smichr)

    • subs involving changing UndefinedFunction to Function in Derivative wrt variables will now create a Subs 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 has canonical property which returns Derivative with variable_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.g f(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 returns Subs less often, e.g. f(g(x)).diff(x) no longer creates a Subs instance (#15049 by @smichr)

    • Expr has a default attribute is_scalar=True which makes Expr().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 final Piecewise arguments (#15049 by @smichr)

    • Piecewise uses information from Eq or And conditions to simplify the corresponding expression, e.g. (f(x), Eq(x, 0)) -> (f(0), Eq(x, 0)) (#15049 by @smichr)

    • BooleanFunction has simplify method (#15049 by @smichr)

    • And will simplify args of type Eq and Ne 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 public rewrite method (#15314 by @aionkgp)

    • added parameter in all public _eval_rewrite_as_Piecewise methods (#15314 by @aionkgp)

    • kwargs are now passed to all rewrite methods (#15317 by @smichr)

    • Eq._eval_rewrite_Add has been defined (#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 for F = Function('F', commutative=False) (#15232 by @raineszm)

    • _atomic can recurse into arguments (#15242 by @smichr)

    • sympify keyword arguments now work properly when sympifying NumPy 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(Subs(...)) will denest (#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)

  • diffgeom

    • better removal of dummies from expressions involving derivatives (#15049 by @smichr)
  • functions

  • geometry

    • Implemented private method for finding equation of Ellipse using _slope as parameter (#15286 by @avishrivastava11)

    • implementation for conversion to line object and circle object in and respectively (#15273 by @avishrivastava11)

    • 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)

  • interactive

    • SymPy objects now render as LaTeX automatically in the Jupyter notebook. init_printing() is still required to make Python builtin numeric types (such as int and float) render as LaTeX, Python container types (such as list and dict) 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

    • boolmap differentiations between Xor(x, y) and ~Xor(x, y) (#15225 by @smichr)
  • matrices

    • 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)

    • 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() in (#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)

    • fixed tools like expand( ) on matrix expressions. (#15373 by @Upabjojr)

    • Added missing docs from (#15272 by @sylee957)

    • MatrixExpr operations via *, **, + or .doit() produce more simplified expressions (#15142 by @valglad)

    • Inverse.args are a 2-tuple (matrix, -1) to be consistent with MatPow (#15142 by @valglad)

    • Keep inverses in matrix expressions unexpanded with keyword inv_expand; for example, Inverse(A*B).doit() == B**-1*A**-1 but Inverse(A*B).doit(inv_expand=False) == (A*B)**-1 (#15142 by @valglad)

  • ntheory

  • physics.continuum_mechanics

  • physics.units

  • physics.unitsystems

  • plotting

    • Fixed xlim and ylim from plot() not properly handling sympy's number classes. (#15265 by @sylee957)
  • polys

    • 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

    • Fix omission of necessary parentheses with MatMul (#15446 by @JMSS-Unknown)

    • additions to the tensorflow printers. (#15462 by @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 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 @ViacheslavP)

    • Improved performance of function printing in the code printers. (#15379 by @moorepants)

    • add theano printing for MatPow (#15142 by @valglad)

    • Subs with singleton args prints without wrapping variable/point as tuple (#15244 by @smichr)

    • added LaTeX printers for tensors. (#15251 by @Upabjojr)

    • Added Mod to the supported Fortran functions. (#15231 by @moorepants)

    • unicode printers for tensorial expressions (#15249 by @Upabjojr)

    • Added scalar=True option to theanocode.theano_function to create a function which returns scalars instead of 0-dimensional arrays. (#14949 by @jlumpe)

  • series

    • The orders of magnitude O(x**n, (x, oo)) are now correctly compared to each other with Order.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)

  • simplify

    • collect method modified to give correct results for expressions belonging to Add class (#15472 by @czgdp1807)

    • 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 of MatrixExpr (#15142 by @valglad)

  • solvers

    • 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 @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 @smichr)

    • as a convenience, linear_eq_to_matrix now accepts a single Expr as its first argument. (#15212 by @smichr)

  • tensor

    • 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)

    • remove deprecated TIDS class (#15284 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)

    • allow symbols to be used like indices (#15262 by @Upabjojr)

    • fix problems with indices of tensor polynomials. (#15252 by @Upabjojr)

    • minor fix to the LaTeX and pretty printers (#15253 by @Upabjojr)

    • added LaTeX printers for tensors. (#15251 by @Upabjojr)

    • unicode printers for tensorial expressions (#15249 by @Upabjojr)

    • Remove automatic expansions of tensorial expressions. (#15250 by @Upabjojr)

  • utilities

    • Fixed regression with autowrap helpers kwarg. (#15391 by @moorepants)

    • lambdify and lambdastr now work with Derivative (#15382 by @smichr)

    • lambdastr will detect if dummify should be true; override by setting dummify=False (#15382 by @smichr)

    • ordinal will convert an int to its ordinal representation, e.g. 12 -> 12th (#15247 by @smichr)

  • other

    • 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)


Clone this wiki locally
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.