Release Notes for 1.10 - sympy/sympy GitHub Wiki

These are the release notes for SymPy 1.10. You can also find release notes for previous versions.

SymPy 1.10 was released on 6th March 2022.

This version of SymPy has been tested on Python 3.7, 3.8, 3.9, 3.10 and PyPy 3.8. 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.10 will not work on Python 2.7. Python 2.7 users should install SymPy 1.5.1 and will not be able to install any further SymPy updates without updating to Python 3.

Install SymPy with

pip install -U sympy

or if you use Anaconda

conda install sympy

Highlights

There are many changes in 1.10 (see below).

Backwards compatibility breaks and deprecations

  • All active deprecations in SymPy have been revamped. The deprecation warning messages are now more informative, and the active deprecations page in the documentation lists all active deprecations and gives more details about them. Additionally, our deprecation policy has been moved to the documentation, and updated to formally state that all deprecations will last for at least 1 year.

  • A number of classes and functions have been moved to better locations mostly to resolve problems with cyclic imports within the SymPy codebase. Most of these are deprecated and will emit a warning, although for some rare cases, there may have been moves without a deprecation. Code that imports these classes and functions from the precise module where they are defined either needs to be updated or should be changed to use a generic import. For example the ordered function is intended to be imported as from sympy import ordered. However it was also possible to import it as from sympy.utilities.iterables import ordered. Since it has now moved a fully qualified import would be from sympy.code.sorting import ordered although importing in this way is still discouraged. Importing from sympy.utilities.iterables now returns a stub function that will emit a deprecation warning when called. In a future release the stub function will likely be removed so that from sympy.utilities.iterables import ordered will give an ImportError. The intended import from sympy import ordered continues to work with all SymPy versions and will not give any warning or error.

  • BREAKING: removed the since long deprecated densearith, densesolve, and densetools (#22949 by @oscargus)

  • BREAKING CHANGE: core.trace with class Tr moved to physics.quantum.trace. (#22297 by @oscargus and @smichr).

Changes

  • combinatorics

  • concrete

    • A Sum can now be rewritten as a Product. (#22331 by @oscargus)

    • free symbols appearing only in expressions of variables of integration, summation, ... no longer reported as free symbols (#22541 by @smichr)

    • fixed an issue with the use of Range (with an argument of -oo) as s Sum/Product variable range (#22363 by @smichr)

    • Performing evalf on some Sum no longer leads to comparison errors. (#22284 by @oscargus)

  • core

    • a matching issue related to matching of a leading sign on products was fixed (#22799 by @smichr)
    • Previously, Basic considered arguments that evaluate equal, but do not have the same type (e.g. 1.0 == 1), to be equal for the purposes of determining structural equality of Basics. This is no longer the case and Basics equality comparison now works the same as that of Expr. (#22651 by @ThePauliPrinciple)

    • uniquely_named_symbol uses compare (default str) to get the string name of the passed xname (#22669 by @smichr)

    • to query whether a object appears as a non-bound object, use expr.has_free(obj) (#22539 by @smichr)

    • A bug that sometimes lead to an InconstentAssumptions exception being raised in code that uses the same SymPy object in multiple threads was fixed. (#22548 by @ayushbisht2001)
    • nan is returned for any power (with exponent not 0 or 1) with infinite real and imaginary portions, e.g. 1/(oo + I*oo)->nan (#22516 by @smichr)
    • Handling of power substitutions like (1/x).subs(x**2, y) was made more robust. This indirectly fixed problems leading to incorrect evaluation of integrals. (#22052 by @oscarbenjamin and @smichr)
    • nfloat will no longer change args of user-defined functions to Float; solutions from solve may differ (#22528 by @smichr)

    • canonical will recurse into Relational args in Eq and Ne so Eq(y<x,x>y).canonical -> True (#22483 by @smichr and @sympy)

    • a Float(0) is retained during negation and simplification (#22441 by @smichr)

    • Float(0)**-oo is now zoo instead of oo (#22441 by @smichr)

    • there is better detection of small (|x| < 1) and large numbers raised to oo or -oo (#22441 by @smichr)

    • subs will handle +/-oo and zoo before other replacements to help guard against evaluating indeterminate forms (#22441 by @smichr)

    • Evaluation of expressions involving zoo is now handled properly in evalf without raising obscure exceptions. (#22211 by @eagleoflqj)

    • BREAKING CHANGE: core.trace with class Tr moved to physics.quantum.trace. (#22297 by @oscargus and @smichr)

    • Expr.could_extract_minus_sign is strictly literal about removing a leading sign on Mul or canonically preferring -a over a based on the explicit sign of each term (not on the net sign of each factor of the term) (#22232 by @oscargus and @smichr)

    • exp is handled the same as Pow wrt extract_multiplicatively (#22270 by @smichr)

    • fixed bug in mul.py related to sign of zoo. (#22281 by @praneethratna and @smichr)

    • added a functionality for count_ops to distinguish user-defined functions from other types of objects. (#22229 by @praneethratna)

    • Expr.coeff improved in handling of non-commutative sums (#22140 by @smichr and @t-ens)

    • match no longer throws are exception for certain relationals. (#22047 by @oscargus and @smichr)

    • multiplying an Add by a Rational will now yield a fully evaluated expression (#22036 by @smichr)

  • functions

    • Fixed a bug with the indefinite integral of trigonometric functions with respect to a different variable in `manualintegrate.py' (#22765 by @ddtcode)

    • bug fixed for simplification of Piecewise expressions (#22751 by @smichr)

    • condition of Piecewise which are univariate are made more canonical (redundant conditions removed) (#22751 by @smichr)

    • fixed a bug with integrating certain piecewise functions (#22540 by @NikhilSDate)

    • Added a function Rem to find remainder with same sign as the dividend (Mod has same sign as divisor). (#22347 by @gurpartap0306 and @smichr)

    • combinatorial numbers enumeration function for deranngements, nD, added that is similar to nP, nC and nT. (#21903 by @rathmann and @smichr)

    • arg will no longer nest past 3 levels for generic arg; 2 level for real arg (#22402 by @smichr)

    • Piecewise.eval is faster: removed steps that should be in simplification (#22286 by @smichr)

    • Some functions were numerically evaluated at incorrect precision. (#22325 by @oscargus)

    • Piecewise will always process True/False conditions, even if evaluate=False (#22319 by @smichr)

    • Piecewise will use global evaluate setting if present (#22319 by @smichr)

    • Better zero detection for LambertW and some hyperbolic and trigonometric functions. (#21979 by @oscargus and @smichr)

    • Better assumption support for error functions. (#22261 by @oscargus)

    • piecewise_fold has the option to avoid evaluation (#22196 by @smichr)

    • Conjugate class now has an inverse method so it should work better in the solvers. (#20720 by @kc611)
  • geometry

    • projection method of line.py now returns EmptySet when there is no projection of one entity onto another. (#22817 by @praneethratna)

    • Fixed issue when with evaluate(False) for Point2D. (#22714 by @oscargus)

    • Line class can now define horizontal and vertical lines using Eq (#22369 by @praneethratna)

  • integrals

    • The Laplace transform is now rule-based, can transform a far wider range of expressions, and works better with undefined functions, including the ability to transform differential equations. (#22376 by @hanspi42)

    • Minor fix in case of constant gcd in Risch. (#22283 by @oscargus and @smichr)

    • a bug in indefinite meijerg integration was fixed (#22196 by @smichr)

  • logic

    • Function gateinputcount added to returns the total number of inputs for all classes corresponding to gates in the expression. (#21973 by @oscarbenjamin and @oscargus)

    • Improved simplification of Boolean expressions with relations. (#22585 by @oscargus)

    • simplify_logic is faster. (#22576 by @oscargus and @smichr)

    • Many more functions added to documentation. (#22222 by @oscargus and @smichr)

    • integer_to_term will now raise an error for negative args or when the requested size is too small; use of ibin is recommended (#22301 by @smichr)

  • matrices

    • BREAKING: removed the since long deprecated densearith, densesolve, and densetools (#22949 by @oscargus)

    • Fixed bug when collapsing inverse block matrices (#22544 by @Franck2111)

    • Matrix calculus is now supported through the matrix expression derivative algorithm. Derivatives of matrix expressions are now computed in the array expressions module. The result is therefore able to represent higher dimensional arrays. If trivial dimensions are present, an attempt is made at converting the resulting array expression back to matrix expression (that is, a matrix virtually equivalent to the 4-dimensional array, if it can be found). (#22476 by @Upabjojr)
    • SparseMatrix can now be imported from sympy.matrices.sparse like Matrix can be imported from dense; both can still be imported from sympy.matrices (#22370 by @smichr)

    • Access the Hermite normal form function from polys (#22233 by @skieffer)

    • It is now possible to use .det() on matrix symbols and matrix expressions. (#22114 by @oscargus and @smichr)

  • ntheory

    • perfect_power now only raises a ValueError for non-Rational input (#22672 by @smichr)

    • Improved the performance of the is_square(n) function. (#22431 by @sweeneyde)

  • parsing

    • corrected parsing error that happened when when local_dict value was None (#22829 by @smichr)

    • parse_expr converts builtin abs, max, min, pow to sympy functions (#22169 by @eagleoflqj)

    • strings 'all' and 'implicit' can be passed to select commonly used transformations; T can be sliced to give desired transformations for parse_expr (#22255 by @smichr)

    • Support evaluate=False for common functions in parse_expr. (#22098 by @eagleoflqj)

  • physics.control

    • pole_zero_plot now supports complex-valued transfer functions. (#22775 by @oscargus)
  • physics.optics

    • lens_makers_formula() in sympy/physics/optics/utils.py can now calculate focal length of thick and plano lenses. (#20169 by @sidhu1012)
  • physics.quantum

  • physics.units

    • Added L, dL, cL and mL as synonyms to l, dl, cl and ml. (#22741 by @rikardn)

    • Fixed deprecation warning when pow exponent is malformed (#22167 by @blackyblack)

  • physics.vector

    • Fix the rendering of some diagrams in the PDF documentation. (#22468 by @asmeurer)
  • polys

    • Speed up field_isomorphism(). (#22737 by @jksuom and @skieffer)

    • Add support for conversions ANP --> AlgebraicNumber. (#22646 by @skieffer)

    • Fixed related issues in minimal_polynomial() and field_isomorphism(). (#22562 by @skieffer)

    • Fixed a bug in minpoly (#22610 by @Leowbattle)

    • Fixed a bug in minimal_polynomial(). (#22560 by @skieffer)

    • Add calculation of integral bases for number fields in polys.numberfields.basis. (#22316 by @skieffer)

    • Add prime factorization in number fields in polys.numberfields.primes. (#22316 by @skieffer)

    • Add other supporting functionality and classes. (#22316 by @skieffer)

    • New functionality can be accessed through new methods in the existing polys.domains.algebraicfield.AlgebraicField class. (#22316 by @skieffer)

    • The poly function and as_poly methods now return None instead of raising GeneratorsNeeded for constant expressions when no generators are given. (#20773 by @kc611 and @oscarbenjamin)

    • Hermite normal form (#22233 by @skieffer)

    • Utilities for non-invertible matrices (#22233 by @skieffer)

    • Additions to DomainMatrix: columnspace, rowspace, is_upper, is_lower, is_square, rank (#22233 by @skieffer)

    • Supply setitem method in DDM class (#22233 by @skieffer)

    • IntegerPowerable class: supports powering for classes that define __mul__ (#22233 by @skieffer)

    • Remove some expensive and redundant convert operations when calculating syzygies (#22273 by @isuruf)

    • Faster root computation for two-term polynomials with large integer constant. (#22243 by @oscargus)

    • The sympy.polys.numberfields module was refactored into a package with a number of submodules. (#22234 by @skieffer)

    • nroots() now checks with extra precision by default for roots. (#20737 by @kc611)
    • Fixed issue with solving quartic polynomial with complex coefficients. (#17482 by @oscargus and @smichr)

    • Improved multiple root finding when roots are complicated expressions evaluating to zero. (#17482 by @oscargus and @smichr)

  • printing

    • Less verbose LaTeX printing for Idx class (#22906 by @ThePauliPrinciple)

    • LaTeX and pretty printing of FourierSeries with zero sequence do not hang. (#22772 by @oscargus)

    • MatrixSymbol with ^ in name can be LaTeX-printed without errors. (#22772 by @oscargus)

    • No superfluous parenthesis for Adjoint and Transpose in LaTeX and pretty. (#22772 by @oscargus)

    • LaTeX printing for PowerSet and ordinals. (#22705 by @oscargus)

    • S.Catalan is now printed as G in LaTeX and pretty printers. (#22663 by @oscargus)

    • Improved LaTeX-printing of DFT and IDFT. (#22663 by @oscargus)

    • Fixed str-printing of unevaluated multiplication of reciprocals. (#22706 by @oscargus)

    • Dedicated LaTeX and pretty printing for Covariance, Expectation, Probability and Variance. (#22661 by @oscargus)

    • Support latex printing for AlgebraicNumber (#22627 by @skieffer)

    • Meijer-G function and Bessel functions in MpmathPrinter (#22506 by @scimax)

    • More automatic code rewrites to use available functions. (#22332 by @oscargus)

    • Automatic code rewrite support for the Rust printer. (#22332 by @oscargus)

    • More Maple functions supported. (#22381 by @oscargus)

    • Better support for Boolean functions (Xor, Implies, etc) in code generation through rewriting. (#22311 by @oscargus)

    • Fixed issue with printing latex of unevaluated Mul with fractions (#21101 by @iam-abbas)
  • series

    • Limit now converts Float's in the expression to Rationals or exact SymPy numbers when possible (#22213 by @0sidharth)

    • Fixed a bug due to insufficient power simplification in limits (#22182 by @0sidharth)

    • fixed bug in Order.contains (#22170 by @praneethratna)

  • sets

    • Range now has a working is_empty method for symbolic ranges. (#22087 by @oscargus)
  • simplify

    • CSE now treats matrix symbols and subelements as atomic in cse (#22840 by @peabody124, @smichr, and @zouhairm)

    • the presence of UndefinedFunction no longer affects how expressions with gamma functions are simplified (#22618 by @smichr)

    • powsimp now recognizes any negated exponent that is an integer or that occurs on positive bases (#22578 by @smichr)

    • signsimp is used as an inexpensive first step to cancel (#7708 by @smichr)
    • signsimp will extract a minus sign from an Add more reliably when evaluate=False (#22232 by @oscargus and @smichr)

    • Fixed issue with simplifying infinity plus rational imaginary. (#22024 by @oscargus)

  • solvers

    • Bernoulli differential equations are more often classified as such in classify_ode because of a fix to matching (#22799 by @smichr)
    • disabling lower-order solvers automatically disables higher order solvers: cubics=False automatically sets quartic and quintic to False, too (#22642 by @smichr)

    • Fixed a bug causing solve to raise GeneratorsNeeded when an equation such as sqrt(2) is included in a system. (#20773 by @kc611 and @oscarbenjamin)

    • Bug in nonlinsolve with exp leading to exception sorted out. (#22423 by @oscargus)

    • use of match was removed to make solving more reliable (#22097 by @Maelstrom6 and @smichr)

    • solveset correctly solves arg when the argument is complex. (#21925 by @oscargus)

  • tensor

    • Array expression submodule has now reached a stable state and has been added to the documentation. (#22936 by @Upabjojr)
    • Change the signature of ArraySymbol from ArraySymbol(name, *shape) to ArraySymbol(name, shape). (#22324 by @Upabjojr)
  • utilities

    • multiset_derangements has an optimized finishing routine (#22904 by @smichr)

    • corrected a special-case derangement of a multiset where a single repeated element multiplicity is 1 less than the non-repeated elements (like 'mmabc' or 'mmmabcd') (#22904 by @smichr)

    • generate_derangements formerly always emitted derangements from filtered permutations; now, when a multiset is involved, the much faster multiset_derangements is called and the ordering of derangments will be different than before. (#22904 by @smichr)

    • Basic lambdify support for 1-D and 2-D NDimArray (#22740 by @oscargus)

    • Fixed issue with lambdify of a Piecewise with ITE conditions. (#22740 by @oscargus)

    • language_level is automatically set to 3 when compiling with cython using utilities._compilation, but can be overridden by providing another language_level. (#22742 by @oscargus and @sympy)

    • iterables function for generating derangements of a sequence was added (#21903 by @rathmann and @smichr)

    • postorder_traversal is moved from utilities.iterables to core.traversal. (#22323 by @oscargus)

    • interactive_traversal is moved from utilities.iterables to interactive.traversal. (#22323 by @oscargus)

    • Fixed issue with incorrect lamdifying behaviour of Mod when modules = []. (#22080 by @bjodah)

  • vector

    • Always return Derivative instance from _diff_conditional in operators.py since the coeffs may be functions of the base scalars even if expr is not (#20047 by @lindsayad and @smichr)
  • other

    • Add a documentation guide listing SymPy's optional dependencies. (#22693 by @asmeurer)
    • Visitors to the documentation site, docs.sympy.org, using screen readers should have the text announced in the correct language. (#22812 by @bertiewooster)

    • bare Relational (x == 1) and binary operations (x + 1) will raise a code-quality error if they are in the test suite and not in a with-block (#22485 by @smichr)

    • Use MathJax version 3 in the docs (#22467 by @asmeurer)

    • manual file-hander pitfall was removed (#22410 by @NaelsonDouglas and @python-pitfalls)

    • Type hints were added to silence all mypy errors in the sympy codebase. (#22212 by @oscarbenjamin)

Authors

The following people contributed at least one patch to this release (names are given in alphabetical order by last name). A total of 68 people contributed to this release. People with a * by their names contributed a patch for the first time for this release; 33 people contributed for the first time for this release.

Thanks to everyone who contributed to this release!

  • Wang Ran (汪然)*
  • Advait*
  • AkuBrain*
  • alijosephine*
  • anutosh491*
  • Leo Battle*
  • Oscar Benjamin
  • Anurag Bhat*
  • Ayush Bisht
  • Remco de Boer
  • Francesco Bonazzi
  • Zach Carmichael
  • Kaustubh Chaudhari
  • James Cotton
  • Björn Dahlgren
  • Nikhil Date*
  • Risiraj Dey*
  • Travis Ens*
  • Isuru Fernando
  • Tom Fryers*
  • Matthias Geier
  • Naman Gera
  • Pieter Gijsbers*
  • Oscar Gustafsson
  • Sayandip Halder
  • S. Hanko*
  • Jerry James
  • Kuldeep Borkar Jr*
  • Evgenia Karunus*
  • Steve Kieffer*
  • Andreas Klöckner
  • Matthias Köppe
  • Ayush Kumar
  • lastcodestanding*
  • S.Y. Lee
  • Andrey Lekar*
  • Alex Lindsay
  • Qijia Liu
  • Hampus Malmberg*
  • Anibal M. Medina-Mardones*
  • Aaron Meurer
  • mohajain*
  • Abbas Mohammed*
  • Jeremy Monat*
  • Jason Moore
  • Sidharth Mundhra
  • naelsondouglas*
  • Joannah Nanjekye
  • Rikard Nordgren
  • Chris du Plessis
  • Mamidi Ratna Praneeth
  • rathmann
  • Hanspeter Schmid
  • scimax*
  • shubhayu09*
  • Sudeep Sidhu
  • Gagandeep Singh
  • Gurpartap Singh*
  • Chris Smith
  • Paul Spiering*
  • Aaron Stiff
  • Kalevi Suominen
  • Dennis Sweeney*
  • Diane Tchuindjo*
  • Aman Thakur*
  • Eric Wieser
  • Zouhair*
  • zzj*

SHA hashes

6cf85a5cfe8fff69553e745b05128de6fc8de8f291965c63871c79701dc6efc9 sympy-1.10.tar.gz 2009368e862cd29f1b568dc6572786371a2faa1cd8eb4d313e11a90195d6ee36 sympy-1.10-py3-none-any.whl 362fb7ff7437a8ac156147395c89487c156ba57ba406655a6fddace30c4b0fc6 sympy-docs-html-1.10.zip de6a8445dbf0bf8f094495b18ccc49e1800d598adc40e194962ebe8792401164 sympy-docs-pdf-1.10.pdf

⚠️ **GitHub.com Fallback** ⚠️