This notebook offers an interactive tutorial on using PreFab to correct the fabrication result of the same 500 nm-wide target nanostructure used in the previous prediction example. This tutorial is structured as follows:
- Preparing a test device for correction
- Executing a correction
- Making a prediction of the correction
To begin, we need to import the necessary libraries:
import prefab as pf
Loading a deviceĀ¶
The first step involves preparing a device for correction. Device
is the base class that represents photonic design geometries in PreFab and can be instantiated by loading an image or GDS layout as an ndarray with binary pixel values: 0 or 1. In this tutorial, we'll use a small target structure, but feel free to explore other structures available in the shapes.py
module, or add your own.
device = pf.shapes.target(width=500, arm_width=60)
device.plot(show_buffer=False)
<Axes: xlabel='x (nm)', ylabel='y (nm)'>
Correcting a deviceĀ¶
We proceed with the correction of the device for a specific fabrication model. Each model is labeled by its fabrication facility and process name, model version, and dataset version. Refer to docs/models.md
for a library of available models.
Note: Initial prediction/correction may take longer due to server startup and model loading. Subsequent predictions should be quicker.
MODEL_NAME = "ANT_NanoSOI_ANF1_d10"
correction = device.correct(model=pf.models[MODEL_NAME])
correction.plot(show_buffer=False)
Correction: 100%|āāāāāāāāāāāāāāāāāāāāāāāāāāāāāā| 100/100 [00:01<00:00, 83.13%/s]
<Axes: xlabel='x (nm)', ylabel='y (nm)'>
The corrector compensates for expected fabrication errors by adjusting the design. It adds silicon in places where it predicts erosion and removes silicon where it predicts dilation.
correction.plot_compare(ref_device=device, show_buffer=False)
<Axes: xlabel='x (nm)', ylabel='y (nm)'>
Making a prediction of the correctionĀ¶
We then predict the nanofabrication outcome for the corrected target structure by using the prediction model again.
In the corrected design, the corners are expected to be sharper and the middle opening is better resolved compared to the nominal design. Additionally, the Intersection over Union score is improved from 83% to 98%! This means that the corrected design will more closely match the intended design, leading to better fabrication outcomes and better chips.
outcome = correction.predict(model=pf.models[MODEL_NAME])
outcome_bin = outcome.binarize()
outcome.plot(show_buffer=False)
outcome_bin.plot(show_buffer=False)
outcome_bin.plot_compare(ref_device=device, show_buffer=False)
Prediction: 100%|āāāāāāāāāāāāāāāāāāāāāāāāāāāāāā| 100/100 [00:02<00:00, 41.95%/s]
<Axes: xlabel='x (nm)', ylabel='y (nm)'>
print(f"Corrected IoU: {pf.compare.intersection_over_union(device, outcome_bin):.2f}")
Corrected IoU: 0.98
While it may not always be possible to fully restore the original design to 100%, achieving this is our goal. We encourage you to stay up-to-date with our latest models, as we are continually striving to improve.