SkillAgentSearch skills...

LightwaveExplorer

An efficient, user-friendly solver for nonlinear light-matter interaction

Install / Use

/learn @NickKarpowicz/LightwaveExplorer
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

<p align="center"><img src="Source/BuildResources/Icon.svg" width="256" height="256"></p>

<p align="center">Lightwave Explorer</p>

<p align="center">Nick Karpowicz<br> Max Planck Institute of Quantum Optics</p>

Publication!

Tutorials on YouTube!

  • <a href="https://youtu.be/JY4wm2e7y_M">Explanation of the new beam modes in version 2026.1</a>
  • <a href="https://youtu.be/sZ5Evkgj4Vk">Introduction, main tutorial (2026 update!)</a>
  • <a href="https://youtu.be/qlcy_RBLGoU">Adding a crystal to the database</a>
  • <a href="https://youtu.be/v5O0UOUdfKE">Birefringence</a>
  • <a href="https://www.youtube.com/watch?v=4njswvog4bo">FDTD</a>

Documentation!


Latest release: 2026.1 (changelog)

Windows: Download .zip (note: if you use SYCL for GPU acceleration on intel, please use the newest DPC++/C++ Compiler Runtime; you don't need this if you're not using intel graphics).

Free code signing on Windows provided by SignPath.io, certificate by SignPath Foundation

Linux:

<a href='https://flathub.org/apps/io.github.NickKarpowicz.LightwaveExplorer'> <img width='240' alt='Get it on Flathub' src='https://flathub.org/api/badge?locale=en'/> </a>

Mac: compile it yourself


What and why

Lightwave explorer is an open source nonlinear optics simulator, intended to be fast, visual, and flexible for students and researchers to play with ultrashort laser pulses and nonlinear optics without having to buy a laser first.

<p style="text-align: center;"><img src="Documentation/Images/flatpakScreenshot.png"></p>

The simulation can make use of Nvidia or intel GPUs on Windows, and on Linux, Nvidia, AMD, and Intel. On all platforms, including Mac, it can also run on your CPU.


Main goals:

  • Easily extensible database of materials: Eveything the program knows about nonlinear materials comes from a human-readable text file giving the appropriate coefficients and tensors. If you want to use a new material, or you've done a measurement in a new range where typical extrapolations from older data isn't relevant, it's easy to add and correct. There are places for references for the key parameters, and these references are stored in the saved simulation results for future reference. Especially if you have simulations that you checked against experiments, I'd be very happy for you to add your crystal definitions to the central database in the project Github.
  • Accurate modeling of nonlinear optics using multiple, user-selectable physical models, including the unidirectional nonlinear wave equation and finite-difference time-domain approaches. This allows calculations that accommodate large systems where forward-propagation is an appropriate assumption, but also of etalon effects in thin crystals where reflections cannot be neglected.
  • Efficient code so that complicated systems can be simulated in 3D: Real laser pulses can be messy, and if they weren't so before a nonlinear crystal, there's a good chance they are after (but not always). If things are slow, it's hard to go beyond one dimension on tolerable time scales, and then you miss out on the whole weird world of spatiotemporal couplings. Here you have options for rather fast simulations when there's a symmetry to apply (e.g. cylindrical or along one Cartesian dimension), alongside fully 3D propagation. Runs natively on both GPU and CPU to make use of whatever you have to work with.
  • A graphical interface that lets you see what you're doing: A lot of us think in visual terms. Being able to adjust and scan parameters and immediately see what happens can really make it easier to understand what you're looking at.
  • A flexible sequence mode: By stringing together elements, not just nonlinear crystals but also spherical or parabolic mirrors, apertures, filters, free space propagation and other elements, simulate how one interaction affects another. Sequences of events can be scripted and even programmed with loop functions to see how things change over the course of repeated interactions.
  • Fitting modes: Sometimes the data that we measure depends in an interesting way on a parameter, and we'd actually like to go back and figure out what that parameter was from the data. Solving this kind of inverse problem can be tough when the parameter lives inside a partial differential equation, but by simulating the whole thing and doing a fit, you have a chance to do it! The fitting algorithm can be used to narrow down a huge space of variables to come at your best estimation of what was happening in an experiment, or to adjust your experimental system to maximize output at a given frequency.
  • A Python module for easy postprocessing of the results: I hope that you get something interesting out that you want to plot and maybe publish. One of the nicest platforms for making nice plots is Python in my opinion (that's why the documentation is in a Jupyter notebook), so purely out of self interest I tried to make it easy to load the results in Python. The module also has some functions related to typical operations you'd like to do on the data to make it easy for all of us. The program also gives you a Matlab loading script for those who want to use that. To get it, it's just
pip install LightwaveExplorer
  • Multiplatform: Works on Windows, Linux, and Mac.
  • Command line interface for running on Linux/clusters: the simulation core can be compiled as a command line application to be controlled via the SLURM system. The GUI app can automatically configure the SLURM script, as well. I use this to run it on the clusters of the Max Planck Society, and other institutes and universities likely have similar systems. This lets you do a lot more if your personal resources are limited but you want to run simulations on a large grid or cover a lot of different parameters!

Publications

Lightwave Explorer has been used in the following papers!


Compiling the GUI app on Linux

You will at least need the development versions of following installed: fmt, Qt, Cairo, and TBB (these are what they are called on Fedora/dnf, the names might slightly differ on your repo):

fmt-devel, qt6-qtbase-devel, cairo-devel, tbb-devel

Next, the basic command is to use cmake in the usual way:

mkdir build && cd build
cmake ..
cmake --build . --config Release

and you should have a binary to run. You should either install it (sudo cmake --install .) or copy the files CrystalDatabase.txt and DefaultValues.ini to the build folder and run it.

The basic build will run on your CPU only.

In order to run on a GPU, the options are either CUDA (Nvidia) or SYCL (Intel, AMD or Nvidia).

CUDA

To enable CUDA, you need additional flags. Here's an example:

cmake -DUSE_CUDA=1 -DCMAKE_CUDA_HOST_COMPILER=clang++-17 -DCMAKE_CUDA_COMPILER=/usr/local/cuda/bin/nvcc -DCMAKE_CUDA_ARCHITECTURES=86 ..
  • USE_CUDA should just be set to 1.
  • Your CUDA_HOST_COMPILER should be a version of g++ or clang++ compatible with your version of CUDA
  • Your CUDA_ARCHITECTURES should match your card (on consumer boards: 75 for 20-series, 86 for 30-series, 89 for 40-series)

SYCL

A different set of flags will let you compile to use SYCL. You'll need a SYCL compiler. For Intel, you should use the one in the OneAPI basekit. For AMD, use the open source version.

Here's an example for AMD:

cmake -DUSE_SYCL=1 -DBACKEND_ROCM=gfx906 -DROCM_LIB_PATH=/usr/lib/clang/18/amdgcn/bitcode -DCMAKE_CXX_COMPILER=clang++ ..
  • USE_SYCL should be 1
  • BACKEND_ROCM should be set to the board architecture you want to use. This case was with a Radeon VII.
  • ROCM_LIB_PATH might not be necessary for your system, but on Fedora it was. You have to locate the bitcode folder of the ROCM install.
  • the compiler is the special version of clang++ from the [DPC++ project](https://github.com/intel/llv

Related Skills

View on GitHub
GitHub Stars103
CategoryDevelopment
Updated18d ago
Forks12

Languages

C++

Security Score

100/100

Audited on Mar 18, 2026

No findings