File size: 7,052 Bytes
3897829
44a0d59
 
 
 
c512e69
 
3897829
 
95e723d
8867798
1f1a680
3897829
 
1f1a680
 
 
 
 
44a0d59
 
95e723d
b43ed69
262adfb
8134e5f
b43ed69
8867798
95e723d
8867798
b43ed69
 
 
 
8867798
b43ed69
d612f90
b43ed69
d612f90
b43ed69
d612f90
b43ed69
95e723d
 
 
b43ed69
d612f90
b43ed69
95e723d
b43ed69
 
 
 
79acb1d
 
 
 
b43ed69
8867798
95e723d
79acb1d
 
 
 
95e723d
b43ed69
8867798
 
 
 
b43ed69
c512e69
d612f90
56dc131
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
---
title: Planar Capacitance Model
emoji: 🔌
colorFrom: blue
colorTo: gray
sdk: docker
app_port: 7860
app_file: app.py
pinned: false
short_description: 'Maxwell capacitance of planar layouts: QCap models'
hf_oauth: true
thumbnail: https://huggingface.co/spaces/shanto268/PlanarCapacitanceModel/resolve/main/assets/qcap_og.png
---

<center>
  <img class="block dark:hidden" src="https://huggingface.co/spaces/shanto268/PlanarCapacitanceModel/resolve/main/assets/qcap_horizontal_light.png" width="320" alt="QCap" />
  <img class="hidden dark:block" src="https://huggingface.co/spaces/shanto268/PlanarCapacitanceModel/resolve/main/assets/qcap_horizontal_dark.png" width="320" alt="QCap" />
</center>

# Planar Capacitance Model

The model of our paper *QCap: a physics-corrected graph neural network for the capacitance matrix of any planar superconducting device layout*, trained on all 45,771 designs of our Q3D dataset, the test designs included. Upload a GDS layout and get the full Maxwell capacitance matrix of every conductor in it. Because the model 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.

- **Paper docsite:** [lfl-lab.github.io/SQuADDS/qcap](https://lfl-lab.github.io/SQuADDS/qcap/), with the explainer videos and the [tutorials](https://lfl-lab.github.io/SQuADDS/qcap/#tutorials)
- **Paper:** [lfl-lab.github.io/SQuADDS/ml-paper/paper](https://lfl-lab.github.io/SQuADDS/ml-paper/paper/)
- **Code:** [github.com/LFL-Lab/SQuADDS](https://github.com/LFL-Lab/SQuADDS)
- **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)
- **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)
- **API:** [SQuADDS ML inference API](https://huggingface.co/spaces/SQuADDS/squadds-ml-inference-api)
- **Point of contact:** [Sadman Ahmed Shanto](mailto:shanto@usc.edu)

## How to use it

1. Try a bundled example, or sign in with Hugging Face and upload your own GDS file.
2. Pick the ground layer and the conductor layer (1/0 and 1/10 by default). If both are on one layer, the Space finds the ground and shows its pick on a numbered image for you to confirm.
3. Choose a model and a substrate, and press Predict. You get the matrix in fF, self terms included.

## Models

| model | how it works | error on 39 new layouts, % (MAE / RMSE, fF) | median time |
|---|---|---|---|
| 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 |
| QCap-Lite | the same recipe on two coarser solves | 2.044 (0.258 / 0.348) | 0.56 s |
| QCap-Fast | a learned prior replaces the solves, then the networks correct it | 3.175 (0.583 / 0.824) | 0.24 s |

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.

QCap-Fast is for quick screening of the component families it was trained on. Use QCap otherwise.

## API

The same endpoints work over `gradio_client` or REST (`/gradio_api/call/<name>`).

```python
import os
from gradio_client import Client, handle_file

c = Client("shanto268/PlanarCapacitanceModel", oauth_token=os.environ["HF_TOKEN"])   # counts as you for the daily limit
r = c.predict(handle_file("layout.gds"), "1/0", "1/10", 0, "Si (cryogenic, training)", 11.45, 350, "QCap",
              api_name="/predict_gds")
print(r["names"], r["matrix_fF"], r["timing_s"]["total_s"])
```

`model` is `QCap`, `QCap-Lite` or `QCap-Fast` (any case). When ground and conductors share a layer, pass the ground's piece numbers as the last argument (`ground_pieces`, for example `"1"` or `"1,4"`) if the automatic pick is wrong.

## Limits of this demo

The examples run without sign-in. Sign in with Hugging Face to run your own layout: 10 predictions per day (UTC), for layouts with fewer than 70 conductors, ground included. A repeat of a result you already have does not count. The API follows the same rules: anonymous calls run the bundled examples only, and a call made with `oauth_token` counts as you. To run many layouts, larger ones or designs you would rather not upload, run the same models on your own computer with SQuADDS: [Run it on your own computer](https://lfl-lab.github.io/SQuADDS/source/ml_local.html).

## Privacy

Uploaded layouts are processed in memory and held there only while the Space runs, to answer repeat requests. Nothing is written to permanent storage, and no file names or geometry are logged or kept. To enforce the daily limit, your Hugging Face username and your network address are turned into keyed hashes, held in memory and cleared at the end of the UTC day. They are never stored or logged. We keep only daily totals (runs per model and per layout size, refusals by reason, errors, response times and the number of distinct users that day) to understand how the demo is used. Hugging Face keeps ordinary web access logs under its own policy.

## Citation

If you use SQuADDS or QCap in your work, please cite:

- S. Shanto *et al.*, "SQuADDS: A validated design database and simulation workflow for superconducting qubit design," *Quantum* **8**, 1465 (2024), [doi:10.22331/q-2024-09-09-1465](https://doi.org/10.22331/q-2024-09-09-1465).
- S. A. Shanto, S. Das and E. Levenson-Falk, "QCap: a physics-corrected graph neural network for the capacitance matrix of any planar superconducting device layout," [arXiv:2611.22057](https://arxiv.org/abs/2611.22057) (2026).

```bibtex
@article{Shanto2024squaddsvalidated,
  doi = {10.22331/q-2024-09-09-1465},
  url = {https://doi.org/10.22331/q-2024-09-09-1465},
  title = {{SQ}u{ADDS}: {A} validated design database and simulation workflow for superconducting qubit design},
  author = {Shanto, Sadman and Kuo, Andre and Miyamoto, Clark and Zhang, Haimeng and Maurya, Vivek and Vlachos, Evangelos and Hecht, Malida and Shum, Chung Wa and Levenson-Falk, Eli},
  journal = {{Quantum}},
  issn = {2521-327X},
  publisher = {{Verein zur F{\"{o}}rderung des Open Access Publizierens in den Quantenwissenschaften}},
  volume = {8},
  pages = {1465},
  month = sep,
  year = {2024}
}

@misc{Shanto2026planarcapacitance,
  title = {{QCap}: a physics-corrected graph neural network for the capacitance matrix of any planar superconducting device layout},
  author = {Shanto, Sadman Ahmed and Das, Saikat and Levenson-Falk, Eli},
  year = {2026},
  eprint = {2611.22057},
  archivePrefix = {arXiv},
  primaryClass = {quant-ph},
  url = {https://arxiv.org/abs/2611.22057}
}
```