Skip to main content

vipdopt: Volumetric Inverse Photonic Design Optimizer

Vipdopt is a package for streamlining the inverse deisgn of nanophotonic devices. This package largely serves as a Python-based wrapper for Lumerical. Vipdopt also provides an interactable GUI for creating optimizations and monitoring their progress.

This code performs an inverse-design optimization based on the adjoint optimization technique 1 that designs a freeform multilayer optical Bayer filter and focusing lens as described in 2. The Bayer filter is multiwavelength and focuses and sorts different spectral bands into different prescribed locations on the focal plane. Otherwise known as a color router, this code is set by default to create a 10-layer filter for the visible spectral range, with lateral and vertical dimensions of 2.04 microns. Different options are available in the config to, for example, enable polarization sorting or adjust the spectral bands as necessary.

Tutorials, Examples, and Documentation

See the documentation

Requirements

  • Python 3.10
  • Ansys Lumerical FDTD 2021 edition or later
  • An installation of MPI, for running simulations in parallel
  • Qt6

If creating a conda environment, there is not official PySide6 package yet. After activating your environment, you will need to install PySide6 with pip.

Usage (Command Line)

To run an optimization, Vipdopt requires a project_directory containing two files:

  • A configuration file containing optimization parameters
  • A sim.json file containing the base simulation file to run with Lumerical

More details regarding configuration files are located here.

To run an optimization from a pre-existing project directory, run:

python vipdopt optimize path/to/project/directory

To see more options, run

python vipdopt --help

Outputs

All created files and logs are packaged and output to the selected project folde by default. The internal folder structure is as follows:

  • data: Data generated in the optimization
    • opt_info: captures pertinent information about each iteration and epoch of the optimization. Save data is also collected here for the event that an optimization needs to be restarted.
  • .tmp: Lumerical .fsp simulation files and log files that are used to calculate the adjoint and forward E-fields for calculation of the optimization gradient.

The folder opt_info collects information about optical figures of merit, the latest 3-D permittivity values of the designed device, the adjoint gradient, and contains auto-generated plots of the evolution of these values throughout the optimization.
(Please note that values such as transmission are not normalized rigorously for these auto-generated plots, as the inclusion of the proper monitors in Lumerical for rigor would slow down each optimization iteration greatly.)

A log file is also created in the main project folder, named with the specified name using the --log option (defaults to dev.log).

GUI

The GUI can be started by running

python vipdopt gui

This will launch a dashboard that can monitor the progress of a optimization.

A Screenshot of an example optimization loaded in the GUI

From the dashboard you can also open a dialog for editing 3 the optimization parameters

A .GIF demo using the GUI

While starting and stopping the optimization through the GUI is not completely supported yet, there are some experimental features pertaining to those functions.

Clicking the "Start Optimization" button will create a slurm script that can be submitted to run the optimization. To alter the output file format, edit vipdopt/submit.sh. The parameters of running the job are included in this file according to the SLURM Documentation. More information can be found there.

  1. https://doi.org/10.1364/OE.21.021693 ↩

  2. https://doi.org/10.1364/OPTICA.384228 ↩

  3. Editing and saving an optimization though the GUI is not yet fully supported. However you can still use this window to view the various parameters. ↩

Metadata

Release files for vipdopt 2.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for vipdopt 2.0.2
File Size Uploaded
vipdopt-2.0.2.tar.gz 45.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for vipdopt 2.0.2
File Interpreter ABI Platform
vipdopt-2.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 77.4 kB

Release files / vipdopt-2.0.2.tar.gz

Download URL vipdopt-2.0.2.tar.gz
Size 45.0 kB
Tags Source
SHA-256 checksum
How to use checksums
37cde1b01232adf9c9c84eabfc40e3fa8c218fd143330ccd1a4b3374ecdbfde7
BLAKE2b-256 checksum
How to use checksums
695bb7a6740c8cc0f5daf4ca73f111aa0ab955af5dee22689337ac43eed04875
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.10.5

Release files / vipdopt-2.0.2-py3-none-any.whl

Download URL vipdopt-2.0.2-py3-none-any.whl
Size 32.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5d76a79283410064234563c78dfc5bafeaa3446fc02a9f6a6e2ac1708d454e96
BLAKE2b-256 checksum
How to use checksums
c03a88a2f94ce956d2068b474a239bbde33065b3c431f69b582dcafb2d35f548
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.10.5

Release history Release notifications | RSS feed

This release

2.0.2 This release

2 release files

2.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page