prefab 0.4.3__tar.gz → 0.4.5__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. prefab-0.4.5/.devcontainer/devcontainer.json +6 -0
  2. {prefab-0.4.3 → prefab-0.4.5}/PKG-INFO +10 -10
  3. {prefab-0.4.3 → prefab-0.4.5}/README.md +9 -9
  4. prefab-0.4.5/docs/models.md +12 -0
  5. {prefab-0.4.3 → prefab-0.4.5}/examples/1_prediction.ipynb +27 -28
  6. {prefab-0.4.3 → prefab-0.4.5}/examples/2_prediction_gds.ipynb +37 -33
  7. {prefab-0.4.3 → prefab-0.4.5}/examples/3_correction.ipynb +43 -35
  8. {prefab-0.4.3 → prefab-0.4.5}/examples/4_prediction_silicon_nitride.ipynb +24 -22
  9. prefab-0.4.5/prefab/__init__.py +47 -0
  10. {prefab-0.4.3 → prefab-0.4.5}/prefab/io.py +86 -41
  11. {prefab-0.4.3 → prefab-0.4.5}/prefab/predictor.py +42 -28
  12. {prefab-0.4.3 → prefab-0.4.5}/prefab/processor.py +38 -32
  13. {prefab-0.4.3 → prefab-0.4.5}/pyproject.toml +1 -1
  14. {prefab-0.4.3 → prefab-0.4.5}/requirements.txt +1 -1
  15. prefab-0.4.3/.devcontainer/devcontainer.json +0 -6
  16. prefab-0.4.3/docs/models.md +0 -12
  17. prefab-0.4.3/prefab/__init__.py +0 -47
  18. {prefab-0.4.3 → prefab-0.4.5}/.gitattributes +0 -0
  19. {prefab-0.4.3 → prefab-0.4.5}/.github/workflows/python-publish.yml +0 -0
  20. {prefab-0.4.3 → prefab-0.4.5}/.gitignore +0 -0
  21. {prefab-0.4.3 → prefab-0.4.5}/.pylintrc +0 -0
  22. {prefab-0.4.3 → prefab-0.4.5}/LICENSE +0 -0
  23. {prefab-0.4.3 → prefab-0.4.5}/assets/logo.png +0 -0
  24. {prefab-0.4.3 → prefab-0.4.5}/assets/promo_c.png +0 -0
  25. {prefab-0.4.3 → prefab-0.4.5}/assets/promo_p.png +0 -0
  26. {prefab-0.4.3 → prefab-0.4.5}/devices/circles-inverse_512x512.png +0 -0
  27. {prefab-0.4.3 → prefab-0.4.5}/devices/circles_512x512.png +0 -0
  28. {prefab-0.4.3 → prefab-0.4.5}/devices/cross-inverse_16x128_256x256.png +0 -0
  29. {prefab-0.4.3 → prefab-0.4.5}/devices/cross-inverse_32x128_256x256.png +0 -0
  30. {prefab-0.4.3 → prefab-0.4.5}/devices/cross-inverse_64x128_256x256.png +0 -0
  31. {prefab-0.4.3 → prefab-0.4.5}/devices/cross_16x128_256x256.png +0 -0
  32. {prefab-0.4.3 → prefab-0.4.5}/devices/cross_32x128_256x256.png +0 -0
  33. {prefab-0.4.3 → prefab-0.4.5}/devices/cross_64x128_256x256.png +0 -0
  34. {prefab-0.4.3 → prefab-0.4.5}/devices/demux.png +0 -0
  35. {prefab-0.4.3 → prefab-0.4.5}/devices/devices.gds +0 -0
  36. {prefab-0.4.3 → prefab-0.4.5}/devices/fleur.png +0 -0
  37. {prefab-0.4.3 → prefab-0.4.5}/devices/grating_16x256_16_512x512.png +0 -0
  38. {prefab-0.4.3 → prefab-0.4.5}/devices/grating_16x256_32_512x512.png +0 -0
  39. {prefab-0.4.3 → prefab-0.4.5}/devices/grating_16x256_64_512x512.png +0 -0
  40. {prefab-0.4.3 → prefab-0.4.5}/devices/grating_32x256_16_512x512.png +0 -0
  41. {prefab-0.4.3 → prefab-0.4.5}/devices/grating_32x256_32_512x512.png +0 -0
  42. {prefab-0.4.3 → prefab-0.4.5}/devices/grating_32x256_64_512x512.png +0 -0
  43. {prefab-0.4.3 → prefab-0.4.5}/devices/grating_64x256_16_512x512.png +0 -0
  44. {prefab-0.4.3 → prefab-0.4.5}/devices/grating_64x256_32_512x512.png +0 -0
  45. {prefab-0.4.3 → prefab-0.4.5}/devices/grating_64x256_64_512x512.png +0 -0
  46. {prefab-0.4.3 → prefab-0.4.5}/devices/pie_128x128_256x256.png +0 -0
  47. {prefab-0.4.3 → prefab-0.4.5}/devices/rectangle_128x128_256x256.png +0 -0
  48. {prefab-0.4.3 → prefab-0.4.5}/devices/ring_64x128_256x256.png +0 -0
  49. {prefab-0.4.3 → prefab-0.4.5}/devices/star_128x128_256x256.png +0 -0
  50. {prefab-0.4.3 → prefab-0.4.5}/devices/target_16x128_256x256.png +0 -0
  51. {prefab-0.4.3 → prefab-0.4.5}/devices/target_32x128_256x256.png +0 -0
  52. {prefab-0.4.3 → prefab-0.4.5}/devices/target_64x128_256x256.png +0 -0
@@ -0,0 +1,6 @@
1
+ {
2
+ "name": "PreFab Codespace",
3
+ "image": "mcr.microsoft.com/devcontainers/python:0-3.10",
4
+ "features": {},
5
+ "postCreateCommand": "pip3 install --user -r requirements.txt && pip install -e ."
6
+ }
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: prefab
3
- Version: 0.4.3
3
+ Version: 0.4.5
4
4
  Summary: Machine learning based prediction of photonic device fabrication
5
5
  Project-URL: Homepage, https://github.com/PreFab-Photonics/PreFab
6
6
  Author-email: Dusan Gostimirovic <dusan@prefabphotonics.com>
@@ -525,7 +525,7 @@ Description-Content-Type: text/markdown
525
525
 
526
526
  ![PreFab logo](https://github.com/PreFab-Photonics/PreFab/blob/main/assets/logo.png?raw=true)
527
527
 
528
- `PreFab` leverages **deep learning** to model fabrication-induced structural variations in integrated photonic devices. Through this *virtual nanofabrication environment*, we uncover valuable insights into nanofabrication processes and enhance device design accuracy.
528
+ `PreFab` leverages **deep learning** to model fabrication-induced structural variations in integrated photonic devices. Through this _virtual nanofabrication environment_, we uncover valuable insights into nanofabrication processes and enhance device design accuracy.
529
529
 
530
530
  ## Prediction
531
531
 
@@ -541,16 +541,16 @@ Description-Content-Type: text/markdown
541
541
 
542
542
  ## Models
543
543
 
544
- `PreFab` accommodates unique *predictor* and *corrector* models for each photonic foundry, regularly updated based on recent fabrication data. Current models include (see full list on [`docs/models.md`](docs/models.md)):
544
+ `PreFab` accommodates unique _predictor_ and _corrector_ models for each photonic foundry, regularly updated based on recent fabrication data. Current models include (see full list on [`docs/models.md`](docs/models.md)):
545
545
 
546
- | Foundry | Process | Latest Version | Latest Dataset | Model Name | Model Tag | Status |
547
- | ------- | ------- | -------------- | -------------- | ---------- |---------- | ------ |
548
- | ANT | [NanoSOI](https://www.appliednt.com/nanosoi-fabrication-service/) | v5 (Jun 3 2023) | d4 (Apr 12 2023) | ANT_NanoSOI | v5-d4 | Beta |
549
- | ANT | [SiN (Upper Edge)](https://www.appliednt.com/nanosoi/sys/resources/specs_nitride/) | v5 (Jun 3 2023) | d0 (Jun 1 2023) | ANT_SiN | v5-d0-upper | Alpha |
550
- | ANT | [SiN (Lower Edge)](https://www.appliednt.com/nanosoi/sys/resources/specs_nitride/) | v5 (Jun 3 2023) | d0 (Jun 1 2023) | ANT_SiN | v5-d0-lower | Alpha |
551
- | SiEPICfab | [SOI](https://siepic.ca/fabrication/) | v5 (Jun 3 2023) | d0 (Jun 14 2023) | SiEPICfab_SOI | v5-d0 | Alpha |
546
+ | Foundry | Process | Latest Version | Latest Dataset | Model Name | Model Tag | Status |
547
+ | --------- | ---------------------------------------------------------------------------------- | --------------- | ---------------- | ------------- | ----------- | ------ |
548
+ | ANT | [NanoSOI](https://www.appliednt.com/nanosoi-fabrication-service/) | v5 (Jun 3 2023) | d4 (Apr 12 2023) | ANT_NanoSOI | v5-d4 | Beta |
549
+ | ANT | [SiN (Upper Edge)](https://www.appliednt.com/nanosoi/sys/resources/specs_nitride/) | v5 (Jun 3 2023) | d0 (Jun 1 2023) | ANT_SiN | v5-d0-upper | Alpha |
550
+ | ANT | [SiN (Lower Edge)](https://www.appliednt.com/nanosoi/sys/resources/specs_nitride/) | v5 (Jun 3 2023) | d0 (Jun 1 2023) | ANT_SiN | v5-d0-lower | Alpha |
551
+ | SiEPICfab | [SOI](https://siepic.ca/fabrication/) | v5 (Jun 3 2023) | d0 (Jun 14 2023) | SiEPICfab_SOI | v5-d0 | Alpha |
552
552
 
553
- *New models and foundries are regularly added. Usage may change. For additional foundry and process models, feel free to contact us or raise an issue.*
553
+ _New models and foundries are regularly added. Usage may change. For additional foundry and process models, feel free to contact us or raise an issue._
554
554
 
555
555
  ## Installation
556
556
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  ![PreFab logo](https://github.com/PreFab-Photonics/PreFab/blob/main/assets/logo.png?raw=true)
4
4
 
5
- `PreFab` leverages **deep learning** to model fabrication-induced structural variations in integrated photonic devices. Through this *virtual nanofabrication environment*, we uncover valuable insights into nanofabrication processes and enhance device design accuracy.
5
+ `PreFab` leverages **deep learning** to model fabrication-induced structural variations in integrated photonic devices. Through this _virtual nanofabrication environment_, we uncover valuable insights into nanofabrication processes and enhance device design accuracy.
6
6
 
7
7
  ## Prediction
8
8
 
@@ -18,16 +18,16 @@
18
18
 
19
19
  ## Models
20
20
 
21
- `PreFab` accommodates unique *predictor* and *corrector* models for each photonic foundry, regularly updated based on recent fabrication data. Current models include (see full list on [`docs/models.md`](docs/models.md)):
21
+ `PreFab` accommodates unique _predictor_ and _corrector_ models for each photonic foundry, regularly updated based on recent fabrication data. Current models include (see full list on [`docs/models.md`](docs/models.md)):
22
22
 
23
- | Foundry | Process | Latest Version | Latest Dataset | Model Name | Model Tag | Status |
24
- | ------- | ------- | -------------- | -------------- | ---------- |---------- | ------ |
25
- | ANT | [NanoSOI](https://www.appliednt.com/nanosoi-fabrication-service/) | v5 (Jun 3 2023) | d4 (Apr 12 2023) | ANT_NanoSOI | v5-d4 | Beta |
26
- | ANT | [SiN (Upper Edge)](https://www.appliednt.com/nanosoi/sys/resources/specs_nitride/) | v5 (Jun 3 2023) | d0 (Jun 1 2023) | ANT_SiN | v5-d0-upper | Alpha |
27
- | ANT | [SiN (Lower Edge)](https://www.appliednt.com/nanosoi/sys/resources/specs_nitride/) | v5 (Jun 3 2023) | d0 (Jun 1 2023) | ANT_SiN | v5-d0-lower | Alpha |
28
- | SiEPICfab | [SOI](https://siepic.ca/fabrication/) | v5 (Jun 3 2023) | d0 (Jun 14 2023) | SiEPICfab_SOI | v5-d0 | Alpha |
23
+ | Foundry | Process | Latest Version | Latest Dataset | Model Name | Model Tag | Status |
24
+ | --------- | ---------------------------------------------------------------------------------- | --------------- | ---------------- | ------------- | ----------- | ------ |
25
+ | ANT | [NanoSOI](https://www.appliednt.com/nanosoi-fabrication-service/) | v5 (Jun 3 2023) | d4 (Apr 12 2023) | ANT_NanoSOI | v5-d4 | Beta |
26
+ | ANT | [SiN (Upper Edge)](https://www.appliednt.com/nanosoi/sys/resources/specs_nitride/) | v5 (Jun 3 2023) | d0 (Jun 1 2023) | ANT_SiN | v5-d0-upper | Alpha |
27
+ | ANT | [SiN (Lower Edge)](https://www.appliednt.com/nanosoi/sys/resources/specs_nitride/) | v5 (Jun 3 2023) | d0 (Jun 1 2023) | ANT_SiN | v5-d0-lower | Alpha |
28
+ | SiEPICfab | [SOI](https://siepic.ca/fabrication/) | v5 (Jun 3 2023) | d0 (Jun 14 2023) | SiEPICfab_SOI | v5-d0 | Alpha |
29
29
 
30
- *New models and foundries are regularly added. Usage may change. For additional foundry and process models, feel free to contact us or raise an issue.*
30
+ _New models and foundries are regularly added. Usage may change. For additional foundry and process models, feel free to contact us or raise an issue._
31
31
 
32
32
  ## Installation
33
33
 
@@ -0,0 +1,12 @@
1
+ # PreFab Models
2
+
3
+ `PreFab` accommodates unique _predictor_ and _corrector_ models for each photonic foundry, regularly updated based on recent fabrication data.
4
+
5
+ | Foundry | Process | Latest Version | Latest Dataset | Model Name | Model Tag | Status |
6
+ | --------- | ---------------- | --------------- | ---------------- | ------------- | ----------- | ------ |
7
+ | ANT | NanoSOI | v5 (Jun 3 2023) | d4 (Apr 12 2023) | ANT_NanoSOI | v5-d4 | Beta |
8
+ | ANT | SiN (Upper Edge) | v5 (Jun 3 2023) | d0 (Jun 1 2023) | ANT_SiN | v5-d0-upper | Alpha |
9
+ | ANT | SiN (Lower Edge) | v5 (Jun 3 2023) | d0 (Jun 1 2023) | ANT_SiN | v5-d0-lower | Alpha |
10
+ | SiEPICfab | SOI | v5 (Jun 3 2023) | d0 (Jun 14 2023) | SiEPICfab_SOI | v5-d0 | Alpha |
11
+
12
+ _New models and foundries are regularly added. Usage may change. For additional foundry and process models, feel free to contact us or raise an issue._
@@ -5,14 +5,13 @@
5
5
  "cell_type": "markdown",
6
6
  "metadata": {},
7
7
  "source": [
8
- "\n",
9
8
  "This Jupyter notebook offers an interactive tutorial on utilizing the PreFab library to anticipate the fabrication outcomes of nanoscale structures, specifically a 200 nm-wide cross structure on a Silicon-On-Insulator (SOI) e-beam process. This tutorial is structured as follows:\n",
10
9
  "\n",
11
10
  "1. Preparing a device image for prediction\n",
12
11
  "2. Executing a prediction\n",
13
12
  "3. Analyzing the prediction\n",
14
13
  "\n",
15
- "To begin, we need to import the necessary libraries:"
14
+ "To begin, we need to import the necessary libraries:\n"
16
15
  ]
17
16
  },
18
17
  {
@@ -32,7 +31,7 @@
32
31
  "source": [
33
32
  "The first step involves preparing a device image for prediction. This requires loading an image of a device as a numpy matrix with binary pixel values: 0 or 1. In this tutorial, we'll use an image of a cross, but feel free to explore with other structures available in the `devices/` directory, or include your own images.\n",
34
33
  "\n",
35
- "The image scale should ideally be 1 nm/px. If not, ensure you specify the actual length of the device image (in nanometers) when loading the image."
34
+ "The image scale should ideally be 1 nm/px. If not, ensure you specify the actual length of the device image (in nanometers) when loading the image.\n"
36
35
  ]
37
36
  },
38
37
  {
@@ -52,12 +51,12 @@
52
51
  }
53
52
  ],
54
53
  "source": [
55
- "device = pf.load_device_img(path='../devices/cross_32x128_256x256.png')\n",
54
+ "device = pf.load_device_img(path=\"../devices/cross_32x128_256x256.png\")\n",
56
55
  "\n",
57
56
  "plt.imshow(device)\n",
58
- "plt.title('Nominal Device')\n",
59
- "plt.ylabel('Distance (nm)')\n",
60
- "plt.xlabel('Distance (nm)')\n",
57
+ "plt.title(\"Nominal Device\")\n",
58
+ "plt.ylabel(\"Distance (nm)\")\n",
59
+ "plt.xlabel(\"Distance (nm)\")\n",
61
60
  "plt.show()"
62
61
  ]
63
62
  },
@@ -68,7 +67,7 @@
68
67
  "source": [
69
68
  "In the next step, we proceed with the prediction. Each model is labeled by its type ('p' for predictor), fabrication facility and process name, model version, and dataset version. Refer to `docs/models.md` for the list of available models.\n",
70
69
  "\n",
71
- "You can also choose if you want a binarized output. The predictor, by default, produces raw predictions, which includes \"fuzzy\" areas of the structure that might vary between different fabrication runs or even different device instances on the same chip. When binarized, the predictor outputs the most probable fabrication outcome. Post-prediction binarization is also an option."
70
+ "You can also choose if you want a binarized output. The predictor, by default, produces raw predictions, which includes \"fuzzy\" areas of the structure that might vary between different fabrication runs or even different device instances on the same chip. When binarized, the predictor outputs the most probable fabrication outcome. Post-prediction binarization is also an option.\n"
72
71
  ]
73
72
  },
74
73
  {
@@ -99,20 +98,20 @@
99
98
  ],
100
99
  "source": [
101
100
  "# Note: Initial prediction may take longer due to server startup and model loading. Subsequent predictions should be quicker.\n",
102
- "MODEL_NAME = 'ANT_NanoSOI'\n",
103
- "MODEL_TAGS = 'v5-d4'\n",
101
+ "MODEL_NAME = \"ANT_NanoSOI\"\n",
102
+ "MODEL_TAGS = \"v5-d4\"\n",
104
103
  "prediction = pf.predict(device=device, model_name=MODEL_NAME, model_tags=MODEL_TAGS)\n",
105
104
  "\n",
106
105
  "plt.imshow(prediction)\n",
107
- "plt.title('Predicted Device')\n",
108
- "plt.ylabel('Distance (nm)')\n",
109
- "plt.xlabel('Distance (nm)')\n",
106
+ "plt.title(\"Predicted Device\")\n",
107
+ "plt.ylabel(\"Distance (nm)\")\n",
108
+ "plt.xlabel(\"Distance (nm)\")\n",
110
109
  "plt.show()\n",
111
110
  "\n",
112
111
  "plt.imshow(pf.binarize(prediction))\n",
113
- "plt.title('Binarized Predicted Device')\n",
114
- "plt.ylabel('Distance (nm)')\n",
115
- "plt.xlabel('Distance (nm)')\n",
112
+ "plt.title(\"Binarized Predicted Device\")\n",
113
+ "plt.ylabel(\"Distance (nm)\")\n",
114
+ "plt.xlabel(\"Distance (nm)\")\n",
116
115
  "plt.show()"
117
116
  ]
118
117
  },
@@ -121,7 +120,7 @@
121
120
  "cell_type": "markdown",
122
121
  "metadata": {},
123
122
  "source": [
124
- "Lastly, we analyze the prediction. Plotting the variations between the nominal device and the predicted outcome is an effective analysis technique. It helps in identifying areas of high uncertainty, such as potential rounding of the cross's corners."
123
+ "Lastly, we analyze the prediction. Plotting the variations between the nominal device and the predicted outcome is an effective analysis technique. It helps in identifying areas of high uncertainty, such as potential rounding of the cross's corners.\n"
125
124
  ]
126
125
  },
127
126
  {
@@ -152,20 +151,20 @@
152
151
  ],
153
152
  "source": [
154
153
  "variation = device - prediction\n",
155
- "plt.imshow(variation, cmap='jet', vmin=-1, vmax=1)\n",
156
- "plt.title('Variation Likelihood')\n",
157
- "plt.ylabel('Distance (nm)')\n",
158
- "plt.xlabel('Distance (nm)')\n",
154
+ "plt.imshow(variation, cmap=\"jet\", vmin=-1, vmax=1)\n",
155
+ "plt.title(\"Variation Likelihood\")\n",
156
+ "plt.ylabel(\"Distance (nm)\")\n",
157
+ "plt.xlabel(\"Distance (nm)\")\n",
159
158
  "cb = plt.colorbar()\n",
160
- "cb.set_label('Under-Etch Over-Etch')\n",
159
+ "cb.set_label(\"Under-Etch Over-Etch\")\n",
161
160
  "plt.show()\n",
162
161
  "\n",
163
- "plt.imshow(variation[60:120, 80:-80], cmap='jet', vmin=-1, vmax=1)\n",
164
- "plt.title('Zoomed Variation Likelihood')\n",
165
- "plt.ylabel('Distance (nm)')\n",
166
- "plt.xlabel('Distance (nm)')\n",
162
+ "plt.imshow(variation[60:120, 80:-80], cmap=\"jet\", vmin=-1, vmax=1)\n",
163
+ "plt.title(\"Zoomed Variation Likelihood\")\n",
164
+ "plt.ylabel(\"Distance (nm)\")\n",
165
+ "plt.xlabel(\"Distance (nm)\")\n",
167
166
  "cb = plt.colorbar()\n",
168
- "cb.set_label('Under-Etch Over-Etch')\n",
167
+ "cb.set_label(\"Under-Etch Over-Etch\")\n",
169
168
  "plt.show()"
170
169
  ]
171
170
  },
@@ -174,7 +173,7 @@
174
173
  "cell_type": "markdown",
175
174
  "metadata": {},
176
175
  "source": [
177
- "And with that, we conclude this tutorial! You're now ready to use the prediction to simulate expected performance, or even to refine your design to decrease variation and uncertainty (refer to the device correction examples). Happy designing!"
176
+ "And with that, we conclude this tutorial! You're now ready to use the prediction to simulate expected performance, or even to refine your design to decrease variation and uncertainty (refer to the device correction examples). Happy designing!\n"
178
177
  ]
179
178
  }
180
179
  ],
@@ -12,7 +12,7 @@
12
12
  "3. Analyzing the prediction\n",
13
13
  "4. Writing the predicted device back to a GDS file\n",
14
14
  "\n",
15
- "Initially, let's import the necessary libraries:"
15
+ "Initially, let's import the necessary libraries:\n"
16
16
  ]
17
17
  },
18
18
  {
@@ -31,7 +31,7 @@
31
31
  "cell_type": "markdown",
32
32
  "metadata": {},
33
33
  "source": [
34
- "We commence by importing a nanobeam device from a GDS file, transforming the geometric data into a numpy matrix with pixel values of either 0 or 1. We use a specific nanobeam design in this tutorial, but feel free to experiment with other designs in `devices/devices.gds`, or input your own GDS file!"
34
+ "We commence by importing a nanobeam device from a GDS file, transforming the geometric data into a numpy matrix with pixel values of either 0 or 1. We use a specific nanobeam design in this tutorial, but feel free to experiment with other designs in `devices/devices.gds`, or input your own GDS file!\n"
35
35
  ]
36
36
  },
37
37
  {
@@ -51,12 +51,12 @@
51
51
  }
52
52
  ],
53
53
  "source": [
54
- "device = pf.load_device_gds(path='../devices/devices.gds', cell_name='nanobeam')\n",
54
+ "device = pf.load_device_gds(path=\"../devices/devices.gds\", cell_name=\"nanobeam\")\n",
55
55
  "\n",
56
56
  "plt.imshow(device)\n",
57
- "plt.title('Nominal Device')\n",
58
- "plt.ylabel('Distance (nm)')\n",
59
- "plt.xlabel('Distance (nm)')\n",
57
+ "plt.title(\"Nominal Device\")\n",
58
+ "plt.ylabel(\"Distance (nm)\")\n",
59
+ "plt.xlabel(\"Distance (nm)\")\n",
60
60
  "plt.show()"
61
61
  ]
62
62
  },
@@ -67,7 +67,7 @@
67
67
  "source": [
68
68
  "Next, we predict the fabrication result for our nanobeam. Each model is uniquely tagged by its type ('p' for predictor), the fabrication facility and process name, model version, and training dataset version. Refer to `docs/models.md` for the list of available models.\n",
69
69
  "\n",
70
- "The option to specify binarized output is also provided. The predictor by default generates raw predictions, inclusive of \"fuzzy\" areas of the structure that can vary across fabrication runs or even among different nanobeam instances on the same chip. Choosing binarized output lets the predictor supply the most probable post-fabrication outcome. Post-prediction binarization is also feasible, enabling comparison between raw and binarized predictions."
70
+ "The option to specify binarized output is also provided. The predictor by default generates raw predictions, inclusive of \"fuzzy\" areas of the structure that can vary across fabrication runs or even among different nanobeam instances on the same chip. Choosing binarized output lets the predictor supply the most probable post-fabrication outcome. Post-prediction binarization is also feasible, enabling comparison between raw and binarized predictions.\n"
71
71
  ]
72
72
  },
73
73
  {
@@ -88,14 +88,14 @@
88
88
  ],
89
89
  "source": [
90
90
  "# Note: Initial prediction may take longer due to server startup and model loading. Subsequent predictions should be quicker.\n",
91
- "MODEL_NAME = 'ANT_NanoSOI'\n",
92
- "MODEL_TAGS = 'v5-d4'\n",
91
+ "MODEL_NAME = \"ANT_NanoSOI\"\n",
92
+ "MODEL_TAGS = \"v5-d4\"\n",
93
93
  "prediction = pf.predict(device=device, model_name=MODEL_NAME, model_tags=MODEL_TAGS)\n",
94
94
  "\n",
95
95
  "plt.imshow(prediction)\n",
96
- "plt.title('Predicted Device')\n",
97
- "plt.ylabel('Distance (nm)')\n",
98
- "plt.xlabel('Distance (nm)')\n",
96
+ "plt.title(\"Predicted Device\")\n",
97
+ "plt.ylabel(\"Distance (nm)\")\n",
98
+ "plt.xlabel(\"Distance (nm)\")\n",
99
99
  "plt.show()"
100
100
  ]
101
101
  },
@@ -106,7 +106,7 @@
106
106
  "source": [
107
107
  "Finally, we proceed with an analysis of the prediction. A valuable approach here is to visualize potential deviations between the original nanobeam and the predicted outcome. This analysis can aid in identifying areas of high uncertainty in the fabrication process.\n",
108
108
  "\n",
109
- "For our nanobeam, for instance, we may notice filling of the first two innermost holes and a general dilation of the larger holes. These are fabrication process artifacts, and understanding their potential appearance helps us to better predict and plan for the actual outcome."
109
+ "For our nanobeam, for instance, we may notice filling of the first two innermost holes and a general dilation of the larger holes. These are fabrication process artifacts, and understanding their potential appearance helps us to better predict and plan for the actual outcome.\n"
110
110
  ]
111
111
  },
112
112
  {
@@ -137,20 +137,20 @@
137
137
  ],
138
138
  "source": [
139
139
  "variation = device - prediction\n",
140
- "plt.imshow(variation, cmap='jet', vmin=-1, vmax=1)\n",
141
- "plt.title('Variation Likelihood')\n",
142
- "plt.ylabel('Distance (nm)')\n",
143
- "plt.xlabel('Distance (nm)')\n",
140
+ "plt.imshow(variation, cmap=\"jet\", vmin=-1, vmax=1)\n",
141
+ "plt.title(\"Variation Likelihood\")\n",
142
+ "plt.ylabel(\"Distance (nm)\")\n",
143
+ "plt.xlabel(\"Distance (nm)\")\n",
144
144
  "cb = plt.colorbar()\n",
145
- "cb.set_label('Under-Etch Over-Etch')\n",
145
+ "cb.set_label(\"Under-Etch Over-Etch\")\n",
146
146
  "plt.show()\n",
147
147
  "\n",
148
- "plt.imshow(variation[0:-1, 3000:-3000], cmap='jet', vmin=-1, vmax=1)\n",
149
- "plt.title('Zoomed Variation Likelihood')\n",
150
- "plt.ylabel('Distance (nm)')\n",
151
- "plt.xlabel('Distance (nm)')\n",
148
+ "plt.imshow(variation[0:-1, 3000:-3000], cmap=\"jet\", vmin=-1, vmax=1)\n",
149
+ "plt.title(\"Zoomed Variation Likelihood\")\n",
150
+ "plt.ylabel(\"Distance (nm)\")\n",
151
+ "plt.xlabel(\"Distance (nm)\")\n",
152
152
  "cb = plt.colorbar()\n",
153
- "cb.set_label('Under-Etch Over-Etch')\n",
153
+ "cb.set_label(\"Under-Etch Over-Etch\")\n",
154
154
  "plt.show()"
155
155
  ]
156
156
  },
@@ -159,7 +159,7 @@
159
159
  "cell_type": "markdown",
160
160
  "metadata": {},
161
161
  "source": [
162
- "Subsequently, we generate a GDS cell for the predicted binarized device and add it back to the original GDS library. The GDS file with the original and predicted devices can then be exported for further use or analysis."
162
+ "Subsequently, we generate a GDS cell for the predicted binarized device and add it back to the original GDS library. The GDS file with the original and predicted devices can then be exported for further use or analysis.\n"
163
163
  ]
164
164
  },
165
165
  {
@@ -168,15 +168,19 @@
168
168
  "metadata": {},
169
169
  "outputs": [],
170
170
  "source": [
171
- "gds_library = gdspy.GdsLibrary(infile='../devices/devices.gds')\n",
172
- "predicted_nanobeam_cell = pf.device_to_cell(device=pf.binarize(prediction),\n",
173
- " cell_name='nanobeam_p',\n",
174
- " library=gds_library,\n",
175
- " resolution=1,\n",
176
- " layer=9)\n",
171
+ "gds_library = gdspy.GdsLibrary(infile=\"../devices/devices.gds\")\n",
172
+ "predicted_nanobeam_cell = pf.device_to_cell(\n",
173
+ " device=pf.binarize(prediction),\n",
174
+ " cell_name=\"nanobeam_p\",\n",
175
+ " library=gds_library,\n",
176
+ " resolution=1,\n",
177
+ " layer=9,\n",
178
+ ")\n",
177
179
  "origin = (-device.shape[1] / 2 / 1000, -device.shape[0] / 2 / 1000)\n",
178
- "gds_library.cells['nanobeam'].add(gdspy.CellReference(ref_cell=predicted_nanobeam_cell, origin=origin))\n",
179
- "gds_library.write_gds(outfile='../devices/devices.gds')"
180
+ "gds_library.cells[\"nanobeam\"].add(\n",
181
+ " gdspy.CellReference(ref_cell=predicted_nanobeam_cell, origin=origin)\n",
182
+ ")\n",
183
+ "gds_library.write_gds(outfile=\"../devices/devices.gds\")"
180
184
  ]
181
185
  },
182
186
  {
@@ -184,7 +188,7 @@
184
188
  "cell_type": "markdown",
185
189
  "metadata": {},
186
190
  "source": [
187
- "With this, we conclude the tutorial! You're now empowered to employ the predicted model of your nanobeam device and conduct simulations to forecast its performance. Furthermore, you might want to refine your nanobeam design to decrease variations and uncertainty (refer to device correction examples). This newfound understanding enables you to enhance your device fabrication processes. Happy fabricating!"
191
+ "With this, we conclude the tutorial! You're now empowered to employ the predicted model of your nanobeam device and conduct simulations to forecast its performance. Furthermore, you might want to refine your nanobeam design to decrease variations and uncertainty (refer to device correction examples). This newfound understanding enables you to enhance your device fabrication processes. Happy fabricating!\n"
188
192
  ]
189
193
  }
190
194
  ],
@@ -11,7 +11,7 @@
11
11
  "2. Executing the correction process\n",
12
12
  "3. Analyzing the results of the correction\n",
13
13
  "\n",
14
- "To begin, let's import the necessary libraries:"
14
+ "To begin, let's import the necessary libraries:\n"
15
15
  ]
16
16
  },
17
17
  {
@@ -31,7 +31,7 @@
31
31
  "source": [
32
32
  "Initially, we prepare a device image for correction. This involves loading an image of a device as a numpy matrix. Pixel values should be binary: 0 or 1. For this tutorial, we use an image of a target, but feel free to try other devices in the devices/ directory, or even add your own images.\n",
33
33
  "\n",
34
- "Please remember that the image scale should be 1 nm/px. If it's not, ensure you specify the actual length of the device image (in nm) when loading the image."
34
+ "Please remember that the image scale should be 1 nm/px. If it's not, ensure you specify the actual length of the device image (in nm) when loading the image.\n"
35
35
  ]
36
36
  },
37
37
  {
@@ -52,12 +52,14 @@
52
52
  ],
53
53
  "source": [
54
54
  "IMG_LENGTH_NM = 1000\n",
55
- "device = pf.load_device_img(path='../devices/target_32x128_256x256.png', img_length_nm=IMG_LENGTH_NM)\n",
55
+ "device = pf.load_device_img(\n",
56
+ " path=\"../devices/target_32x128_256x256.png\", img_length_nm=IMG_LENGTH_NM\n",
57
+ ")\n",
56
58
  "\n",
57
59
  "plt.imshow(device)\n",
58
- "plt.title('Nominal Device')\n",
59
- "plt.ylabel('Distance (nm)')\n",
60
- "plt.xlabel('Distance (nm)')\n",
60
+ "plt.title(\"Nominal Device\")\n",
61
+ "plt.ylabel(\"Distance (nm)\")\n",
62
+ "plt.xlabel(\"Distance (nm)\")\n",
61
63
  "plt.show()"
62
64
  ]
63
65
  },
@@ -68,7 +70,7 @@
68
70
  "source": [
69
71
  "Next, we perform the correction on our target structure. Each model is distinctively identified by the name of the fabrication facility and process, the model version, and the dataset version used for training. Please refer to [docs/models.md](docs/models.md) for a list of available models.\n",
70
72
  "\n",
71
- "At this point, we will opt for a binarized output. By default, the corrector provides raw corrections, which include \"fuzzy\" or uncertain areas of the structure that may vary between different fabrication runs or even between different instances of the same target structure on the same chip. However, choosing a binarized output, the corrector will output the most likely corrected design, creating a fabricatable structure. It's also possible to binarize the output post-correction, allowing you to compare both the raw and binarized corrections."
73
+ "At this point, we will opt for a binarized output. By default, the corrector provides raw corrections, which include \"fuzzy\" or uncertain areas of the structure that may vary between different fabrication runs or even between different instances of the same target structure on the same chip. However, choosing a binarized output, the corrector will output the most likely corrected design, creating a fabricatable structure. It's also possible to binarize the output post-correction, allowing you to compare both the raw and binarized corrections.\n"
72
74
  ]
73
75
  },
74
76
  {
@@ -88,15 +90,17 @@
88
90
  }
89
91
  ],
90
92
  "source": [
91
- "# Performance note: The first prediction might take longer as the cloud server starts and loads the necessary model(s). Subsequent predictions should be quicker.\n",
92
- "MODEL_NAME = 'ANT_NanoSOI'\n",
93
- "MODEL_TAGS = 'v5-d4'\n",
94
- "correction = pf.correct(device=device, model_name=MODEL_NAME, model_tags=MODEL_TAGS, binarize=True)\n",
93
+ "# Performance note: The first correction might take longer as the cloud server starts and loads the necessary model(s). Subsequent predictions should be quicker.\n",
94
+ "MODEL_NAME = \"ANT_NanoSOI\"\n",
95
+ "MODEL_TAGS = \"v5-d4\"\n",
96
+ "correction = pf.correct(\n",
97
+ " device=device, model_name=MODEL_NAME, model_tags=MODEL_TAGS, binarize=True\n",
98
+ ")\n",
95
99
  "\n",
96
100
  "plt.imshow(pf.binarize(correction))\n",
97
- "plt.title('Corrected Device')\n",
98
- "plt.ylabel('Distance (nm)')\n",
99
- "plt.xlabel('Distance (nm)')\n",
101
+ "plt.title(\"Corrected Device\")\n",
102
+ "plt.ylabel(\"Distance (nm)\")\n",
103
+ "plt.xlabel(\"Distance (nm)\")\n",
100
104
  "plt.show()"
101
105
  ]
102
106
  },
@@ -105,7 +109,7 @@
105
109
  "cell_type": "markdown",
106
110
  "metadata": {},
107
111
  "source": [
108
- "Our next step is to visualize the difference between the nominal and corrected designs for the target structure. The corrector compensates for expected fabrication errors by adjusting the design. It adds silicon in places where it predicts an over-etch and removes silicon where it predicts an under-etch."
112
+ "Our next step is to visualize the difference between the nominal and corrected designs for the target structure. The corrector compensates for expected fabrication errors by adjusting the design. It adds silicon in places where it predicts an over-etch and removes silicon where it predicts an under-etch.\n"
109
113
  ]
110
114
  },
111
115
  {
@@ -126,12 +130,12 @@
126
130
  ],
127
131
  "source": [
128
132
  "variation = device - correction\n",
129
- "plt.imshow(variation, cmap='jet', vmin=-1, vmax=1)\n",
130
- "plt.title('Changes to Device')\n",
131
- "plt.ylabel('Distance (nm)')\n",
132
- "plt.xlabel('Distance (nm)')\n",
133
+ "plt.imshow(variation, cmap=\"jet\", vmin=-1, vmax=1)\n",
134
+ "plt.title(\"Changes to Device\")\n",
135
+ "plt.ylabel(\"Distance (nm)\")\n",
136
+ "plt.xlabel(\"Distance (nm)\")\n",
133
137
  "cb = plt.colorbar()\n",
134
- "cb.set_label('Added Silicon Removed Silicon')\n",
138
+ "cb.set_label(\"Added Silicon Removed Silicon\")\n",
135
139
  "plt.show()"
136
140
  ]
137
141
  },
@@ -142,7 +146,7 @@
142
146
  "source": [
143
147
  "In the next step, we predict the fabrication outcomes for both the nominal and corrected target structures using the prediction model. We then visualize the predicted outcomes, highlighting the fidelity improvements achieved through the correction process.\n",
144
148
  "\n",
145
- "In the corrected design, the corners are expected to be sharper and the middle openings are better resolved compared to the nominal design."
149
+ "In the corrected design, the corners are expected to be sharper and the middle openings are better resolved compared to the nominal design.\n"
146
150
  ]
147
151
  },
148
152
  {
@@ -162,23 +166,27 @@
162
166
  }
163
167
  ],
164
168
  "source": [
165
- "outcome = pf.predict(device=correction, model_name=MODEL_NAME, model_tags=MODEL_TAGS, binarize=True)\n",
166
- "prediction = pf.predict(device=device, model_name=MODEL_NAME, model_tags=MODEL_TAGS, binarize=True)\n",
169
+ "outcome = pf.predict(\n",
170
+ " device=correction, model_name=MODEL_NAME, model_tags=MODEL_TAGS, binarize=True\n",
171
+ ")\n",
172
+ "prediction = pf.predict(\n",
173
+ " device=device, model_name=MODEL_NAME, model_tags=MODEL_TAGS, binarize=True\n",
174
+ ")\n",
167
175
  "\n",
168
176
  "fig, axs = plt.subplots(1, 3, figsize=(15, 5))\n",
169
177
  "axs[0].imshow(prediction)\n",
170
- "axs[0].imshow(pf.generate_device_contour(device), cmap='cool')\n",
171
- "axs[0].set_title('Prediction of Nominal Device')\n",
172
- "axs[0].set_ylabel('Distance (nm)')\n",
173
- "axs[0].set_xlabel('Distance (nm)')\n",
178
+ "axs[0].imshow(pf.generate_device_contour(device), cmap=\"cool\")\n",
179
+ "axs[0].set_title(\"Prediction of Nominal Device\")\n",
180
+ "axs[0].set_ylabel(\"Distance (nm)\")\n",
181
+ "axs[0].set_xlabel(\"Distance (nm)\")\n",
174
182
  "axs[1].imshow(outcome)\n",
175
- "axs[1].imshow(pf.generate_device_contour(device), cmap='cool')\n",
176
- "axs[1].set_title('Prediction of Corrected Device')\n",
177
- "axs[1].set_xlabel('Distance (nm)')\n",
178
- "axs[2].imshow(prediction - outcome, cmap='jet', vmin=-1, vmax=1)\n",
179
- "axs[2].set_title('Improvement From Correction')\n",
180
- "axs[2].set_xlabel('Distance (nm)')\n",
181
- "plt.show()\n"
183
+ "axs[1].imshow(pf.generate_device_contour(device), cmap=\"cool\")\n",
184
+ "axs[1].set_title(\"Prediction of Corrected Device\")\n",
185
+ "axs[1].set_xlabel(\"Distance (nm)\")\n",
186
+ "axs[2].imshow(prediction - outcome, cmap=\"jet\", vmin=-1, vmax=1)\n",
187
+ "axs[2].set_title(\"Improvement From Correction\")\n",
188
+ "axs[2].set_xlabel(\"Distance (nm)\")\n",
189
+ "plt.show()"
182
190
  ]
183
191
  },
184
192
  {
@@ -186,7 +194,7 @@
186
194
  "cell_type": "markdown",
187
195
  "metadata": {},
188
196
  "source": [
189
- "This concludes our tutorial! You are now ready to leverage the corrected model of your device to run simulations and anticipate its post-fabrication performance. This expertise enables you to improve the accuracy and repeatability of your nanostructures. We wish you the best in your future fabrication endeavors!"
197
+ "This concludes our tutorial! You are now ready to leverage the corrected model of your device to run simulations and anticipate its post-fabrication performance. This expertise enables you to improve the accuracy and repeatability of your nanostructures. We wish you the best in your future fabrication endeavors!\n"
190
198
  ]
191
199
  }
192
200
  ],