Skip to content

Diofant 0.14.0

Latest
Compare
Choose a tag to compare
@skirpichev skirpichev released this 12 Apr 05:15
· 317 commits to master since this release
v0.14.0
f4cc0e4

Construction of Poly's from expressions is now significantly faster with using recursive algorithm (former poly() function):

In [1]: %time p = Poly((x + 1)**1000, x)
CPU times: user 178 ms, sys: 3.88 ms, total: 181 ms
Wall time: 182 ms

while on the v0.13:

In [1]: %time p = Poly((x + 1)**1000, x)
CPU times: user 1min 4s, sys: 55.9 ms, total: 1min 4s
Wall time: 1min 4s

or in the current SymPy master:

In [1]: %time p = Poly((x + 1)**1000, x)
CPU times: user 4.78 s, sys: 26.9 ms, total: 4.8 s
Wall time: 5.05 s

Support for directional limits on the complex plane was added:

In [1]: limit(sqrt(-1 + I*x), x, 0, dir=exp(I*pi/3))
Out[1]: -

Direction exp(I*theta) at the limit point x0 indicates the direction tangent of a curve approaching the limit point. Special cases -1 (former dir=+) and +1 (former dir=-) correspond to theta=pi and theta=0 (i.e. limit from above or from below on the real line).

This release got better support for limits of piecewise and boolean expressions

In [1]: Piecewise((x**2/2, x <= 1/2), (x/2 - 1/8, True))
Out[1]:
⎧  2x
⎪ ──    for x1/22
⎨
⎪x   1
⎪─ -otherwise2   8In [2]: limit(_1, x, 0)
Out[2]: 0

In [3]: limit(_1, x, oo)
Out[3]: ∞

In [4]: limit(x > 0, x, 0)
Out[4]: true

In [5]: limit(x > 0, x, 0, dir=1)
Out[5]: false

Also, for good or bad, now you could use any unicode symbols for identifiers (python does NFKC-normalization while parsing) in the Diofant console:

$ python -m diofant --no-ipython --unicode-identifiers
>>> Naturals

>>>  = Naturals
>>> N = 2
>>>   # will print 2 in plain Python

DOI

See release notes.