by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 03:53
    friyaz labeled #19476
  • 03:50
    friyaz commented #19480
  • 03:31
    friyaz labeled #19480
  • 02:56
    sylee957 commented #19479
  • 02:53
    sylee957 commented #19479
  • 02:26
    sympy-bot updated the wiki
  • 02:26
    sympy-bot commented #18814
  • 02:26
    sympy-bot commented #18814
  • 02:26

    smichr on master

    fix(solvers): solve_linear_syst… fix(solvers): solve_linear_syst… fix(solvers): solve_linear_syst… and 1 more (compare)

  • 02:26
    smichr closed #18814
  • 02:26
    smichr closed #2275
  • 02:26
    smichr closed #18531
  • 02:26
    smichr closed #6420
  • 02:26
    smichr closed #4949
  • 02:25
    smichr commented #18814
  • 01:27
    sylee957 commented #19465
  • 01:26
    sylee957 reopened #19465
  • 01:24
    sylee957 synchronize #19466
  • 01:08
    codecov[bot] commented #19466
  • 01:08
    sympy-bot commented #19466
ThePauliPrinciple
@ThePauliPrinciple
The first integral (over x) seems to work fine
The second one is where the problems start
mcpl-sympy
@mcpl-sympy
Hi. I would like to report that issue #15276 can be closed, since it seems that TensExpr.data is deprecated.
Dhruv Mendiratta
@dhruvmendiratta6
This is in reference to #19277, I need help as to how an unevaluated derivative can be returned for Absclass as it is suggested that this way it could be useful to substitute functions later when needed in calculations.
Eric Wieser
@eric-wieser
@ThePauliPrinciple: does it work if you do the three integrals sequentially, in the order z, y, x?
Eric Wieser
@eric-wieser

I've got a patch that's running into some circular import issues, and part of the problem is sympy.core.function._coeff_isneg, which in my opinion does not belong there.

Where would be a good place to move that function to?

Kalevi Suominen
@jksuom
Maybe mul. It is also checks MatMul but obviously the function should be in core.
Eric Wieser
@eric-wieser
Yeah, that makes sense to me. Turns out my attempt to break the cycle is doomed to fail anyway, but moving that may still make sense
mcpl-sympy
@mcpl-sympy
I was informed that implementing String class was discussed in the past, and eventually turned down. (https://groups.google.com/forum/#!topic/sympy/tNm1LDcEXA4) Does anyone remember why it was rejected? I really would like to know.
Eric Wieser
@eric-wieser
Perhaps a better way to go would be a Named base class, which stores a name outside of args?
mcpl-sympy
@mcpl-sympy
If we are storing the name outside of args, I'd say str is sufficient. The problem is, obj.func(*obj.args) will return different result with this approach.
Eric Wieser
@eric-wieser
That's already broken on symbol anyway
There's discussion somewhere on GitHub about whether thats actually a sane invariant for atoms
At any rate, Named.func could be a @property implemented as functools.partial(type(self), name=name)
Or even as lambda: self
mcpl-sympy
@mcpl-sympy

I was concerned that we may want to give name to non-atomic objects, where obj.func(*obj.args) must return original one. For me, the fact that Symbol is broken here does not matter much since it is an atomic object so we won't need to travel the branch beneath it.

Making func return partial or lambda can break many things. I have seen many codes in SymPy using obj.func to return the class of obj.

Eric Wieser
@eric-wieser
My comment above refers to sympy/sympy#19324
mcpl-sympy
@mcpl-sympy
Thanks!
47box
@47box
Hi, I would like to know if its allowed ask questions about how to operate sympy in here?
Thanks
mcpl-sympy
@mcpl-sympy
I have made a PR which introduces a hook that supplants "postprocessor". Although oscarbenjamin is kindly reviewing this, it is core-related change and I would like to have as many feedbacks as possible.
If anyone is interested, please refer to https://groups.google.com/forum/#!topic/sympy/XNAgvD02_PA and #18769, and join the discussion. Thanks.
Eric Wieser
@eric-wieser
Thanks for pointing me to that, very relevant to galgebra
It might be worth comparing to the design of __array_function__ or __array_ufunc__, which are other implementations of python multiple dispatch in the wild
Suryansh Anand
@spiritmonster
Hey guys, Suryansh here. So I would like to get into OSS. I used to previously think that GSOC only promotes Web Dev OSS until I found an article and it had stated that I can do it in AI/ML as well. I was thrilled. I would love to be get your guidance. Please guide on how can i start with OSS and what all do i need to know. I know python and java and I know the basic ML algorithms. Yeah so thats it guys please let me know how can i proceed and what should be my next steps.
Dhruv Mendiratta
@dhruvmendiratta6
@jksuom Can you help me with #19277 Abs(x**3).diff(x) gives x**2*Derivative(Abs(x), x) + 2*x*Abs(x) which I think is wrong plus I can't think of how to return an unevluated derivative for Abs.
Kalevi Suominen
@jksuom
There are actually two versions of Abs, one defined on Reals and the other on Complexes. The problem is that the latter function does not have a derivative in the same sense as most functions of SymPy.
mcpl-sympy
@mcpl-sympy
Can anyone restart the travis in #19066, please?
Kalevi Suominen
@jksuom
Done.
Bruno Pedrosa
@brupelo
Hi, why [v for v in symbols("k1 k2 k3", real=True, constant=True) if not v.is_constant()] is giving k1,k2,k3?
7 replies
said otherwise, how can i get the non constant symbols from a function as I'd like to compute the gradient of a function
Rudr Tiwari
@dkodar20
There was an article in the sympy documentation in which ondrej explained how one can start understanding with large codebases. I am a beginner hence i need that document(or possibly any other) but currently I am finding it missing. Also I find the architecture link broken( I think it was here where the article which i state was located). It will be great if someone can help out.
4 replies
Suryansh Anand
@spiritmonster
Hello could anyone please help me on how to get started?
1 reply
Zachariah Etienne
@zachetienne
Hi all. I just did some cProfiling of my code, and some sympy functions are taking up most of the runtime. Are there any tips for improving the performance of sympy by e.g., cythonizing it as a whole or parts?
Isuru Fernando
@isuruf
@zachetienne, it depends on what you are trying to do
For eg: simplify is a big hammer, and you might need only a small function that simplify calls
Zachariah Etienne
@zachetienne
@isuruf : That makes sense. A lot of time is spent in basic.py:2012(_preorder_traversal), radsimp.py:23(collect), expr.py:124(__eq__), cache.py:91(wrapper), and compatibility.py:570(ordered). I'm just not sure how difficult it would be to cythonize any one of these (even if it'd be possible), or whether there'd be a perf gain (if it were possible)
Isuru Fernando
@isuruf
@zachetienne, have you seen symengine?
It would help to see your code
I don't know if cythonizing would help or not
Zachariah Etienne
@zachetienne
@isuruf : No I hadn't seen symengine. Thanks for pointing that out!
Zachariah Etienne
@zachetienne
@isuruf : I tried out the symengine.cse() routine (which contributes significantly to runtime in my code) but unfortunately it didn't provide a speedup
(used pip install symengine and import symengine as ...)
Hantao Cui
@cuihantao
In version 1.6, I'm running into an issue with sympify. I want to sympify a string with comparison 'u * (dae_t <= 0)'. The comparison is supposed to yield the truth value of it. sympifying this equation works well using SymPy v1.5.1 but does not come through in v1.6 (conda installation). Error message: unsupported operand type(s) for *: 'Symbol' and 'LessThan'. Any suggestion?
Aaron Meurer
@asmeurer
I guess this was made to be an error. I'm not sure if it gave the thing you expected before.
5 replies
You can use Piecewise((1, dae_t <= 0), (0, True)) to convert from boolean to number. I don't know how to easily get that from your string without just rewriting it.
Isuru Fernando
@isuruf
@zachetienne, can you share your code?
Zachariah Etienne
@zachetienne
@isuruf : Sure! It's open source: https://github.com/zachetienne/nrpytutorial . My code is completely documented in Jupyter notebooks (table of contents here: https://nbviewer.jupyter.org/github/zachetienne/nrpytutorial/blob/master/NRPyPlus_Tutorial.ipynb), but you can run e.g., python3 BaikalETK/BaikalETK_main_codegen_driver.py to generate something useful (note that it uses multiprocessing to help speed up the process, but still takes ~minutes to complete). Note that this is the command that I used to profile symengine (replacing calls to sympy.cse() with symengine.cse())
Isuru Fernando
@isuruf
@zachetienne, can you print the expression to a file and send it to me? It would make it easier.
Zachariah Etienne
@zachetienne
@isuruf Sure: here are 6 of the ~100 expressions that need to be processed: http://astro.phys.wvu.edu/zetienne/outRicci.txt
(through cse; note that these 6 are processed in a single cse call, so common subexpressions are found throughout the expressions. Also note that each expression is separated by a linebreak.)