It used @SymPy, not NumPy. When I started SymPy almost 20 years ago, my university classmates were telling me that it could never match Mathematica, so what's the point? And now the most popular (?) LLM uses SymPy by default. That's amazing!
Interesting to see how different LLMs check if a big even number is prime:
ChatGPT: Uses NumPy to test the number numerically
Grok: Instantly sees it’s even → not prime
Cool to see @openai demo solving a @sympy issue (from SWE-bench) in their o3 demo today. At a glance the AI's fix looks correct (though not quite as straightforward as the true fix that was made).
ALT Screenshot from OpenAI o3 announcement livestream showing o3 solving a SymPy issue.
ALT Screenshot of livestream showing o3's solution to the issue
I made a @SymPy GPT to play around with this. Unlike normal ChatGPT it has direct access to the latest version of SymPy (1.12) and its docs. It also tries to actually execute code whenever it can. chat.openai.com/g/g-AePkBhsF…
Introducing the GPT Store: Over 3M GPTs have been created and now you can find the most useful versions of ChatGPT for you.
openai.com/blog/introducing-…
"Towards a new SymPy: part 1"
In this first of a series of blog posts, Oscar Benjamin writes about the ongoing work to improve the performance of SymPy. oscarbenjamin.github.io/blog…
"Towards a new SymPy: part 2 - Polynomials"
Part 2 of this series of blog posts discusses the SymPy polynomials module and how it relates to SymPy's performance oscarbenjamin.github.io/blog…
Tutorials @SciPyConf are in full swing! Ever want to do algebra, calculus, or advanced differential equations directly in Python? Check out the “SymPy Introductory Tutorial” co-led by our @asmeurer to learn the basics of @SymPy.
cfp.scipy.org/2023/talk/LJQP…
I noticed @OpenAI uses @SymPy in their "Code interpreter" demo at their ChatGPT plugins webpage (openai.com/blog/chatgpt-plug…). I am very happy to see SymPy being used by default like this.
I integrated ChatGPT into cocalc.com as a chatbot (though much more is to come). You can just do @ and select chatgpt when chatting anywhere in cocalc (doc.cocalc.com/chat.html) and it responds. Here's an example of it knowing #sympy.
The maximum occurs where the derivative is zero.
#SymPy code:
>>> from sympy import symbols, diff, log, solveset
>>> c = symbols('c')
>>> diff(c ** (1 / c), c)
c**(1/c)*(-log(c)/c**2 c**(-2))
>>> solveset(-log(c)/c**2 c**(-2), c)
{E}
¡¡Wow!! Gracias a @Sympy logré una mejora de x2500 (sí, no es typo) en el tiempo de ejecución de una función.
De paso, uno se da cuenta de la diferencia de velocidad entre Python y C nativo.
PS: No programe en C, Sympy hizo la transformación "automáticamente" por mí.
#Python and #SymPy code for Matthew's discovery:
>>> from sympy import symbols, factorial, limit, oo, N
>>> n = symbols('n')
>>> f = lambda n: factorial(n) / (n 1) ** n
>>> limit(f(n) / f(n 1), n, oo)
E
>>> N(_)
2.71828182845905
(3 of 2) ;-)
From a LaTeX formula to optimized code : with @SymPy , I found it was possible to automatically go from a LaTeX formatted equation through a numpy function to a JAX jit optimized function that runs 300x faster on GPU than the numpy version on CPU! Made my night & day!
Please fill out our survey about code generation in SymPy to help us understand what areas we should focus on improving as part of our work for our @cziscience grant. forms.gle/F5Ek6yQkH5fXPNYK6