AI in Optical Design: Designing Beam Shapers
If you scroll through LinkedIn lately, you’ve probably seen this: "I asked ChatGPT to design some optics and it gave me nonsense."
And to be fair, the skeptics are right - if you are trying to design a complex imaging system from scratch using AI, good luck. The "hallucination" rate for imaging optics is still too high to be useful.
However, dismissing AI entirely because it can't design a microscope objective is throwing away your lottery ticket before the draw. There are specific, high-value workflows where AI isn't just a toy - it's a genuine accelerator.
Workflow 1: The Coding Assistant (Because Manuals Are Missing)
One of the most immediate applications is simply programming and scripting.
Optical simulation software is powerful, but often for an innovative idea custom workflows are needed. If you are trying to construct the backbone of your code or automate a routine task, AI is surprisingly competent at generating the correct syntax.
In my experience, AI doesn't inherently "understand" how the optical design software works. But frankly, the blame there often lies with the manufacturers. Manuals are difficult to access if you didn’t buy the software, impossible to download. AI models that have scraped the available documentation can often fill this gap, helping you write scripts for your custom optics application.
Workflow 2: Laser Beam Shaping (Let’s demonstrate)
While imaging is hard, laser beam shaping is a relatively "simple" problem—and that simplicity makes it a playground for AI.
Let’s look at in-focus shapers. These devices use a thin plate with a very low sag (almost invisible) aspheric surface on one side. For instance, telescope corrector plates are such.
- Why they are great: The lower the sag, the easier they are to produce. There is less material to remove (via CNC or diamond turning) or add (via lithography).
- How they work: You send a standard Gaussian input beam through the shaper, followed by a focusing lens.
- The trick: The focal length of the lens doesn't strictly matter for the shape itself. By changing the input beam diameter or the lens focal length, you can simply tune the size of the shaped spot in focus.
Because the physics here is straightforward and rather simple, we can use AI to do the heavy lifting.
The Experiment
To prove this works, I didn't open a textbook. I opened Gemini.
I asked to write an executable code (you can ask for Python, MATLAB, or whatever you prefer) to calculate the aspheric shape required for a beam shaper using:
- A f=100mm focal length lens.
- A specific glass material (fused silica).
- A chosen input beam diameter.
I also asked it to fit a general asphere to this radial shape and calculate the fit error. (It's a good way to check that the output is not BS).
The Simulation
I downloaded the generated code, executed it, and extracted the aspheric coefficients.
For the simulation, I switched to FRED (Photon Engineering). If you have worked with Zemax all your life, handling coherent beams in FRED feels miraculously easy by comparison.
I plugged in the AI-generated coefficients, added a Gaussian source with the correct diameter, a plano-convex lens, and a detector.
Voila, this is the result:
FRED model side view with rays

Irradiance in focus:

The profile to prove that it's really (mostly) flat:

Problem "Solved" vs. The Full Picture
In a simple case like this, you can even ask the AI to run the code, generate the plots, or perhaps add a basic ray-tracing visualization.
But let's be realistic. While the fundamental design is "solved," the engineering is not. There are gaps between this script and a physical product:
- Material choices: Is my material choice right?
- Coatings: How will stray light affect the system?
- Tolerancing: Can your manufacturer actually make that profile?
- Optimization: Is this the best solution, or just a solution?
You will likely find issues even with this simple design. Having a traditional expert involved is still necessary to give the solution confidence and manufacturability. Otherwise, you have just pushed your project feasibility check to a later point.
The New Standard: Imagination + Verification
It is interesting to see how easy the "start" has become. Would you rather shape your beam into a spiral? Do you need code for a laser resonator? Just ask.
In the “good old times”, you would have hired an expert to design this for you, and you might have run out of budget before you even built a prototype. Today, you only need two things to get started:
- Imagination: To know what to ask for.
- Base Knowledge: To distinguish between the "brown" output (nonsense) and the right one.
There are many AI models emerging for optical design, but you should not expect to download a fully manufacturable system directly from a prompt. However, tools like rAIoptics are already emerging to give you a solid starting point or guide you through the process.
Keep in mind, experts aren't obsolete - but the experts who use AI are going to move forward with your project a lot faster than before.