Skip to main content

Differentiable RCWA in PyTorch, based on TORCWA

Project description

solwa-0.1.0

  • License: LGPL

Differentiable Rigorous Coupled-Wave Analysis (RCWA) package based on PyTorch


Features

solwa (solar + rcwa) is a PyTorch implementation of rigorous coupled-wave analysis (RCWA) based on torcwa https://github.com/kch3782/torcwa

  • GPU-accelerated simulation

  • Supporting automatic differentiation for optimization

  • Units: Lorentz-Heaviside units

    • Speed of light: 1

    • Permittivity and permeability of vacuum: both 1

  • Notation: exp(-jωt)


Installation

currently only installation from source is supported

PyTorch ≥ 2.10 is recommended for improved CUDA performance (see PR: https://github.com/pytorch/pytorch/pull/166715)


significant changes from the original torcwa

  1. Constants are loaded from standard libraries instead of defining them again in the code.
  2. Major cleanup of the code structure for better readability and maintainability.
  3. Better error handling and messages.
  4. Addition of functions for calculation of the poynting vector and power flux.

solwa Examples

  1. Example 0: Fresnel equation

  2. Example 1: Simulation with rectangular meta-atom
    Normal incidence / Parametric sweep on wavelength / View electromagnetic field

  3. Example 1-1: Simulation with stacked meta-atom
    Normal incidence / View electromagnetic field

  4. Example 2: Simulation with square meta-atom
    Oblique incidence / View electromagnetic field

  5. Example 3: Simulation with rectangular meta-atom
    Normal incidence / Parametric sweep on geometric parameters

  6. Example 4: Gradient calculation of cylindrical meta-atom
    Differentiation of transmittance with respect to radius

  7. Example 5: Shape optimization
    Maximize anisotropy

  8. Example 6: Topology optimization
    Maximize 1st order diffraction


Acknowledgements

The fundamental implementation, including mathematical formulation, was implemented in the torcwa package by Changhyun Kim and Byoungho Lee.

This solwa package is a modified version of torcwa for better usability. It will be continuously updated to include more features and improvements.

If this package is useful for your research, please cite the following paper:

@article{
	title = {TORCWA: GPU-accelerated Fourier modal method and gradient-based optimization for metasurface design},
	journal = {Computer Physics Communications},
	volume = {282},
	pages = {108552},
	year = {2023},
	doi = {https://doi.org/10.1016/j.cpc.2022.108552},
	author = {Changhyun Kim and Byoungho Lee},
}

Work on the solwa package is supported by the ERC Consolidator Grant (No. 101125948, PHASE).

Furthermore, the authors acknowledge support by the state of Baden-Württemberg through bwHPC through providing computational resources.

The work on the original torcwa was supported by the National Research Foundation of Korea (NRF) grant funded by the Korea government (MSIT) (No. 2020R1A2B5B02002730) and Samsung Electronics Co., Ltd (IO201214-08164-01).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

solwa-0.1.0.tar.gz (22.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

solwa-0.1.0-py3-none-any.whl (22.2 kB view details)

Uploaded Python 3

File details

Details for the file solwa-0.1.0.tar.gz.

File metadata

  • Download URL: solwa-0.1.0.tar.gz
  • Upload date:
  • Size: 22.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for solwa-0.1.0.tar.gz
Algorithm Hash digest
SHA256 808b1692eb89f7739a452e674ccbb1a4263976c1a52b80347fbffa480ecf5488
MD5 aaac52843bec9855bcfa5e9ca8486a2b
BLAKE2b-256 d3a215e25bcb053bde0ac28f2171e0f770ca44cea0723e4596df23cdb30e138e

See more details on using hashes here.

Provenance

The following attestation bundles were made for solwa-0.1.0.tar.gz:

Publisher: publish.yml on johannesz-codes/solwa

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file solwa-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: solwa-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 22.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for solwa-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ae84029d63e5efb146613e29cd5677ef756e4fb663bc552f47f5b3510512c904
MD5 56b7d4270637493e94c4601741c2c4e3
BLAKE2b-256 1ae910f5973c8d22d8bcf7c8203a673347fb8ba0f6318ef39e80f875fef52859

See more details on using hashes here.

Provenance

The following attestation bundles were made for solwa-0.1.0-py3-none-any.whl:

Publisher: publish.yml on johannesz-codes/solwa

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page