MIT License

项目介绍

fancompute/angler 是一个托管在 GitHub 上的开源项目,主要使用 Python 编写,采用 MIT License 许可证,目前获得 191 个 Star、53 次 Fork。

仓库全名
fancompute/angler
开源许可证
MIT License
Star 数
191
Fork 数
53
未关闭 Issue
10

README 摘要

angler angler (named for 'adjoint nonlinear gradients') is a package for simulating and optimizing optical structures. It provides a finite-difference frequency-domain (FDFD) solver for simulating for linear and nonlinear devices in the frequency domain. It also provides an easy to use package for adjoint-based inverse design and optimization of linear and nonlinear devices. For example, you can inverse design…

完整内容见 GitHub 原始 README 或本页 。

常见问题

angler 用什么语言开发?

主要使用 Python 编写,采用 MIT License 许可证,目前有 191 个 Star。

angler 可以免费商用吗?

仓库采用 MIT License 许可证,可免费使用与修改,商业使用请遵守许可证条款(例如保留版权声明与许可声明)。

如何获取 angler 的源码?

可以直接克隆仓库:git clone https://github.com/fancompute/angler.git,默认分支为 master;安装与运行步骤见仓库 README。

angler 最近还在维护吗?

仓库最近一次更新为 2019年12月14日,当前有 10 个未关闭 Issue;Star 数为 191,可作为社区活跃度的参考。

关于

GitHub 原始描述(英文)

Frequency-domain photonic simulation and inverse design optimization for linear and nonlinear devices

描述取自 GitHub 官方 API,保持仓库作者书写的原文。

简要分析

热度分
313
价值分
131
活跃状态
活跃

语言占比

Python

README

Angler

angler

angler (named for ‘adjoint nonlinear gradients’) is a package for simulating and optimizing optical structures.

It provides a finite-difference frequency-domain (FDFD) solver for simulating for linear and nonlinear devices in the frequency domain.

It also provides an easy to use package for adjoint-based inverse design and optimization of linear and nonlinear devices. For example, you can inverse design optical switches to transport power to different ports for different input powers:

Fields

angler is released as part of a paper Adjoint method and inverse design for nonlinear optical devices, which can be viewed here.

Installation

One can install the most stable version of angler and all of its dependencies (apart from MKL) using

pip install angler

Alternatively, to use the most current version

git clone https://github.com/fancompute/angler.git
pip install -e angler

And then this directory can be added to path to import angler, i.e.

import sys
sys.path.append('path/to/angler')

Make angler faster

The most computationally expensive operation in angler is the sparse linear system solve. This is done with scipy.sparse.linalg.spsolve() by default. If MKL is installed, angler instead uses this with a python wrapper pyMKL, which makes things significantly faster, depending on the problem. The best way to install MKL, if using anaconda, is

conda install MKL

(pyMKL does not work when MKL is pip installed.)

Examples / Quickstart

There are several jupyter notebook examples in the Notebooks/ directory.

For a good introduction, try:

Notebooks/Splitter.ipynb

For more specific applications:

Electromagnetic simulations

For modeling linear devices with our FDFD solver (no optimization), see

Notebooks/Linear_system.ipynb

For modeling nonlinear devices with FDFD (no optimization), see

Notebooks/Nonlinear_system.ipynb
Inverse design & optimization

For examples of optimizing linear devices, see

Notebooks/Splitter.ipynb
Notebooks/Accelerator.ipynb

For examples of optimizing nonlinear devices, see

Notebooks/2_port.ipynb
Notebooks/3_port.ipynb
Notebooks/T_port.ipynb

Package Structure

angler provides two main classes, Simulation and Optimization, which perform most of the functionality.

Generally, Simulation objects are used to perform FDFD simulations, and Optimization classes run inverse design and optimization algorithms over Simulations. To learn more about how angler works and how to use it, please take a look at angler/README.md for a more detailed explanation.

Tests

To run all tests:

python -m unittest discover tests

Or to run individually:

python tests/individual_test.py

Contributing

angler is under development and we welcome suggestions, pull-requests, feature-requests, etc.

If you contribute a new feature, please also write a few tests and document your changes in angler/README.md or the wiki.

Authors

angler was written by Tyler Hughes, Momchil Minkov, and Ian Williamson.

Citing

If you use angler, please cite us using

@article{Hughes2018,
author = {Hughes, Tyler W. and Minkov, Momchil and Williamson, Ian A. D. and Fan, Shanhui},
title = {Adjoint Method and Inverse Design for Nonlinear Nanophotonic Devices},
journal = {ACS Photonics},
volume = {5},
number = {12},
pages = {4781-4787},
year = {2018},
doi = {10.1021/acsphotonics.8b01522}
}

License

This project is licensed under the MIT License - see the LICENSE.md file for details. Copyright 2018 Tyler Hughes.

Acknowledgments

  • our logo was made by Nadine Gilmer :)
  • RIP Ian’s contributions before the code merge
  • We made use of a lot of code snippets (and advice) from Jerry Shi

评论

暂无评论