ChatGPT does Igor!

I was able to get ChatGPT to come up with nice IgorPro code... That's nice...

OK, this seems to be new. So far I haven't seen a successful attempt for this. Could you please share a bit more details? What did you ask it to do and what was the output? I think in general AI understands C code well, which is reasonably close to Igor code, but it lacks in the details. I wonder if this can be overcome with the limited exposure available.

I asked CGPT to write an Igor Pro snippet to round an integer to the nearest even integer, and it wrote it perfectly. Seemed to know about Igor Pro programming and saved me 5 minutes!

OK, so now I asked Perplexity.ai to write Igor Pro code to simulate N particles in a 2D space subject to a central force, using periodic boundary conditions and viscous drag so that the velocity is proportional to the net (non-drag) force. It wrote a 112-line code that appears to work perfectly. It seems work by finding some relevant Python code and then effectively translating it into Igor Pro. I did have to give it one more hint to make the code compile, but then it worked.

I tried using BoltAI to train various models (chatgpt included) to write Igor code for me. 

My next step (not yet done) was to feed it the igorexchange forum and see if that made it any smarter.

Results were less than great... I'm curious what your prompts look like.  

  

I don't want to be that guy, but I would be more than unhappy with someone scooping up Igor Exchange (with my humble contribution included) to feed it to some AI. I mean, Google, OpenAI and co. are probably doing this anyway without any remorse, but that does not mean that it won't make a few (or likely many) people regret interacting with the internet, possibly reducing the amount of helpful content in the long run.

I’m trying to train a chat bot to help fix my code as I go along. As you said, this requires exposure, of which 99% is on igor exchange.

For what it’s worth, I haven’t tried it yet and I’m open for more discourse on the topic. I think many of us, who do science, want the tools, want to be ethical, and are also creators of the content these bots ingest.  

Haven’t evaluated the quality of the code yet but perplexity cites several Igor exchange pages for its response.

https://www.wavemetrics.com/code-snippet/convert-triplet-data-grid-matrix

https://www.wavemetrics.com/forum/general/converting-waves-multiple-waves

https://www.wavemetrics.com/forum/general/transpose-and-rename-large-data-set

there are 5 more citations including the Igor pro manual and an introduction to Igor programming guide from a 3rd party. 

Perplexity query (642.2 KB) Last 5 citations (641.26 KB)

Just to finish off the tangent I started: Yes, I am all for responsible AI development, which promises to be a huge help for many people in many applications. Unfortunately, this field has been very much tainted by the bad behavior of a few tech companies trying to make a quick buck, which is getting worse by the day. I hope we will see a shift to a more positive development when the grifting has died down. In any case, I appreciate your transparent communication regarding your goal and your tests.

OK, one more success. I have lists of the form "1,2,3,4,1,3" where some of the items are duplicates. I wanted to convert this to a list with no duplicates. Here is the prompt I gave to Perplexity.ai:


I have a list in Igor Pro. The list consists of strings separated by commas. Some of the list items may be identical. I would like code to make the list contain only one instance of each string, so that there are no duplicates.

It created a 16-line function that worked perfectly (after I added a "/S" to indicate the function is returning a string). Note that my prompt isn't even quite right, because my input is actually a single string containing items and semicolons, while I said in the prompt that I had individual strings separated by semicolons (whatever that might mean).

If you need little snippets to do a task that would take some fiddling around to get right, Perplexity does a pretty impressive job.

In reply to by chozo

chozo wrote:

[...] I would be more than unhappy with someone scooping up Igor Exchange [...] reducing the amount of helpful content in the long run.

I agree. But... as someone proved... they are already doing this. 

Instead of using ChatGPT, I have found uploading the Igor Manual to https://notebooklm.google.com/ to be very helpful, and faster than manually searching when I forget the name of a function like WaveType.