README: the models are QCap, QCap-Lite and QCap-Fast (folders qcap/, qcap-lite/, qcap-fast/; API ids qcap, qcap-fast)
Browse files
README.md
CHANGED
|
@@ -10,7 +10,7 @@ datasets:
|
|
| 10 |
<img src="https://github.com/LFL-Lab/SQuADDS/blob/master/docs/_static/images/squadds_logo_dark_name.png?raw=true" width="80%" alt="SQuADDS logo" />
|
| 11 |
</center>
|
| 12 |
|
| 13 |
-
#
|
| 14 |
|
| 15 |
The model of our paper *A physics-corrected graph neural network for the capacitance matrix of any planar superconducting circuit layout*, trained on all 45,771 designs of our Q3D dataset, the test designs included. It reads a GDS layout and returns the full Maxwell capacitance matrix of every conductor in it. Because it has seen the test designs, it has no held-out score of its own. Its held-out accuracy, from the same model trained without the test designs, is in the paper.
|
| 16 |
|
|
@@ -18,7 +18,7 @@ The model of our paper *A physics-corrected graph neural network for the capacit
|
|
| 18 |
- **Paper:** [lfl-lab.github.io/SQuADDS/ml-paper/paper](https://lfl-lab.github.io/SQuADDS/ml-paper/paper/)
|
| 19 |
- **Code:** [github.com/LFL-Lab/SQuADDS](https://github.com/LFL-Lab/SQuADDS)
|
| 20 |
- **Data:** [Q3D dataset](https://huggingface.co/datasets/SQuADDS/SQuADDS_PlanarCapacitance) and [synthetic dataset](https://huggingface.co/datasets/SQuADDS/SQuADDS_PlanarCapacitance-Synthetic), part of the [SQuADDS datasets](https://huggingface.co/collections/SQuADDS/squadds-datasets-6a65152b857f8efa5620880a)
|
| 21 |
-
- **Models:** [
|
| 22 |
- **API:** [SQuADDS ML inference API](https://huggingface.co/spaces/SQuADDS/squadds-ml-inference-api)
|
| 23 |
- **Point of contact:** [Sadman Ahmed Shanto](mailto:shanto@usc.edu)
|
| 24 |
|
|
@@ -27,28 +27,28 @@ The model of our paper *A physics-corrected graph neural network for the capacit
|
|
| 27 |
```python
|
| 28 |
from squadds.ml.capacitance import CapacitancePredictor, load_model
|
| 29 |
|
| 30 |
-
res = CapacitancePredictor(load_model("
|
| 31 |
-
fast = CapacitancePredictor(load_model("
|
| 32 |
res.names, res.matrix_fF, res.to_sim_results()
|
| 33 |
```
|
| 34 |
|
| 35 |
## Hosted API
|
| 36 |
|
| 37 |
-
The [SQuADDS ML inference API](https://huggingface.co/spaces/SQuADDS/squadds-ml-inference-api) serves these models over HTTP as `
|
| 38 |
|
| 39 |
-
- `GET /v1/models/
|
| 40 |
-
- `GET /v1/models/
|
| 41 |
-
- `POST /v1/models/
|
| 42 |
|
| 43 |
```bash
|
| 44 |
-
curl -X POST https://squadds-squadds-ml-inference-api.hf.space/v1/models/
|
| 45 |
-F file=@chip.gds -F 'inputs={"ground_layer": "1/0", "conductor_layer": "1/10"}'
|
| 46 |
```
|
| 47 |
|
| 48 |
```python
|
| 49 |
from squadds.ml import client
|
| 50 |
|
| 51 |
-
r = client.predict("
|
| 52 |
r["outputs"]["names"], r["outputs"]["matrix_fF"]
|
| 53 |
```
|
| 54 |
|
|
@@ -56,7 +56,7 @@ The response for the interdigital example layout:
|
|
| 56 |
|
| 57 |
```json
|
| 58 |
{
|
| 59 |
-
"model_id": "
|
| 60 |
"outputs": {
|
| 61 |
"names": ["G", "C1", "C2"],
|
| 62 |
"matrix_fF": [[31.727, -4.264, -5.711], [-4.264, 6.598, -2.285], [-5.711, -2.285, 8.045]],
|
|
@@ -70,22 +70,22 @@ The API takes up to 70 conductors plus ground and 20 MB per file. It runs one pr
|
|
| 70 |
|
| 71 |
## Models
|
| 72 |
|
| 73 |
-
This repository holds all three models in `
|
| 74 |
|
| 75 |
| model | how it works | error on 39 new layouts, % (MAE / RMSE, fF) | median time |
|
| 76 |
|---|---|---|---|
|
| 77 |
-
|
|
| 78 |
-
|
|
| 79 |
-
| Fast | a learned prior replaces the solves, then the networks correct it | 3.175 (0.583 / 0.824) | 0.24 s |
|
| 80 |
|
| 81 |
The 39 layouts are generated rings with a neighbour (3 or 4 conductors) that no part of any model saw in training. On them the extrapolated prior alone scores 1.765 % (MAE 0.275 / RMSE 0.376 fF). Times are on two CPUs of an Intel Xeon E5-2640 v4 cluster node.
|
| 82 |
|
| 83 |
-
Fast is for quick screening of the component families it was trained on. Use
|
| 84 |
|
| 85 |
## Conventions
|
| 86 |
|
| 87 |
- Capacitance is in fF. Ground is row and column 0, and nets are never merged.
|
| 88 |
-
- Trained on a 350 µm silicon substrate (eps_r 11.45) with zero-thickness metal.
|
| 89 |
- Ground on GDS layer 1/0 and conductors on 1/10 by default. Every result carries its physical checks, and a failed check is raised as a warning.
|
| 90 |
|
| 91 |
## Citation
|
|
@@ -125,13 +125,13 @@ SQuADDS checks every file against the manifest in the package (`squadds/ml/capac
|
|
| 125 |
|
| 126 |
| file | sha256 |
|
| 127 |
|---|---|
|
| 128 |
-
| `
|
| 129 |
-
| `
|
| 130 |
-
| `
|
| 131 |
-
| `
|
| 132 |
-
| `
|
| 133 |
-
| `
|
| 134 |
-
| `fast/acc_v1_s0.pt` | `9dff20ade26619e7713c2d145dada65e4554a623780290673cfe9452cf9b64ba` |
|
| 135 |
-
| `fast/acc_v1_s1.pt` | `f1ad2ca065dd650ccabcad73a3c6ad2ac1042f4f68bb828893bbdecc47411ffe` |
|
| 136 |
-
| `fast/acc_v1_s2.pt` | `8cbada211724df5cc05a7b4fdd232607de047b248a43993d3844bd68ff8060c4` |
|
| 137 |
-
| `fast/sall_all_s0.pt` | `132d6f389eda798d31bd5654a96e24cce18fa750134a9fb2a9725eafed339dac` |
|
|
|
|
| 10 |
<img src="https://github.com/LFL-Lab/SQuADDS/blob/master/docs/_static/images/squadds_logo_dark_name.png?raw=true" width="80%" alt="SQuADDS logo" />
|
| 11 |
</center>
|
| 12 |
|
| 13 |
+
# QCap: our model trained on all of our Q3D data
|
| 14 |
|
| 15 |
The model of our paper *A physics-corrected graph neural network for the capacitance matrix of any planar superconducting circuit layout*, trained on all 45,771 designs of our Q3D dataset, the test designs included. It reads a GDS layout and returns the full Maxwell capacitance matrix of every conductor in it. Because it has seen the test designs, it has no held-out score of its own. Its held-out accuracy, from the same model trained without the test designs, is in the paper.
|
| 16 |
|
|
|
|
| 18 |
- **Paper:** [lfl-lab.github.io/SQuADDS/ml-paper/paper](https://lfl-lab.github.io/SQuADDS/ml-paper/paper/)
|
| 19 |
- **Code:** [github.com/LFL-Lab/SQuADDS](https://github.com/LFL-Lab/SQuADDS)
|
| 20 |
- **Data:** [Q3D dataset](https://huggingface.co/datasets/SQuADDS/SQuADDS_PlanarCapacitance) and [synthetic dataset](https://huggingface.co/datasets/SQuADDS/SQuADDS_PlanarCapacitance-Synthetic), part of the [SQuADDS datasets](https://huggingface.co/collections/SQuADDS/squadds-datasets-6a65152b857f8efa5620880a)
|
| 21 |
+
- **Models:** [QCap models](https://huggingface.co/SQuADDS/QCap) (QCap, QCap-Lite and QCap-Fast), part of the [SQuADDS models](https://huggingface.co/collections/SQuADDS/squadds-models-6af8b7da67a22df62af374c6)
|
| 22 |
- **API:** [SQuADDS ML inference API](https://huggingface.co/spaces/SQuADDS/squadds-ml-inference-api)
|
| 23 |
- **Point of contact:** [Sadman Ahmed Shanto](mailto:shanto@usc.edu)
|
| 24 |
|
|
|
|
| 27 |
```python
|
| 28 |
from squadds.ml.capacitance import CapacitancePredictor, load_model
|
| 29 |
|
| 30 |
+
res = CapacitancePredictor(load_model("QCap")).predict("chip.gds") # QCap
|
| 31 |
+
fast = CapacitancePredictor(load_model("QCap-Fast")).predict("chip.gds") # QCap-Fast
|
| 32 |
res.names, res.matrix_fF, res.to_sim_results()
|
| 33 |
```
|
| 34 |
|
| 35 |
## Hosted API
|
| 36 |
|
| 37 |
+
The [SQuADDS ML inference API](https://huggingface.co/spaces/SQuADDS/squadds-ml-inference-api) serves these models over HTTP as `qcap` (QCap) and `qcap-fast` (QCap-Fast). They go live there when the paper is published. Until then, run them locally with SQuADDS as above.
|
| 38 |
|
| 39 |
+
- `GET /v1/models/qcap` describes the model, with its inputs, limits and an example.
|
| 40 |
+
- `GET /v1/models/qcap/schema?format=tool` gives a ready tool definition for AI agents.
|
| 41 |
+
- `POST /v1/models/qcap/predict` takes the GDS file as the multipart field `file`, or base64 encoded in `inputs.file_base64` of a JSON body. The optional inputs are `ground_layer` and `conductor_layer` (`1/0` and `1/10` by default), `eps_r` and `thickness_um` (11.45 and 350 µm), and `ground_pieces` when ground and conductors share a layer.
|
| 42 |
|
| 43 |
```bash
|
| 44 |
+
curl -X POST https://squadds-squadds-ml-inference-api.hf.space/v1/models/qcap/predict \
|
| 45 |
-F file=@chip.gds -F 'inputs={"ground_layer": "1/0", "conductor_layer": "1/10"}'
|
| 46 |
```
|
| 47 |
|
| 48 |
```python
|
| 49 |
from squadds.ml import client
|
| 50 |
|
| 51 |
+
r = client.predict("qcap", file="chip.gds")
|
| 52 |
r["outputs"]["names"], r["outputs"]["matrix_fF"]
|
| 53 |
```
|
| 54 |
|
|
|
|
| 56 |
|
| 57 |
```json
|
| 58 |
{
|
| 59 |
+
"model_id": "qcap",
|
| 60 |
"outputs": {
|
| 61 |
"names": ["G", "C1", "C2"],
|
| 62 |
"matrix_fF": [[31.727, -4.264, -5.711], [-4.264, 6.598, -2.285], [-5.711, -2.285, 8.045]],
|
|
|
|
| 70 |
|
| 71 |
## Models
|
| 72 |
|
| 73 |
+
This repository holds all three models in `qcap/`, `qcap-lite/` and `qcap-fast/`. SQuADDS loads QCap and QCap-Fast.
|
| 74 |
|
| 75 |
| model | how it works | error on 39 new layouts, % (MAE / RMSE, fF) | median time |
|
| 76 |
|---|---|---|---|
|
| 77 |
+
| QCap (default) | the extrapolated prior from two coarse method-of-moments solves, corrected by the networks | 1.05 (0.132 / 0.188) | 1.1 s |
|
| 78 |
+
| QCap-Lite | the same recipe on two coarser solves | 2.044 (0.258 / 0.348) | 0.56 s |
|
| 79 |
+
| QCap-Fast | a learned prior replaces the solves, then the networks correct it | 3.175 (0.583 / 0.824) | 0.24 s |
|
| 80 |
|
| 81 |
The 39 layouts are generated rings with a neighbour (3 or 4 conductors) that no part of any model saw in training. On them the extrapolated prior alone scores 1.765 % (MAE 0.275 / RMSE 0.376 fF). Times are on two CPUs of an Intel Xeon E5-2640 v4 cluster node.
|
| 82 |
|
| 83 |
+
QCap-Fast is for quick screening of the component families it was trained on. Use QCap otherwise.
|
| 84 |
|
| 85 |
## Conventions
|
| 86 |
|
| 87 |
- Capacitance is in fF. Ground is row and column 0, and nets are never merged.
|
| 88 |
+
- Trained on a 350 µm silicon substrate (eps_r 11.45) with zero-thickness metal. QCap takes other substrates with `predict(..., eps_r=..., thickness_um=...)`, as in Sec. IV C of the paper. QCap-Fast only rescales by permittivity there and warns.
|
| 89 |
- Ground on GDS layer 1/0 and conductors on 1/10 by default. Every result carries its physical checks, and a failed check is raised as a warning.
|
| 90 |
|
| 91 |
## Citation
|
|
|
|
| 125 |
|
| 126 |
| file | sha256 |
|
| 127 |
|---|---|
|
| 128 |
+
| `qcap/acc_v2m_sf_s0.pt` | `cc69c5818f5028c26177159b88239116520abbb290743d6a6c091657e8dbf1c5` |
|
| 129 |
+
| `qcap/acc_v2m_sf_s1.pt` | `2f88606dbec5c599550d088213a4c37af3b3ad5134ebad2e60519fb534553a57` |
|
| 130 |
+
| `qcap/acc_v2m_sf_s2.pt` | `d13bafc6b2eb7cadcd97a387d791c0210976db1a9d618f9acc1b614e3701daed` |
|
| 131 |
+
| `qcap-lite/bal_v2m_sf_s0.pt` | `aa742ab93b1e3ffcd86a753bda5cc4a68812acbe8140a6b0e311c11d1f36b4b2` |
|
| 132 |
+
| `qcap-lite/bal_v2m_sf_s1.pt` | `486466473eba61c090f4e3fa7988bf880fc183570c5d02bd78f4c1356691f926` |
|
| 133 |
+
| `qcap-lite/bal_v2m_sf_s2.pt` | `1b55ded04fd624585eeeccf2ab6e4a8e9354a9b96694131e1737dde43ad3ff58` |
|
| 134 |
+
| `qcap-fast/acc_v1_s0.pt` | `9dff20ade26619e7713c2d145dada65e4554a623780290673cfe9452cf9b64ba` |
|
| 135 |
+
| `qcap-fast/acc_v1_s1.pt` | `f1ad2ca065dd650ccabcad73a3c6ad2ac1042f4f68bb828893bbdecc47411ffe` |
|
| 136 |
+
| `qcap-fast/acc_v1_s2.pt` | `8cbada211724df5cc05a7b4fdd232607de047b248a43993d3844bd68ff8060c4` |
|
| 137 |
+
| `qcap-fast/sall_all_s0.pt` | `132d6f389eda798d31bd5654a96e24cce18fa750134a9fb2a9725eafed339dac` |
|