GSoC Project Availability

48 views
Skip to first unread message

Shivam Sharma

unread,
Mar 27, 2023, 11:23:31 AM3/27/23
to sympy
Hi,

I am a Computer Science PhD student working in Computational Geometry. I have been exploring problems in "exact geometric computation" and had come across Herbie during my literature survey. I was amused to know that SymPy is implementing a similar functionality through the project "Optimize floating point expressions".

Since there is little time left for the submission deadline, I wish to know if the project "Optimize floating point expressions" has already been allocated. Otherwise, I'd choose to draft a proposal for "Polynomial GCD".

Regards,
Shivam


Aaron Meurer

unread,
Mar 27, 2023, 3:33:24 PM3/27/23
to sy...@googlegroups.com
GSoC projects are not "allocated". We do accept/reject proposals, but
this isn't done until after the proposal deadline. If you are
interested in working on the "optimize floating-point expressions"
project I would suggest submitting a proposal for that. As far as I
know, no one has submitted a proposal for it this year so far.

Aaron Meurer

>
> Regards,
> Shivam
>
>
> --
> You received this message because you are subscribed to the Google Groups "sympy" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to sympy+un...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/e75cd70b-af10-4539-a602-4b511c547511n%40googlegroups.com.

David Bailey

unread,
Mar 27, 2023, 3:52:56 PM3/27/23
to sy...@googlegroups.com
Dear Group,

This is probably not feasible, but imagine an AI program that could take
a small SymPi program together with the desired output. The goal would
be devise a modification of the program so that would work.

Obviously such a program could not always work, but if it could solve a
reasonable percentage of such problems, it would ease the workload of
those who answer these queries and make SymPy more attractive to
inexperienced users.

For example, I sent the following faulty program to the group a few days
ago:

import sympy
from sympy import *
k=symbols("k")
f=Function("f")
print("f(k)=",f(k))
print("sum=",sum(f(k),(0,k,10)))

The intended output was:


f(0)+f(1)+f(2)+f(3)+f(4)+f(5)+f(6)+f(7)+f(8)+f(9)+f(10)

The program used 'sum' instead of 'Sum' and the order of the iterator
was scrambled - it was a total goof, I admit!

Thus ideally the output from ChatGPT would simply correct the program -
not solve the problem a different way, such as merely printing out the
desired answer! I.e. it would 'realise' the intention of the author of
the query.

David

Aaron Meurer

unread,
Mar 27, 2023, 4:19:15 PM3/27/23
to sy...@googlegroups.com
I mean, did you try it? If you want ChatGPT to do something that involves manipulating text, chances are it can, or at can at least get you part of the way there.

I gave the following prompt to ChatGPT:

I have a program


import sympy
from sympy import *
k=symbols("k")
f=Function("f")
print("f(k)=",f(k))
print("sum=",sum(f(k),(0,k,10)))

The intended output is

f(0)+f(1)+f(2)+f(3)+f(4)+f(5)+f(6)+f(7)+f(8)+f(9)+f(10)

but instead the output is

f(k)= f(k)
Traceback (most recent call last):
  File "<stdin>", line 6, in <module>
TypeError: 'f' object is not iterable

how can I fix the problem to give the intended output?


and it produced the following output:

The issue with the current code is that the sum function expects an iterable object, but f(k) is a single object of type Function. In order to fix this, you can create a list or a generator expression to provide the iterable sequence to the sum function.

Here's an updated code that should give the intended output:


import sympy
from sympy import *
k = symbols("k")
f = Function("f")
expr = sum(f(i) for i in range(11))
print(expr)

This code creates a generator expression (f(i) for i in range(11)), which generates the values f(0), f(1), f(2), ..., f(10) when iterated. The sum function then takes this iterable as an argument and computes the sum of its elements.

The output of this code should be:

f(0) + f(1) + f(2) + f(3) + f(4) + f(5) + f(6) + f(7) + f(8) + f(9) + f(10)

The output from ChatGPT is correct. It says to use sum with a generator instead of Sum(), but this is fine because if the sum is an explicit expanded finite sum there's no need to use a symbolic summation.

Aaron Meurer



--
You received this message because you are subscribed to the Google Groups "sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sympy+un...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages