westoncb a day ago

Author here. This is a bit of an unusual project, but I can break down the gist of it in two main pieces.

The first is a new web-based, real-time nonlinear optics simulator for the situation of light propagating within a reflective cavity with an adaptive lens structure at the center. My understanding of the landscape of NLO simulators is there's not much real-time or for the web, so extracting that bit of code (within simulation.js) may be a decent starting point for other projects. That said, depending on what your goals for simulation the level of accuracy provided by a real-time simulation may not be sufficient. My understanding is that if you are doing detailed simulation to refine e.g. lens structures intended for production in the real world you likely need more detailed modeling than the slow varying envelope approximation (SVEA) that I use here.

The other aspect of the project is a little difficult to describe but I was basically trying to create a minimal idealized model of a setup with nonlinear dynamics controlled by an optimization process as a kind of "pendulum" setup for whatever's the minimal essential magic behind the efficacy of e.g. transformer models. The exploration is not complete, but the idea was basically like: is there some switch where an alteration in technique in the optimization structure ends up being a step-function more effective in controlling the light fields than without. That's the general idea. More specifically what started the project though was being curious whether you could in some way use waves reflected from a boundary as an error signal for a backpropagation-like process. I found out in the course of my work here that this has been done in practice using phase-conjugate waves to encode the corrections. In order to create these phase-conjugate waves you'd need a "four-wave mixing" setup, which the simulation in its present state does not support but could be extended to.

A note on process: this project was basically kicked off because I tried one-shotting a basic version of it with openai's o1 model and it worked a lot better than I was expecting, so much of the motivation here was also to see how much I could use sota LLMs to assist on a project like this.

  • pizza 21 hours ago

    Just wanted to say: you’re on the right track with the transformers by light idea - because I had the exact same wish. For instance, RWKV <-> Rotman lens antennas lol

haxiomic a day ago

This is extremely cool! Curious on the story behind this /u/westoncb!

It reminds me of Huygens Optics' recent videos about modelling particles as confined light using a particular non-linear medium [0], is it possible to create similar 'light' particles with tweaks to your setup?

[0] https://www.youtube.com/watch?v=tMP5Pbx8I4s

  • westoncb a day ago

    Thank you! I'll take a look at the video—haven't seen it yet but I'll take a look in minute. Some more background on the project in this tweet: https://x.com/Westoncb/status/1879689465360445834

    • dang a day ago

      Can you post a comment to this thread giving some of that background and explanation? If so, I'll move it to be the top text of this post. Right now it's a bit hard to tell what we're looking at, though it looks cool!

      • westoncb a day ago

        Yep, it'll take me a minute, but on it. Thanks!

dvh a day ago

Does nonlinear optics also create harmonics as with nonlinear electronics?

  • jbay808 a day ago

    Yes, this is how frequency-doubled lasers work (eg. 532 nm green laser pointers, which are generated as a harmonic from a 1064 nm Nd:YVO4 laser by a nonlinear KTP crystal).

qoez a day ago

No idea in what field/application this is useful but it's really cool and impressive nonetheless

ivanjermakov a day ago

Anyone knowledgeable in this field who could share how this can be applied?

  • xeonmc 21 hours ago

    yes, it's called lasers.