Replace mislabeled v1 vectors with static shape embedding v0

#1
by shanto268 - opened
README.md CHANGED
@@ -1,10 +1,10 @@
1
  ---
2
  license: mit
3
  configs:
4
- - config_name: geometry-vector-v1
5
  data_files:
6
  - split: train
7
- path: "metadata/geometry-vector-v1.parquet"
8
  tags:
9
  - quantum
10
  - superconducting
@@ -13,6 +13,7 @@ tags:
13
  - layout
14
  - embedding
15
  - geometry
 
16
  pretty_name: SQuADDS Layout Embeddings
17
  size_categories:
18
  - 1K<n<10K
@@ -24,32 +25,74 @@ size_categories:
24
 
25
  # SQuADDS Layout Embeddings
26
 
27
- Versioned, reproducible geometry vectors for layouts in
28
  [SQuADDS/SQuADDS_Layouts](https://huggingface.co/datasets/SQuADDS/SQuADDS_Layouts).
29
 
30
- ## `geometry-vector-v1`
31
 
32
- This release provides 4,577 embedding vectors (generated through the v0 algorithm), one per layout in the
33
- paired layout registry.
34
 
35
- The exact feature order, layer vocabulary, normalization rule, and source
36
- feature-schema version are frozen in `metadata/geometry-vector-v1.schema.json`.
37
- Every record retains `layout_id`, `artifact_id`, `design_id`, `component_name`,
38
- and `source_id` to link it directly to the simulation database and checksum
39
- verified GDS artifact.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
40
 
41
  ## Access
42
 
43
  ```python
44
- from squadds.layouts import GeometryEmbeddingClient
45
 
46
- embeddings = GeometryEmbeddingClient()
47
- record = embeddings.get("layout:sha256:<layout hash>")
48
- neighbors = embeddings.nearest(record["layout_id"], limit=10)
 
49
  ```
50
 
51
- For raw geometry, simulation provenance, and numerical geometry features, use
52
- the [SQuADDS Layouts dataset](https://huggingface.co/datasets/SQuADDS/SQuADDS_Layouts).
 
 
 
 
 
 
 
 
 
 
53
 
54
  ## Citation
55
 
 
1
  ---
2
  license: mit
3
  configs:
4
+ - config_name: static-embedding-v0
5
  data_files:
6
  - split: train
7
+ path: "metadata/static-embedding-v0.parquet"
8
  tags:
9
  - quantum
10
  - superconducting
 
13
  - layout
14
  - embedding
15
  - geometry
16
+ - computer-vision
17
  pretty_name: SQuADDS Layout Embeddings
18
  size_categories:
19
  - 1K<n<10K
 
25
 
26
  # SQuADDS Layout Embeddings
27
 
28
+ Versioned layout representations for the 4,577 GDS artifacts in
29
  [SQuADDS/SQuADDS_Layouts](https://huggingface.co/datasets/SQuADDS/SQuADDS_Layouts).
30
 
31
+ ## Static embedding model `v0`
32
 
33
+ `static-embedding-v0` implements the original SQuADDS proof-of-concept model:
 
34
 
35
+ ```text
36
+ v0 = parameter_sum + geometric_moments + flattened_shape_bitmap
37
+ ```
38
+
39
+ Each unit-normalized vector has **9,227 dimensions**:
40
+
41
+ | Block | Dimensions | Contents |
42
+ | --- | ---: | --- |
43
+ | Parameter sum | 1 | Permutation- and parameter-count-invariant sum of numerical design options, converted to micrometers where units are present |
44
+ | Geometric moments | 10 | Functional area, perimeter, aspect ratio, occupancy, centroid, second central moments, and eccentricity |
45
+ | Shape tensor | 9,216 | Row-major flattened 96×96 signed bitmap of functional GDS geometry |
46
+
47
+ The bitmap uses `+1` for conductor, `-1` for etch, `+0.5` for explicit port
48
+ geometry, and `0` for background. Geometry is cropped to its functional bounds,
49
+ centered without distortion, supersampled at 4×, and reduced to 96×96. The
50
+ large simulation-domain ground rectangle on layer `(1, 0)` is excluded so it
51
+ does not hide the component shape.
52
+
53
+ This is a deterministic static embedding, not a learned model. It is intended
54
+ as a transparent baseline and as a stable input for similarity search. A future
55
+ `v1` may use a compact learned raster or geometry-graph encoder, but will be
56
+ published as a separate model rather than changing `v0` in place.
57
+
58
+ The exact block offsets, moment order, raster semantics, normalization
59
+ statistics, and source schema are frozen in
60
+ `metadata/static-embedding-v0.schema.json`.
61
+
62
+ ## Coverage and links
63
+
64
+ | Component | Embeddings |
65
+ | --- | ---: |
66
+ | `GeneralizedCapNInterdigital` | 3,683 |
67
+ | `CapNInterdigitalTee` | 894 |
68
+
69
+ Every row retains `layout_id`, `artifact_id`, `design_id`, `component_name`,
70
+ and `source_id`, plus the raw parameter sum, geometric moments, functional
71
+ bounds, and a SHA-256 hash of the 96×96 bitmap.
72
 
73
  ## Access
74
 
75
  ```python
76
+ from squadds.layouts import StaticEmbeddingClient
77
 
78
+ client = StaticEmbeddingClient()
79
+ record = client.get("layout:sha256:<layout hash>")
80
+ bitmap = client.shape_bitmap(record["layout_id"])
81
+ neighbors = client.nearest(record["layout_id"], limit=10)
82
  ```
83
 
84
+ SQuADDS_DB rows can resolve the same vector directly with
85
+ `SQuADDS_DB.get_layout_embedding(row)`. The SQuADDS MCP server also provides
86
+ `get_layout_embedding` and `find_similar_layouts`.
87
+
88
+ ## Provenance
89
+
90
+ Raw GDS artifacts, layer semantics, checksums, and geometry features live in
91
+ [SQuADDS/SQuADDS_Layouts](https://huggingface.co/datasets/SQuADDS/SQuADDS_Layouts).
92
+ Simulation results and design options live in
93
+ [SQuADDS/SQuADDS_DB](https://huggingface.co/datasets/SQuADDS/SQuADDS_DB).
94
+ The generalized-capacitor dataset was contributed by Saikat Das of the
95
+ Levenson-Falk Lab at USC.
96
 
97
  ## Citation
98
 
metadata/geometry-vector-v1.schema.json DELETED
@@ -1,53 +0,0 @@
1
- {
2
- "geometry_vector_schema_version": "1.0.0",
3
- "source_geometry_feature_schema_version": "1.0.0",
4
- "normalization": "L2 unit norm; raw dimensions use log1p except log aspect ratio and layer fractions.",
5
- "layer_vocabulary": [
6
- {
7
- "layer": 1,
8
- "datatype": 0
9
- },
10
- {
11
- "layer": 1,
12
- "datatype": 10
13
- },
14
- {
15
- "layer": 1,
16
- "datatype": 11
17
- },
18
- {
19
- "layer": 2,
20
- "datatype": 0
21
- },
22
- {
23
- "layer": 3,
24
- "datatype": 0
25
- }
26
- ],
27
- "feature_names": [
28
- "log1p_bbox_width_um",
29
- "log1p_bbox_height_um",
30
- "log1p_bbox_area_um2",
31
- "log_bbox_aspect_ratio",
32
- "log1p_total_area_um2",
33
- "log1p_polygon_count",
34
- "log1p_cell_count",
35
- "log1p_layer_count",
36
- "layer_1_datatype_0_present",
37
- "layer_1_datatype_0_area_fraction",
38
- "layer_1_datatype_0_polygon_fraction",
39
- "layer_1_datatype_10_present",
40
- "layer_1_datatype_10_area_fraction",
41
- "layer_1_datatype_10_polygon_fraction",
42
- "layer_1_datatype_11_present",
43
- "layer_1_datatype_11_area_fraction",
44
- "layer_1_datatype_11_polygon_fraction",
45
- "layer_2_datatype_0_present",
46
- "layer_2_datatype_0_area_fraction",
47
- "layer_2_datatype_0_polygon_fraction",
48
- "layer_3_datatype_0_present",
49
- "layer_3_datatype_0_area_fraction",
50
- "layer_3_datatype_0_polygon_fraction"
51
- ],
52
- "dimensions": 23
53
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
metadata/{geometry-vector-v1.parquet → static-embedding-v0.parquet} RENAMED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:ff9fc02154da56a58095af4100f48c4557d9f17aa05d9bbd13cffeecb48907ab
3
- size 1614070
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:eee64ef7382c0fbe6cb9d763f848e1d482790c746429570810a501b94dd86fb7
3
+ size 27206661
metadata/static-embedding-v0.schema.json ADDED
@@ -0,0 +1,83 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "model": "static-shape-v0",
3
+ "embedding_schema_version": "0.1.0",
4
+ "dimensions": 9227,
5
+ "blocks": {
6
+ "parameter_sum": {
7
+ "offset": 0,
8
+ "dimensions": 1
9
+ },
10
+ "geometric_moments": {
11
+ "offset": 1,
12
+ "dimensions": 10,
13
+ "names": [
14
+ "log1p_functional_area_um2",
15
+ "log1p_functional_perimeter_um",
16
+ "log_functional_bbox_aspect_ratio",
17
+ "bitmap_occupancy_fraction",
18
+ "bitmap_centroid_x",
19
+ "bitmap_centroid_y",
20
+ "bitmap_mu20",
21
+ "bitmap_mu02",
22
+ "bitmap_mu11",
23
+ "bitmap_eccentricity"
24
+ ]
25
+ },
26
+ "shape_bitmap": {
27
+ "offset": 11,
28
+ "dimensions": 9216,
29
+ "shape": [
30
+ 96,
31
+ 96
32
+ ],
33
+ "flatten_order": "row-major"
34
+ }
35
+ },
36
+ "shape_rasterization": {
37
+ "resolution": [
38
+ 96,
39
+ 96
40
+ ],
41
+ "crop": "functional geometry bounds, aspect preserving, centered with 4-pixel margin",
42
+ "supersampling": 4,
43
+ "values": {
44
+ "conductor": 1.0,
45
+ "etch": -1.0,
46
+ "port": 0.5,
47
+ "background": 0.0
48
+ },
49
+ "excluded": "simulation-domain ground layer (1, 0)"
50
+ },
51
+ "normalization": {
52
+ "parameter_mean": 119.12693904304129,
53
+ "parameter_std": 41.47948098628826,
54
+ "moment_mean": [
55
+ 7.199095883714775,
56
+ 6.038557291097784,
57
+ -0.06114899487646157,
58
+ 0.3444617315897131,
59
+ 0.027325720598655186,
60
+ 0.001453481663011831,
61
+ 0.04410981652657115,
62
+ 0.03196827568718987,
63
+ -0.00023640558809321613,
64
+ 0.7251485793088448
65
+ ],
66
+ "moment_std": [
67
+ 0.9058000344121664,
68
+ 0.6270697679224184,
69
+ 0.7402350020741016,
70
+ 0.1290950058579193,
71
+ 0.05763537913270997,
72
+ 0.0021810992553648666,
73
+ 0.02303165066879144,
74
+ 0.014210240903499162,
75
+ 0.00040800322351881635,
76
+ 0.2101244913274543
77
+ ],
78
+ "parameter": "tanh(z-score)",
79
+ "moments": "z-score, clipped to [-5, 5], then L2 normalized",
80
+ "shape": "signed bitmap, then L2 normalized",
81
+ "embedding": "concatenated blocks, then L2 normalized"
82
+ }
83
+ }