Neural Inverse Design of Nanostructures (NIDN) is a Python project by the Advanced Concepts Team of ESA. The goal of the project is to enable inverse design of stacks of nanostructures, metamaterials, photonic crystals, etc., using neural networks in PyTorch. As forward models, it supports rigorous coupled-wave analysis and a finite-difference time-domain solver. There is an accompanying paper about to be published.
Neural Inverse Design of Nanostructures with PyTorch
Explore the docs »
View Example notebook
·
Report Bug
·
Request Feature
This project is based on:
For more details than provided with NIDN on the forward models please refer to their docs. The adaptations of there code are in the folders nidn/trcwa/ and nidn/fdtd/.
Below you can see results of an exemplary optimization of a three-uniform-layer material to design a 1150nm filter.
This is a brief guide how to set up NIDN.
The easiest way is to pip install NIDN via
pip install nidn
.
Alternatively, to use the latest code from this repo git clone
the repository and make sure you have all the requirements installed.
To set up a conda environment for the project run conda env create -f environment.yml
.
This will create a conda environment called nidn
for it.
If you just want to install the module in your current environment you can run
pip install .
in the root folder where the setup.py
is located.
While NIDN does support GPU utilization there are only modest performance benefits to it at time of writing.
After cloning the repository, developers can check the functionality of NIDN by running the following command in the nidn/tests
directory:
pytest
NIDN uses a central config file which is passed through the entire program. The default config parameters can be seen here. Practical usage of the config files is demonstrated in the included Jupyter notebook.
This serves to compute the spectral characteristics of a material. The Jupyter notebooks Forward_Model_Simulation_with_FDTD.ipynb and Forward_Model_Simulation_with_RCWA.ipynb demonstrate this use case.
This is the case you aim to design a material matching some target spectral characteristics. A thorough explanation is given in the Jupyter notebooks Inverse_Material_Design_with_FDTD.ipynb and Inverse_Material_Design_with_RCWA.ipynb.
To change the logging verbosity call nidn.setLogLevel(level)
where level is one of TRACE
,DEBUG
,INFO
,WARN
and ERROR
.
Detailed docs of NIDN are online can be built with sphinx. To do so, make sure sphinx is installed and run make html
in the docs folder to get a local html version of the docs. readthedocs support may follow.
If you try to design a material with the classification
approach (see mentioned notebooks for more details), all materials in the materials folder will be utilized. You can manually add other materials there using data from, e.g., refractiveindex.info.
See the open issues for a list of proposed features (and known issues).
The project is open to community contributions. Feel free to open an issue or write us an email if you would like to discuss a problem or idea first.
If you want to contribute, please
git clone https://github.com/esa/nidn.git
cudatoolkit
in the environment.yml
.nidn
and installs the required dependencies.
conda env create -f environment.yml
conda activate nidn
Once the installation is done, you are ready to contribute.
Please note that PRs should be created from and into the main
branch.
git checkout -b feature/AmazingFeature
)git commit -m 'Add some AmazingFeature'
)git push origin feature/AmazingFeature
)main
branch.and we will have a look at your contribution as soon as we can.
Furthermore, please make sure that your PR passes all automated tests. Review will only happen after that.
Only PRs created on the main
branch with all tests passing will be considered.
Distributed under the GPL-3.0 License. See LICENSE for more information.
Created by ESA's Advanced Concepts Team
pablo.gomez at esa.int
Project Link: https://github.com/esa/nidn