Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 15:34
    github-actions[bot] commented #22872
  • 14:25
    me-t1me synchronize #22872
  • 14:09
    me-t1me synchronize #22872
  • 13:44
    sympy-bot commented #22872
  • 13:44
    me-t1me opened #22872
  • 13:35
  • 13:32
    me-t1me closed #22871
  • 13:29
    me-t1me edited #22871
  • 13:27
    sympy-bot commented #22871
  • 13:27
    me-t1me opened #22871
  • 13:22
    bjodah commented #22867
  • 12:59
    ThePauliPrinciple commented #22867
  • 12:17
    github-actions[bot] commented #22851
  • 10:49
    jhonsnow456 synchronize #22851
  • 10:30
    Devansh-46 starred sympy/sympy
  • 10:11
    oscarbenjamin commented #22852
  • 09:43
    jksuom commented #22852
  • 09:33
    oscarbenjamin commented #22860
  • 09:32
    me-t1me commented #22860
  • 09:32
    oscarbenjamin commented #22860
ThePauliPrinciple
@ThePauliPrinciple
In particular "Idx(i,(0, N−1)),Idx(j,(0, N−1))" could just "i,j" for me when using the latex printer
*the prefered method
Oscar Gustafsson
@oscargus
@anutosh491 so it works? -pdflatex="xelatex" should be the same as -xelatex as far as I understand. But great if it works!
@ThePauliPrinciple The best way would be to add a _print_Idx-method to the LaTeX printer and it seems like your approach is probably what everyone would like. If you want to make your own, you can subclass the LaTeX printer and (re)define that method.
Oscar Gustafsson
@oscargus
All other printers use these lines, which may do the trick:
def _print_Idx(self, expr):
return self._print(expr.label)
Anutosh Bhat
@anutosh491
@oscargus I was just about to write back to my previous message . Yeah that worked . So so happy ,took me a whole day since 6 am -6pm here in india to figure out so many small small errors due to which test_sphinx.sh wasn't passing . Now I can peacefully contribute/send PR's . All this is due to WSL and its compatibility with different modules/packages in Sympy . Eg inkscape commands haven't been implemented in Ubuntu(20.04/19.04) installed through WSL so had to find a way around that (some dirty trick I had to do) .
ThePauliPrinciple
@ThePauliPrinciple
Hmm, I seem to get some issues now with the colab printing snippit I stole
Anutosh Bhat
@anutosh491
I feel most of the contributors would be setting up sympy on linux and not windows probably hence not all would be facing such errors but still for ones who would eventually set it up on Windows I would be writing a blog of how one can successfully setup up Sympy on windows and get around the shortcomings in WSL1/WSL2 and maybe if that's good enough , i'll ask the community if I can put it up on the developement workflow setup for refernce on github wiki
ThePauliPrinciple
@ThePauliPrinciple

class custom_latex(sy.printing.latex):
def _print_Idx(self,expr):
return self._print(expr.label)

complains "init() takes 3 positional arguments but 4 were given" I feel like I'm writing some typo I don't realise?

Oscar Gustafsson
@oscargus
@anutosh491 I think your are correct. I have not set up document building on my Windows laptop...
@ThePauliPrinciple latex is just a wrapper for the class LatexPrinter.print() if I recall correctly.
So you should subclass LatexPrinter instead and possibly provide a similar command.
ThePauliPrinciple
@ThePauliPrinciple
Ah I see
ThePauliPrinciple
@ThePauliPrinciple
Yeah, got it to work!

class CustomLatexPrinter(LatexPrinter):
def _print_Idx(self,expr):
return self._print(expr.label)

@sym.printing.printer.print_function(CustomLatexPrinter)
def custom_latex(expr,**settings):
return CustomLatexPrinter(settings).doprint(expr)

ThePauliPrinciple
@ThePauliPrinciple
Thanks a lot :)
ThePauliPrinciple
@ThePauliPrinciple
from sympy import IndexedBase,symbols,Idx,Derivative
X = IndexedBase('X')
D = IndexedBase('D')
i= symbols('i', cls=Idx)
Derivative(X[i]*X[i],D[i])
Is there some way to tell sympy that X is a function of D?
pillsy
@pillsy
Is there a way to match (not just replace) a pattern where the argument is fixed and the function is wild?
In Mathematica, I'd match a pattern like f_[x]
pillsy
@pillsy
Variations on this don't work:
sympify('f(x)').match(Function(Wild('g'))(Symbol('x')))
(Stripping the commutative assumption off of the Wild symbol doesn't do the trick....)
pillsy
@pillsy
OK, I can do something like this:
F_x = Wild('F', properties=[lambda e: e.args == (x,)])
Swagat S. Bhuyan
@SwagatSBhuyan
Hello, I'm Swagat from india. Looking forward to contributing to Python. If anyone would be kind enough to guide me in these initial stages of getting the hang of it and starting to contribute, that would be really great. Thanks!
Tirthankar Mazumder
@wermos
I too am looking to contribute to SymPy!
Sidharth Mundhra
@0sidharth
https://github.com/sympy/sympy/wiki/Introduction-to-contributing has some pointers to help get you started
Anutosh Bhat
@anutosh491
Hello ,I am trying to approach couple of issues involving Sum.doit() but I am not able to understand completely how doit works for a Sum/Integral ( sometimes the recursive call and other times the not so self-explanatory variables like 'rep','did' etc (yeah i know its not possible to write self-explanatory variables always) in the code throw me off and finding it a bit tough to relate as a whole .
any guidance by someone familiar with doit/concrete module regarding how does doit calculate a basic sum like an infinite geometric series would be great ! Thanks
ThePauliPrinciple
@ThePauliPrinciple
Just wanted to point out that I wrote some ideas/examples in https://github.com/sympy/sympy/discussions/22219 looking forward to any feedback
ThePauliPrinciple
@ThePauliPrinciple
Thanks for the reply @oscarbenjamin !
falematte
@falematte
image.png
I think that I found a bug on the evaluation of the limits of a function that I summarize in this pic. Any tips? I can also provide the code to reproduce it.
Of course L and r are symbols positive defined
falematte
@falematte
I have opened and Issue here, please contribute sympy/sympy#22220
The limit is different in the discontinuity points.
ThePauliPrinciple
@ThePauliPrinciple
I am looking to setup a workflow to work on a pull request. In particular, I am looking for some way to be able to edit the library and then immediately check manually/interactively if I obtained the intended result. For example, to have a conda environment which uses the fork as the source for sympy. Any ideas? I have read through the development workflow document, but I feel I'm missing the point on how to do this effectively.
anonbox.netuser
@anonbox.netuser:matrix.org
[m]
Hi, is sympy 1.9 officially released? I saw it is tagged on github, but the usual files for downloading are missing and pypi also only lists 1.9cr1 as latest version. The sympy.org website is also not helpful in this regard, showing the release of 1.7.1 as latest news.
Anutosh Bhat
@anutosh491
Hi guys , I was solving an issue regarding functions/limits and I came across something which might help . So do we have any method /function in sympy that checks whether some function/expression might encapsulate or bound another expression . Like is there any way I could check something like -1/x < cos(x)/x < 1/x or even one sided
ThanhVu (Vu) Nguyen
@nguyenthanhvuh
Hi, it seems that the .subs function is quite slow. When I have a long expression e (can contain nonlinear terms like x**2, y*x*z), calling e.subs(some_dict) takes quite sometime (a sec or so). In fact subs is often slower than solving for large equations. Am I using subs correctly?
빈백에 박제가 되어버린 로듐을 아시오?
@45Rh_science_twitter
image.png
hi guys i'm new with sympy, so can anyone help me with solving this problem?
I was trying it on my own, but i can't get a grip on how to solve this Error
image.png
import sympy as sp
from sympy import exp, oo

sp.init_printing()

x = sp.Symbol("x")
a, m, h = sp.symbols("a, m, h", positive = True)
A = sp.Symbol("A")

f = exp(-2 * a * m * x**2 / h)
int_f = sp.integrate(f, (x, 0, oo))

eq1 = 2 * (abs(A))**2 * (int_f) - 1

print(sp.solve(eq1, A))
ThePauliPrinciple
@ThePauliPrinciple
A = sp.Symbol("A",real=True) seems to give a solution (although I have not verified it is the correct solution)
빈백에 박제가 되어버린 로듐을 아시오?
@45Rh_science_twitter
I'll give it a try thanks!
wow it works thank u!!!!
Henry smith
@Henrysm41987301_twitter
Hello all. Henry here , I'm using sympy for the first time for one of my course project reports at my University. The course is based on series and summations overall and while trying to get familiar I realized that Sum((-1)**(x+1) + (-1)**(x+2) , (x, 1, oo)).is_convergent() is not returning the expected result and raises a TypeError saying Invalid NaN comparison , is this a meaningful error or Am I missing something useful ?Maybe I could raise an issue ?
anonbox.netuser
@anonbox.netuser:matrix.org
[m]
Try: sym.simplify(sym.Sum((-1)**(x+1)+(-1)**(x+2),(x,1,sym.oo)))