Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 18:57
    asmeurer commented #23488
  • 17:45
    github-actions[bot] commented #23538
  • 17:44
    sympy-bot updated the wiki
  • 17:44
    sympy-bot commented #23538
  • 17:44

    smichr on master

    Dummies now replaced in lambdif… Merge pull request #23538 from … (compare)

  • 17:44
    sympy-bot commented #23538
  • 17:44
    smichr closed #23538
  • 17:44
    smichr closed #23536
  • 17:07

    smichr on master

    sympify target_units in convert… Merge pull request #23537 from … (compare)

  • 17:07
    sympy-bot commented #23537
  • 17:07
    smichr closed #23537
  • 17:06
    smichr commented #23538
  • 17:05
    smichr auto_merge_enabled #23538
  • 17:03
    github-actions[bot] commented #23537
  • 16:18
    sympy-bot commented #23538
  • 16:18
    moorepants opened #23538
  • 15:36
    sympy-bot commented #23537
  • 15:36
    smichr opened #23537
  • 15:11
    sympy-bot commented #23534
  • 15:11
    sympy-bot updated the wiki
Karl H
@KarlJoad
Ok... So, can cases of sympy.compatibility.integer_types be replaced with Python 3's built-in int clas?
Aaron Meurer
@asmeurer
Yes
Also FWIW sympy.core.compatibility is only designed for internal use in SymPy, so using it in an external library is not recommended. We don't make any backwards compatibility guarantees for that module.
Karl H
@KarlJoad

Ok, I'll do that then, and hopefully it works.

Ok. I'm not the core maintainer, so I don't have any control over that.

Oh, I assume the same holds true for sympy.compatibility.string_types and python 3's str class, correct?
Aaron Meurer
@asmeurer
Yes
Thomas Aarholt
@thomasaarholt
Hiya, I'm about to submit a PR for cupy support on top of #20271
Just a quick question: The numeric computation docs mention Theano support, but I was unable to get that to work. Does it currently work?
Thomas Aarholt
@thomasaarholt
Scratch that, a quick search among the GH repo issues shows that it should work fine. I wonder where I went wrong!
AbhishekS78
@AbhishekS78
hello everyone,
can anyone tell me if sympy is participating in GSoC 2021 or not?
if yes then, can anyone show me the direction for GSoC 2021 for sympy organization, I am very much interested in contributing
petschge
@petschge
Any ideas why I run into the issue reported at sympy/sympy#20629 ?
kunalsingh2002
@kunalsingh2002
Hello Mentors , I'm KUNAL SINGH 2nd year computer science undergraduate from IIT Kharagpur, India , I'm very much interested in contributing to sympy but I'm unable to find a starting point , can anyone help me with this ?
Suryam Arnav Kalra
@suryam35
Hi developers !
I am Suryam Arnav Kalra , second year undergraduate student in Computer Science and Engineering department at IIT Kharagpur , India.
I am a beginner in open source and i am interested in contributing to Sympy. It would be really great if you could help me get a starting point to begin my journey.
Harshit Yadav
@hyadav2k
Hi @kunalsingh2002 @suryam35, you guys can start with https://github.com/sympy/sympy/wiki/Introduction-to-contributing for starters, and then you can refer to the docs https://docs.sympy.org/latest/index.html. For the later part, refer to https://github.com/sympy/sympy/wiki/Development-workflow.
Thomas Aarholt
@thomasaarholt
Hiya. Given func = sp.lambdify(args, expr), is it possible to print the "string" that lambdify compiles, ie. the expression that is eventually called by numpy (or mpmath)?
Aaron Meurer
@asmeurer
@thomasaarholt yes, you can look at inspect.getsource(func), or just func?? in ipython
1 reply
Craig Russell
@ctr26
"Does anyone know how to give sympy known identies to help it with tricky integrals? I'm doing an integral across all space for a bessel function and I have a neat identity which I think would help sympy to solve it."
The manual integrate module was suggested but the identity I have is for a definite integral
And I don't think manual integrate works with definite integral rules?
Eva Tiwari
@evatiwari
I have a doubt which is not exactly SymPy related, but it might help me out with an issue. What is the difference between tensor product of two matrices and two bras/kets? Why is it that the dagger of one does not change the order, while that of the other does?
Eva Tiwari
@evatiwari
@ctr26 could you open an issue for the same? There is a function called heurisch(), which deals with Bessel functions, but it is only for indefinite integrals and is based off of a slow algorithm. I did not find any option which is as good as manual integrate (which, you are right, does not work with rules for definite integrals).
Craig Russell
@ctr26
Have done thanks
What does it mean when heurisch never returns an output?
Eva Tiwari
@evatiwari
@ctr26 it hangs, on interrupting the process it shows the traceback.
Craig Russell
@ctr26
Lambda_0*((-r + x/M)*exp((-(-r + x/M)**2 - y**2/M**2)/(2*\sigma_g**2)) - (r + x/M)*exp((-(r + x/M)**2 - y**2/M**2)/(2*\sigma_g**2)))**2/(2*pi*M**2*\sigma_g**6*(exp((-(-r*sin(2*pi/m) + y/M)**2 - (-r*cos(2*pi/m) + x/M)**2)/(2*\sigma_g**2)) + exp((-(-r*sin(4*pi/m) + y/M)**2 - (-r*cos(4*pi/m) + x/M)**2)/(2*\sigma_g**2))))

and

16*Lambda_0*(-M*x_0_tau + x)**2*(M*lambda*besselj(1, 2*pi*n_a*sqrt(M**2*x_0_tau**2 + M**2*y_0_tau**2 - 2*M*x*x_0_tau - 2*M*y*y_0_tau + x**2 + y**2)/(M*lambda)) - pi*n_a*sqrt(M**2*x_0_tau**2 + M**2*y_0_tau**2 - 2*M*x*x_0_tau - 2*M*y*y_0_tau + x**2 + y**2)*besselj(0, 2*pi*n_a*sqrt(M**2*x_0_tau**2 + M**2*y_0_tau**2 - 2*M*x*x_0_tau - 2*M*y*y_0_tau + x**2 + y**2)/(M*lambda)))**2/(pi*lambda**2*(M**2*x_0_tau**2 + M**2*y_0_tau**2 - 2*M*x*x_0_tau - 2*M*y*y_0_tau + x**2 + y**2)**3)

Trying to integrate either of these across infinity in x

sympy.Integral(integrand,(x,-sympy.oo,sympy.oo)).doit()

StackTraces respective:
https://pastebin.com/FTafTjF9
https://pastebin.com/u9NTQPib

Neither converges " @evatiwari

Craig Russell
@ctr26
These stack traces after running it for a bit longer
https://pastebin.com/SCHykTyR https://pastebin.com/WRgXuTHu
Eva Tiwari
@evatiwari
I'll try looking into this. If I find something I'll let you know.
Shreyas M S
@Shreyas-MS
Hi, I'm trying to write a parser that converts expressions from my custom expression language to sympy friendly expressions. Does anyone have any resources that would help me? my end goal is to convert expressions written in my language and translate it to something I can evaluate in sympy/numpy.
Nicolai Prebensen
@nicolaipre_twitter
Hi. I am having some trouble implementing inverse_phi (euler's totient) with prime factorization for very large numbers. Does sympy have any inverse_totient functionality, or could someone possibly point me in the right direction for implementing this using SymPy?
Given (p-1)(q-1) I want to find n, for phi(n) = (p-1)(q-1). I.e: phi(n) = 24 --> n = pq = 35 , except I need it to handle numbers as large as 4529255040439033800342855653030016000000000++
Harshit Yadav
@hyadav2k
Hi, Is there some way to access the function which is to be differentiated i.e. the argument of the Derivative, for e.g. In y=Derivative(x2+2,x), how can I access x2+2.
Kalevi Suominen
@jksuom
In [13]: y.args[0]
Out[13]: 
 2    
x  + 2
Harshit Yadav
@hyadav2k
Thanks a lot!! :)
Vishesh Mangla
@Teut2711
image.png
I want to solve a bvp numerically with steps. This is my relation. 1<i, j<5 . the number of equations are huge. How can I make them and then solve with the help of sympy?
shardul semwal
@Shardul555

Hello all, I was adding a test case for an issue where I encountered assertion error, I do not have much idea about it. Can someone guide me how it can be resolved?

Traceback (most recent call last):
File "/home/shardul/sympy/sympy/series/tests/test_series.py", line 208, in test_issue_9173
assert Q.series(y, n=3) == b_2y**2 + b_1y + b_0 + O(y**3)
AssertionError

Vishesh Mangla
@Teut2711
why don't you use the debugger @Shardul555 ?
shardul semwal
@Shardul555
@XtremeGood okay I was unaware of it , thank you.
JSS95
@JSS95
Hi, is there any way to convert expression containing power, like expr = (x^2 * y^3), to unevaluated Mul like Mul(x, x, y, y, y, evaluate=False)?
Sayandip Halder
@sayandip18
Can anyone tell me if it is possible to pull changes from an old PR? Two of my PRs were from a system which has broken down and now I'm unable to work on them.
11 replies
Aitik Gupta
@aitikgupta
@sayandip18 You can always fetch from someone's (in your case, your own) fork, and checkout that branch.
This link might help. :)
Sayandip Halder
@sayandip18
Thanks!
Sayandip Halder
@sayandip18
Suppose, I've defined a Sympy function of the type f(a-x) or f(x-a), for example, Heaviside(4-x). Is there any way to access this a-x(here, 4-x) from outside?
shardul semwal
@Shardul555
I run the code for this expression in the terminal having installed sympy version 1.7.1 but here the coefficients of y**2 and y are not simplified to final answer. Anyone guide me regarding this issue whether it is done with some purpose or this should be fixed?(Sympy live shell is giving final simplified answer)
>>> from sympy import *
>>> from sympy.abc import y
>>> var('p_0 p_1 p_2 p_3 b_0 b_1 b_2')
(p_0, p_1, p_2, p_3, b_0, b_1, b_2)
>>> Q = (p_0 + (p_1 + (p_2 + p_3/y)/y)/y)/(1 + ((p_3/(b_0*y) + (b_0*p_2 - b_1*p_3)/b_0**2)/y + (b_0**2*p_1 - b_0*b_1*p_2 - p_3*(b_0*b_2 - b_1**2))/b_0**3)/y)
>>> Q.series(y, n=3)
y*(b_0*p_2/p_3 + b_0*(-p_2/p_3 + b_1/b_0)) + y**2*(b_0*p_1/p_3 + b_0*p_2*(-p_2/p_3 + b_1/b_0)/p_3 + b_0*(-p_1/p_3 + (p_2/p_3 - b_1/b_0)**2 + b_1*p_2/(b_0*p_3) + b_2/b_0 - b_1**2/b_0**2)) + b_0 + O(y**3)
>>> simplify(y*(b_0*p_2/p_3 + b_0*(-p_2/p_3 + b_1/b_0)) + y**2*(b_0*p_1/p_3 + b_0*p_2*(-p_2/p_3 + b_1/b_0)/p_3 + b_0*(-p_1/p_3 + (p_2/p_3 - b_1/b_0)**2 + b_1*p_2/(b_0*p_3) + b_2/b_0 - b_1**2/b_0**2)) + b_0 + O(y**3))
b_2*y**2 + b_1*y + b_0 + O(y**3)
4 replies
Sayandip Halder
@sayandip18
solve(x**2 - y**2, [x,y]) returns [(-y, y), (y, y)]. Shouldn't the answer be [(-y,y), (-x,x)] instead?
10 replies
Mohit Dilip Makwana
@mohitdmak
Hey all! I am a cse fresher from Bits Pilani, and new to open-source. I like the features provided by Sympy and would want to know how can I contribute to it. I have a fair amount of experience with python,c++, and framework Django. If any mentor here can help me with how to start, it would be a great help !
Suryam Arnav Kalra
@suryam35
Hi @mohitdmak , you can start with https://github.com/sympy/sympy/wiki/Introduction-to-contributing for starters, and then you can refer to the docs https://docs.sympy.org/latest/index.html. For the later part, refer to https://github.com/sympy/sympy/wiki/Development-workflow.
Sidharth Mundhra
@0sidharth
Can anyone give me some hints on how I can go about debugging a RecursionError (for specifics, sympy/sympy#9449 )? Any hints you can give would be great as I'm seeing this part of the codebase for the first time. Should I focus on the statements before the recursion happens or during (I have tried printing values during both but still wasn't able to figure anything out)?
1 reply
Mohit Dilip Makwana
@mohitdmak
Thanks @suryam35 , on it.
UberGuy
@UberGuy_gitlab
Hey folks. Possibly n00b question. I'm interested in SymPy for its symbolic simplification features, using it to rearrange complicated expressions built by by sometimes naive automation. I'm leaving everything fully symbolic, so none of the Symbols or Functions have assigned values or concrete implementations. I've had great luck using SymPy this way using parse_expr() with a bit of transformation logic to ensure the expressions are well-formatted in ways SymPy expects. I am stumped by one thing, though. Some of my expressions contain functions are logical (boolean) , so I get expressions like f(x) & g(y). But the default transformations turn these into Functions, which aren't considered Booleans, and thus cause TypeErrors when used as arguments to BooleanFunctions like And() or Not().
Is there an accepted way to declare a Function-like symbol that counts as a Boolean type for these purposes? Is there some better way to achieve this?
Thanks for any assistance, and Happy New Year!
1 reply