- Join over
**1.5M+ people** - Join over
**100K+ communities** - Free
**without limits** - Create
**your own community**

- 20:01sigurdsvela commented #19685
- 19:51codecov[bot] commented #19680
- 19:42
- 19:34sympy-bot commented #19596
- 19:34smichr commented #19596
- 19:34
smichr on master

Impoved simplification for sign… Made suggested changes Update sympy/functions/elementa… and 6 more (compare)

- 19:34smichr closed #19596
- 19:34smichr closed #19484
- 18:54
oscarbenjamin on master

printing: Update the example to… Convert the example to a doctes… Merge pull request #19622 from … (compare)

- 18:54oscarbenjamin closed #19622
- 18:54oscarbenjamin commented #19622
- 18:53oscarbenjamin commented #19040
- 18:50oscarbenjamin labeled #19688
- 18:50oscarbenjamin milestoned #19688
- 18:50oscarbenjamin commented #19688
- 18:16
oscarbenjamin on sympy-1.6.1

- 18:16AlanPearl closed #19688
- 18:16AlanPearl commented #19688
- 18:08sachin-4099 synchronize #19680

Hi @eric-wieser -- I totally agree. We did try, that was indeed the very first thing, but no luck. IIRC, it's a by-product of an earlier xreplace. @mloubout may wanna elaborate. Anyway, here's the code, quite ugly admittedly:

https://github.com/devitocodes/devito/blob/master/devito/types/basic.py#L951-L954

basically, this is the kind of transformation we're after: https://github.com/devitocodes/devito/blob/master/devito/ir/equations/algorithms.py#L82

https://github.com/devitocodes/devito/blob/master/devito/types/basic.py#L951-L954

basically, this is the kind of transformation we're after: https://github.com/devitocodes/devito/blob/master/devito/ir/equations/algorithms.py#L82

@FabioLuporini

`nsimplify(x+1.0, rational=True)`

should be faster as well (looks like it just iterates over expr.atoms(Float))

ah, thanks @ehren . This is worth a shot!

lemme see if I can look up why we can't work around the Float in the first place

Thanks for your answers and ideas. In short

o prevent the Float getting in there in the first place.

This one is only partially doable as it will depend what users do. So we can control some of it but it is very likely we will end up with Float no matter what.

nsimplify(x+1.0, rational=True)

Yes we tried this one, I found out that this is still quite slower than brute force sympify+xreplace atoms. (a small test on `x + 2.0`

benchmarks nsimplify at ~2.5ms and brtute force at ~25.6 µs ). If it was a one time thing we would definitely go the `nsimplify`

that is a lot nicer, however we touch this line thousands of times in some cases and speed is critical.

Or are they not writing that code?

and it wouldn't really fix the "issue" would it? because after the warning, we'd still have to process the Floats, and I'm afraid lots of codes are currently doing that

What I have are the D_a, D_b and g_ab and I want to get a curve_fit from numpy for all the rest

in some cases, I get float values out, and numpy is happy, in some other cases, the output of the lambdified function is still symbolic, such as: 1/(1.07677275611132e-17*(1/(0.1*D_a_eff/(1.0*D_a_eff + 0.1) + 0.1))**5.0 + 1.0000001734153)

I'm sure I'm missing something simple here but I can't find what

you can try with: numpy_function(0.004, 0.0004,0.1, 0.1, 5.0, 5.0, 0.0, 1)

out of curiosity, is there any plan on releasing 1.6.1, just like we had 1.5.1 shortly after 1.5? we're unfortunately stuck with 1.5.1, but the patches we've submitted have been merged into sympy master, so... well, I guess I'm just looking forward to the next release :)

2 replies

(there was a regression with 1.6 concerning, IIRC,

`collect`

or one of its sibling functions)
Hi all. I found a major performance regression in sympy-dev (i.e., within the past 24 hours), and reported it here: sympy/sympy#19534 . It's appearing in

`series()`

I would appreciate if those of you who might have an idea of which patch might be at fault (again, happened within the past 24 hours), to share that info with me. Thanks!
1 reply

Hello I have noob question: I am coming from using Pysat (https://pysathq.github.io/), and there to represent a boolean formula, there is a defined type formula (https://pysathq.github.io/docs/html/api/formula.html). Is there something similar in sympy to represent algebraic formulas?

SymPy can represent local predicates if that is what you mean https://docs.sympy.org/latest/modules/logic.html

1 reply

HI everyone im a high schooler going to 11th grade and I am completely new to open source. I love mathematics so i was naturally inclined to this python library. I have no idea where to start whatsoever and I dont know how to fix or start fixing bugs. If anyone can help me I would really appreciate it!

Welcome @SriLikesToSing. Take a look at the issues tagged Easy to Fix and pick one that looks interesting. If you get stuck ask a question about it.

Is there a way to specify that the identity operator must act as identity also on the adjoint operators?

`from sympy.physics.quantum.dagger import Dagger`

`from sympy.physics.quantum.operator import Operator`

`from sympy.physics.quantum import IdentityOperator`

`A = Operators('A')`

`Identity = IdentityOperator()`

`A * Identity #This gives A, correctly`

`B = Dagger(A)`

`B * Identity #This returns A^\dagger I . so it does not remove the identity operator`