Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added more options for custom claws in TransmonCross #957

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 39 additions & 16 deletions qiskit_metal/qlibrary/qubits/transmon_cross.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,13 @@ class TransmonCross(BaseQubit): # pylint: disable=invalid-name
* _default_connection_pads: Dict
* connector_type: '0' -- 0 = Claw type, 1 = gap type
* claw_length: '30um' -- Length of the claw 'arms', measured from the connector center trace
* ground_spacing: '5um' -- Amount of ground plane between the connector and Crossmon arm (minimum should be based on fabrication capabilities)
* claw_width: '10um' -- The width of the CPW center trace making up the claw/gap connector
* claw_gap: '6um' -- The gap of the CPW center trace making up the claw/gap connector
* ground_spacing '5um' -- Amount of ground plane between the side of the connector and Crossmon arm (minimum should be based on fabrication capabilities)
* ground_spacing_back: 'None' -- Amount of ground plane between the cpw-side (back) of the connector and Crossmon arm (minimum should be based on fabrication capabilities). Defaults to ground_spacing.
* claw_width: '10um' -- The width of sides of the claw/gap connector
* claw_width_back: None -- The width of the back (area towards the incoming CPW path) of the claw/gap connector. Defaults to claw_width.
* claw_gap: 'cpw_gap' -- The gap of the CPW center trace making up the claw/gap connector
* claw_cpw_lenght: '40um' -- Length of rectangular cpw trace
* claw_cpw_width: 'cpw_width' -- Width of rectangular cpw trace
* connector_location: '0' -- 0 => 'west' arm, 90 => 'north' arm, 180 => 'east' arm
"""

Expand All @@ -77,10 +81,12 @@ class TransmonCross(BaseQubit): # pylint: disable=invalid-name
connector_type='0', # 0 = Claw type, 1 = gap type
claw_length='30um',
ground_spacing='5um',
ground_spacing_back=None, # Defaults to value in `ground_spacing`
claw_width='10um',
claw_gap='6um',
claw_width_back=None, # Defaults to value in `claw_width`
claw_gap='cpw_gap',
claw_cpw_length='40um',
claw_cpw_width='10um',
claw_cpw_width='cpw_width',
connector_location=
'0' # 0 => 'west' arm, 90 => 'north' arm, 180 => 'east' arm
))
Expand Down Expand Up @@ -177,35 +183,52 @@ def make_connection_pad(self, name: str):
c_g = pc.claw_gap
c_l = pc.claw_length
c_w = pc.claw_width
c_w_b = pc.claw_width_back
c_c_w = pc.claw_cpw_width
c_c_l = pc.claw_cpw_length
g_s = pc.ground_spacing
g_s_b = pc.ground_spacing_back
con_loc = pc.connector_location

claw_cpw = draw.box(-c_w, -c_c_w / 2, -c_c_l - c_w, c_c_w / 2)
# Default option if `claw_width_back` is unspecified
# Ensures backwards compatability (pre June 2023)
if (pc.claw_width_back == None):
c_w_b = c_w

if pc.connector_type == 0: # Claw connector
# Default option if `ground_spacing_back` is unspecified
# Ensures backwards compatability (pre June 2023)
if (pc.claw_spacing_back == None):
g_s_b = g_s

# `connector_type` logic
if pc.connector_type == 0: # Claw-style connector
# CPW box geometry
claw_cpw = draw.box(-c_w_b, -c_c_w / 2, -c_c_l - c_w_b, c_c_w / 2)

# Claw geometry
t_claw_height = 2*c_g + 2 * c_w + 2*g_s + \
2*cross_gap + cross_width # temp value

claw_base = draw.box(-c_w, -(t_claw_height) / 2, c_l,
claw_base = draw.box(-c_w_b, -(t_claw_height) / 2, c_l,
t_claw_height / 2)
claw_subtract = draw.box(0, -t_claw_height / 2 + c_w, c_l,
t_claw_height / 2 - c_w)
claw_base = claw_base.difference(claw_subtract)

connector_arm = draw.shapely.ops.unary_union([claw_base, claw_cpw])
connector_etcher = draw.buffer(connector_arm, c_g)
else:

# Port line for claw-style
port_line = draw.LineString([(-c_c_l - c_w_b, -c_c_w / 2),
(-c_c_l - c_w_b, c_c_w / 2)])
else: # Rectangle style connector
# Rectangle geometry
connector_arm = draw.box(0, -c_w / 2, -4 * c_w, c_w / 2)
connector_etcher = draw.buffer(connector_arm, c_g)

# Making the pin for tracking (for easy connect functions).
# Done here so as to have the same translations and rotations as the connector. Could
# extract from the connector later, but since allowing different connector types,
# this seems more straightforward.
port_line = draw.LineString([(-c_c_l - c_w, -c_c_w / 2),
(-c_c_l - c_w, c_w / 2)])
# Port line for rectangle-style
port_line = draw.LineString([(-4 * c_w, -c_w / 2),
(-4 * c_w, c_w / 2)])

claw_rotate = 0
if con_loc > 135:
Expand All @@ -215,7 +238,7 @@ def make_connection_pad(self, name: str):

# Rotates and translates the connector polygons (and temporary port_line)
polys = [connector_arm, connector_etcher, port_line]
polys = draw.translate(polys, -(cross_length + cross_gap + g_s + c_g),
polys = draw.translate(polys, -(cross_length + cross_gap + g_s_b + c_g),
0)
polys = draw.rotate(polys, claw_rotate, origin=(0, 0))
polys = draw.rotate(polys, p.orientation, origin=(0, 0))
Expand Down
10 changes: 7 additions & 3 deletions qiskit_metal/tests/test_qlibrary_2_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -487,21 +487,25 @@ def test_qlibrary_transmon_cross_options(self):
self.assertEqual(_options['cross_length'], '200um')
self.assertEqual(_options['cross_gap'], '20um')

self.assertEqual(len(_options['_default_connection_pads']), 8)
self.assertEqual(len(_options['_default_connection_pads']), 10)
self.assertEqual(_options['_default_connection_pads']['connector_type'],
'0')
self.assertEqual(_options['_default_connection_pads']['claw_length'],
'30um')
self.assertEqual(_options['_default_connection_pads']['ground_spacing'],
'5um')
self.assertEqual(
_options['_default_connection_pads']['ground_spacing_back'], None)
self.assertEqual(_options['_default_connection_pads']['claw_width'],
'10um')
self.assertEqual(
_options['_default_connection_pads']['claw_width_back'], None)
self.assertEqual(_options['_default_connection_pads']['claw_gap'],
'6um')
'cpw_gap')
self.assertEqual(
_options['_default_connection_pads']['claw_cpw_length'], '40um')
self.assertEqual(_options['_default_connection_pads']['claw_cpw_width'],
'10um')
'cpw_width')
self.assertEqual(
_options['_default_connection_pads']['connector_location'], '0')

Expand Down