Release Notes for 1.6 - sympy/sympy GitHub Wiki

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

Backwards compatibility breaks and deprecations

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

  • assumptions

    • Removed deprecated Q.bounded (use Q.finite instead). Deprecated since version 1.0 (issue: #9425) (#18390 by @Smit-create)

    • Removed deprecated Q.infinitesimal (use Q.zero instead). Deprecated since version 1.0 (issue: #9675) (#18390 by @Smit-create)

    • Removed deprecated Q.infinity (use Q.infinte instead). Deprecated since version 1.0 (issue: #9426) (#18390 by @Smit-create)

  • calculus

    • Deprecated evaluate argument in differentiate_finite for making non-conservative finite differences. (#17881 by @vezeli)
  • combinatorics

  • 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 to has would be sympified to a symbol so that the result would be True. 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 and infinitesimal. Deprecated since version 0.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 like as_coeff_Mul on Relational 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 of a or b is an instance of Expr. This also means that any non-Expr Basic subclasses can not depend on Expr.__add__ to create Add(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 to Matrix.is_zero_matrix.
    • Matrix.is_zero is now always False. This is because in general is_zero means the number zero so a matrix can never be zero.

    To get the old behavior of M.is_zero in both old and new versions of sympy use from sympy.core.logic import fuzzy_and; fuzzy_and(m.is_zero for m in M). (#18464 by @sylee957)

  • 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. Use as_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 and p1.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 Expr x*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 the as_expr method first to convert the Poly to an Expr. To get a Poly always use as_poly to convert the Expr to a Poly. (#18613 by @oscarbenjamin)

    • DEPRECATION: Passing Poly as the integrand to the integrate function or Integral class is now deprecated. Use the integrate method instead e.g. Poly(x, x).integrate(x) (#18613 by @oscarbenjamin)

  • printing

    • Removed deprecated Ccodeprinter (Use C89Printer or C99Printer instead). Deprecated since version 1.1 (Issue : #12220). (#18392 by @risubaba)

    • Removed deprecated file viewer option in preview. Deprecated since version 0.7.3(Issue: #7018) (#18392 by @risubaba)

    • Removed deprecated StringIO viewer option in preview. Deprecated since version 0.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 of a or b is an instance of Set. This also means that any non-Set Basic subclasses can not depend on e.g. Set.__add__ to create Union(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)
  • other

    • Submodule names are no longer imported with from sympy import *. They can still be imported directly like from sympy import core or accessed like sympy.core, or like sys.modules['sympy.simplify'] for modules that share names with SymPy functions. (#18245 by @oscarbenjamin)

Changes

  • 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 (use Q.finite instead). Deprecated since version 1.0 (issue: #9425) (#18390 by @Smit-create)

    • Removed deprecated Q.infinitesimal (use Q.zero instead). Deprecated since version 1.0 (issue: #9675) (#18390 by @Smit-create)

    • Removed deprecated Q.infinity (use Q.infinte instead). Deprecated since version 1.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 in differentiate_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

    • 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 to has would be sympified to a symbol so that the result would be True. 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)
    • when strict=True, as_int will not convert True to 1 (#19054 by @smichr)
    • Adds simplification to Pow._eval_nseries resolving incorrect limit evaluation (#18962 by @sachin-4099)
    • 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 to Zero, 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 when x 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 and infinitesimal. Deprecated since version 0.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)

    • Added new test case for relational (#18416 by @mijo2)

    • Pow._eval_nseries fixed to accept all real exponents. (#18406 by @Smit-create)

    • integer_ntroot and igcd 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 its nargs attribute to its subclasses. (#18258 by @JSS95 and @mcpl-sympy)

    • Added try-except block in sympy/core/relational.py to handle NotImplementedError and return ConditionSet (#18211 by @Smit-create)

    • Renamed core/evaluate to core/parameters (#18198 by @JSS95, @mcpl-sympy, and @oscarbenjamin)

    • Added global_parameters, which is a thread-local storage for global parameters such as evaluate, 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 like as_coeff_Mul on Relational 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 of a or b is an instance of Expr. This also means that any non-Expr Basic subclasses can not depend on Expr.__add__ to create Add(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)

    • Fix a regression in 1.5 that allowed expressions to compare equal to strings, and caused == to call str() on the other object. (#18057 by @asmeurer)
  • functions

    • Adjoint of exp and transpose of exp now work as expected. (#19151 by @akirakyle)

    • Adds substitution to _eval_nseries() function of Abs() class resolving incorrect limit evaluations (#19037 by @sachin-4099)

    • 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 and binomial used with Mod. (#18339 by @namannimmo10)

    • Maximum recursion depth is no longer exceeded when subfactorial is called on large numbers (#17983 by @sachin-4099)

    • Copy edited the Special submodule to reflect the style guide for Google Season of Docs. (#17844 by @lglattly)
  • 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 for Polygon class. (#18335 by @namannimmo10)

    • Add __call__ method in Class Curve. (#18250 by @namannimmo10)

    • Point.coordinates was added as a meaningful alias for Point.args (#18213 by @Jaime02)

  • holonomic

  • integrals

  • logic

    • boolalg (#18912 by @smichr)

    • to_cnf/to_dnf (when simplify=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 treat Not as literal or not by using the literal_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. Function ANFform 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 sentence s 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 and is_weakly_diagonally_dominant properties for Matrix. (#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 and connected_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 create Matrix. (#18911 by @smichr and @sylee957)

    • Improved eigenvals and eigenvects for floating point matrices using mpmath. (#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)

    • Not backwards compatible: The Matrix.is_zero property has been renamed to Matrix.is_zero_matrix. Matrix.is_zero is now always False. This is because in general is_zero means the number zero so a matrix can never be zero. To get the old behavior of M.is_zero in both old and new versions of sympy use from sympy.core.logic import fuzzy_and; fuzzy_and(m.is_zero for m in M). (#18464 by @sylee957)

    • Added PermutationMatrix and MatrixPermute for matrix permutations. (#18032 by @mrocklin and @sylee957)

    • Fixed FunctionMatrix.replace raising TypeError: 'property' object is not iterable when the function is not a Lambda instance. (#17998 by @sylee957)

    • FunctionMatrix and ElementwiseApplyFunction will always wrap the function inside Lambda. (#17998 by @sylee957)

    • Cleaned up unnecessary slowdown for MatMul.doit when it contains explicit matrices. (#17872 by @sylee957)

    • Fixed MatPow(Inverse(A), 3) and Inverse(MatPow(A, 3)) canonicalized into different objects. (#17872 by @sylee957)

    • Improved inversion of block matrices by selecting an appropriate formula. (#19215 by @jlherren)
  • 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 in digits instead of factor_ (#18807 by @smichr)

    • implemented elliptic curve (#18682 by @abhinav28071999 and @shikil)

    • added new ntheory module digits.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 of p in n! 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 recognizes x**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 and drm 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 calls if not is_quad_residue(a, p): in line 396. But is_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)

  • 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 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 and false) 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 from sympy.parsing.sympy_parser. (#18074 by @asmeurer)

  • 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

    • Added new OrthogonalBra and OrthogonalKet classes for orthogonal states. (#18182 by @m93a)
  • physics.vector

  • plotting

    • Fixed plot3d_parametric_line plotting curves out of the box. (#19284 by @sylee957)
  • 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 and x - 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 and x - 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 added from_AlgebraicField() to AlgebraicField. (#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. Use as_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 and p1.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 Expr x*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 the as_expr method first to convert the Poly to an Expr. To get a Poly always use as_poly to convert the Expr to a Poly. (#18613 by @oscarbenjamin)

    • DEPRECATION: Passing Poly as the integrand to the integrate function or Integral 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 in simplify method of ExpressionDomain (#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 when x is a supplied coordinate (#18030 by @smichr)

    • interpolating_poly will raise an error if x is not symbolic (#18030 by @smichr)

    • interpolating_poly will raise an error if X or Y depend on x (#18030 by @smichr)

    • interpolating-poly will now use only the first n points in X and Y (#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)

    • 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 Python printer for KroneckerDelta (#18185 by @m93a)

    • 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 (Use C89Printer or C99Printer instead). Deprecated since version 1.1 (Issue : #12220). (#18392 by @risubaba)

    • Removed deprecated file viewer option in preview. Deprecated since version 0.7.3(Issue: #7018) (#18392 by @risubaba)

    • Removed deprecated StringIO viewer option in preview. Deprecated since version 0.7.2(Issue: #7083) (#18392 by @risubaba)

    • Fixed Range with symbols raising error when printed with LaTeX. (#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, and ProductSet 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)

  • series

    • Adds simplification to limitinf() function of gruntz.py resolving ValueError (#19004 by @sachin-4099)

    • Adds simplification to limitinf() function of gruntz.py resolving ValueError (#18978 by @sachin-4099)

  • sets

    • Added a new DisjointUnion class to compute the disjoint union of instances of sympy.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() for Intervals and FiniteSets having symbolic endpoints or containing symbolic elements. (#18251 by @gschintgen)

    • Fixed FiniteSet._complement() for Intervals and S.Reals. Previously wrong results or exceptions could result from set differences involving FiniteSets containing non-reals or symbolic expressions. (#18218 by @gschintgen)

    • Fixed and extended intersection handler for Integer-based ImageSets. (#18200 by @gschintgen)

    • added appropriate error message when infinite ranges are sliced (#17986 by @arun-y99)

    • Added an is_subset handler to check whether a Range is included in a FiniteSet. (#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 be Reals. (is_open and is_closed now both return False.) (#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 of a or b is an instance of Set. This also means that any non-Set Basic subclasses can not depend on Expr.__add__ to create Union(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 that ImageSets 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)

  • simplify

    • collect is more careful not to make invalid collection (e.g. factoring Rational out of a power's exponent) (#19165 by @smichr)

    • fu routine TR11 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)

  • solvers

    • Use matrix exponential to solve homogeneous systems of first order ODEs with constant coefficients. (#18720 by @mijo2 and @oscarbenjamin)
    • no longer interpret 0./1. as bool when the other arg is not a Boolean (#19054 by @smichr)
    • 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 by variation of parameters was correct but chekodesol 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 with permute=True. (#18200 by @gschintgen)

    • The diophantine solver no longer raises for unsympified inputs. (#18201 by @oscarbenjamin)

    • fixed a bug in diophantine when using permute=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)

    • Copy edited solvers.py to reflect the style guide for Google Season of Docs. (#17921 by @lglattly)
  • stats

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

    • .dummy_fmt changed to .dummy_name (#17518 by @drybalka)

    • metric parameter for TensorIndexType is now split into 2 optional parameters metric_name and metric_symmetry (#17518 by @drybalka)

    • TensorIndexType.dim is now a symbol and not None (#17518 by @drybalka)

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

    • lambdify: avoid using scipy versions of numpy functions, which are deprecated, in lambdify. (#18080 by @sylee957)
  • 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 like from sympy import core or accessed like sympy.core, or like sys.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)

Authors

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

Release files and SHA256 hashes

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
⚠️ **GitHub.com Fallback** ⚠️