Coverage for qpdk / samples / filled_test_chip.py: 100%
21 statements
« prev ^ index » next coverage.py v7.13.4, created at 2026-03-14 10:27 +0000
« prev ^ index » next coverage.py v7.13.4, created at 2026-03-14 10:27 +0000
1# ---
2# jupyter:
3# jupytext:
4# text_representation:
5# extension: .py
6# format_name: percent
7# format_version: '1.3'
8# jupytext_version: 1.17.3
9# ---
11# %% tags=["hide-input", "hide-output"]
12from functools import partial
13from pathlib import Path
15import gdsfactory as gf
16from gdsfactory.read import from_yaml
18from qpdk import PDK, tech
19from qpdk.cells.chip import chip_edge
20from qpdk.cells.helpers import apply_additive_metals, fill_magnetic_vortices
21from qpdk.helper import layerenum_to_tuple
23# %% [markdown]
24# # Filled Qubit Test Chip Example
25#
26# This example demonstrates creating a qubit test chip filled with magnetic vortex trapping rectangles.
27#
28# The design roughly corresponds to the sample described in Tuokkola et al. "Methods to achieve near-millisecond coherence times in superconducting quantum circuits" (2025).
31# %% [markdown]
32# ## Filled Qubit Test Chip Function
33#
34# Creates a qubit test chip from a YAML configuration and fills it with magnetic vortex trapping rectangles.
35#
36# See the YAML file for the original test chip layout.
38# %% [rst]
39#
40# .. note::
41#
42# See the YAML file for the original test chip layout.
43#
44# .. include:: ./qubit_test_chip.pic.yml
45#
48# %%
49@gf.cell
50def filled_qubit_test_chip(
51 yaml_path: str | Path = Path(__file__).parent / "qubit_test_chip.pic.yml",
52):
53 """Returns a qubit test chip filled with magnetic vortex trapping rectangles.
55 Roughly corresponds to the sample in :cite:`tuokkolaMethodsAchieveNearmillisecond2025`.
56 """
57 c = gf.Component()
58 test_chip = from_yaml(
59 yaml_path,
60 routing_strategies=tech.routing_strategies,
61 )
62 c << fill_magnetic_vortices(
63 component=test_chip,
64 rectangle_size=(15.0, 15.0),
65 gap=70.0,
66 stagger=2,
67 )
68 # Add chip edge component
69 chip_edge_ref = c << chip_edge(
70 size=(test_chip.xsize + 230, test_chip.ysize + 200),
71 width=100.0,
72 layer=tech.LAYER.M1_ETCH,
73 )
74 # Position chip edge to align with test chip bounds
75 chip_edge_ref.move((test_chip.xmin - 100, test_chip.ymin - 100))
76 # Flip-chip
77 if any(
78 layerenum_to_tuple(layer_enum) in c.layers
79 for layer_enum in (tech.LAYER.M2_DRAW, tech.LAYER.M2_ETCH)
80 ):
81 chip_edge_ref = c << chip_edge(
82 size=(test_chip.xsize + 230, test_chip.ysize + 200),
83 width=100.0,
84 layer=tech.LAYER.M2_ETCH,
85 )
86 # Position chip edge to align with test chip bounds
87 chip_edge_ref.move((test_chip.xmin - 100, test_chip.ymin - 100))
88 c << fill_magnetic_vortices(
89 component=test_chip,
90 rectangle_size=(15.0, 15.0),
91 gap=70.0,
92 stagger=2,
93 exclude_layers=[
94 (tech.LAYER.M2_ETCH, 80),
95 (tech.LAYER.M2_DRAW, 80),
96 ],
97 fill_layer=tech.LAYER.M2_ETCH,
98 )
100 # Get final 'negative' layout
101 return apply_additive_metals(c)
104# %% [markdown]
105# ## Filled Flipmon Test Chip Function
106#
107# Creates a flipmon test chip from a similar YAML configuration and fills it as well.
108# This version uses flipmon qubits for flip-chip applications.
109# See {cite:p}`liVacuumgapTransmonQubits2021` for more details.
112# %%
113filled_flipmon_test_chip = partial(
114 filled_qubit_test_chip, Path(__file__).parent / "flipmon_test_chip.pic.yml"
115)
117# %% [markdown]
118# ## Examples
120# %%
121if __name__ == "__main__":
122 PDK.activate()
124 # Show original filled qubit test chip
125 filled_qubit_test_chip().show()
127 # %%
129 # Show new filled flipmon test chip
130 filled_flipmon_test_chip().show()