Giter Club home page Giter Club logo

metagrating-topology-optimization's Introduction

Metagrating-Topology-Optimization

Requirements

Matlab 2015b or newer. Older versions may be sufficient but have not been tested.

RETICOLO - rigourous coupled wave analysis (RCWA) solver. Can be downloaded from RETICOLO. Copy the folder reticolo_allege into the working directory.

Quick Start

Run RunOpt.m with default parameters. The example optimization should begin immediately if all files have been installed corrected.

In RunOpt.m, define all optimization parameters as necessary. Descriptions of all parameters can be found in Functions/Initialize.m along with their default values.

A schematic of metagrating parameter defintions can be found at MetaNet.

Features

Robustness

Robustness parameters, found in OptParm.Optimization.Robustness, are accepted as vectors of dynamic length according to the number of robustness simulations used in computing the gradient. Details on robust optimization can be found in this paper.

The default robustness parameters of

StartDeviation = [-5 0 5];
Weights = [.5 1 .5];

define a gradient derived from a -5nm eroded structure, an unperturbed structure, and a 5nm dilated structure, weighted at 0.5x, 1x, and 0.5x respectively.

Additionally, the magnitude of robustness can be scaled as the optimization progresses between the values defined in StartDeviation and EndDeviation. The speed of scaling is defined by Ramp. For no scaling, StartDeviation and EndDeviation should be set to the same value.

Additional robustness can be added as desired. i.e.

StartDeviation = [-10 -5 0 5 10];
Weights = [.25 .5 1 .5 .25];

defines additional simulations with even greater perturbations.

Optimizations without robustness can be specified by

StartDeviation = [0];
Weights = [1];

Parallelization

The optimization method can be parallelized across multiple threads in the case of either two polarization devices or robust optimization. In OptimizeDevice.m, the for loops

for robustIter = 1:NRobustness

and

for polIter = 1:NumPol  

can be replaced with parfor loops instead. Note that only one of the two loops may be parallelized at a time.

Checkpointing

Checkpointing saves the state of the optimization and allows the user to stop and start the optimization without losing progress. This behavior is desirable when running shared computing resources where jobs may be preempted without warning.

To enable checkpointing, set OptParm.Checkpoint.Enable = true and define a checkpoint file location with OptParm.Checkpoint.File. Then, throughout the optimization, the entire optimization state will be saved every few iterations with a frequency defined by OptParm.Checkpoint.Frequency.

When restarting a checkpointed optimization, the optimization will attempt to load the file at OptParm.Checkpoint.File if it exists, and continue, otherwise the optimization will start from the beginning again.

Warning: Checkpointing may fail if the optimization is terminated while writing to the checkpoint file.

Citation

Please cite this code as:

MetaNet: A new paradigm for data sharing in photonics research
Jiaqi Jiang, Robert Lupoiu, Evan W. Wang, David Sell, Jean Paul Hugonin, Philippe Lalanne, Jonathan A. Fan

metagrating-topology-optimization's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.