Note

This page was generated from tut//quick-topics//Managing-variables.ipynb.

Managing variables#

Preparation#

[1]:
%config IPCompleter.greedy = True
%load_ext autoreload
%autoreload 2

import qiskit_metal as metal
from qiskit_metal import designs, qlibrary, draw
from qiskit_metal import MetalGUI, Dict
[2]:
design = designs.DesignPlanar()
gui = MetalGUI(design)
[3]:
from qiskit_metal.qlibrary.qubits.transmon_pocket import TransmonPocket
from qiskit_metal.qlibrary.tlines.meandered import RouteMeander

connection_pads = dict(connection_pads=dict(
                a = dict(loc_W=+1,loc_H=+1),
                b = dict(loc_W=-1,loc_H=+1),
                c = dict(loc_W=+1,loc_H=-1),
                d = dict(loc_W=-1,loc_H=-1)
            ))
q1 = TransmonPocket(design, 'Q1', options = dict(pos_x='-1.5mm', pos_y='+0.0mm', **connection_pads))
q2 = TransmonPocket(design, 'Q2', options = dict(pos_x='+1.5mm', pos_y='+0.0mm', **connection_pads))
q3 = TransmonPocket(design, 'Q3', options = dict(pos_x='+0.0mm', pos_y='+1.3mm', **connection_pads))



options = Dict(
    pin_inputs=Dict(
        start_pin=Dict(
            component= 'Q1',
            pin= 'a'),
        end_pin=Dict(
            component= 'Q2',
            pin= 'b')),
)
design.variables.cpw_width = '10um'
design.variables.cpw_gap = '6um'
cpw = RouteMeander(design, 'cpw', options)

gui.rebuild()
gui.autoscale()
[4]:
design.parse_value("['10um', '1nm']")
[4]:
[0.01, 1.0000000000000002e-06]
[5]:
metal.config.DefaultMetalOptions.default_generic.units
[5]:
'mm'
[6]:
# outdated: gui.ui.tabWidget.setTabPosition(0)
[7]:
table = gui.variables_window.ui.tableView
table.resizeColumnsToContents()
[8]:
from PySide2.QtWidgets import QAbstractItemView
table.setVerticalScrollMode(QAbstractItemView.ScrollPerPixel)
table.setHorizontalScrollMode(QAbstractItemView.ScrollPerPixel)
[9]:
table.adjustSize()
[10]:
gui.config.clear()
[11]:
gui.screenshot()
../../_images/tut_quick-topics_Managing-variables_11_0.png
[12]:
# Set variables in the design
design.variables.pad_width = '400 um'

# Assign variables to component options
q1.options.pad_width = 'pad_width'
q2.options.pad_width = 'pad_width'
q3.options.pad_width = 'pad_width'

# Rebuild all compoinent and refresh the gui
gui.rebuild()
gui.autoscale()
[13]:
# Set variables in the design
design.variables.pad_width = '300 um'

# Rebuild all compoinent and refresh the gui
gui.rebuild()
gui.autoscale()
[14]:
# Set variables in the design
design.variables.pad_width = '550 um'

# Rebuild all compoinent and refresh the gui
gui.rebuild()
gui.autoscale()
[15]:
q1.qgeometry_bounds()
[15]:
array([-1.925, -0.325, -1.075,  0.325])
[16]:
# outdated: q1.qgeometry_list()
[17]:
q1.qgeometry_plot
[17]:
<bound method QComponent.qgeometry_plot of name:    Q1
class:   TransmonPocket        
options: 
  'pos_x'             : '-1.5mm',
  'pos_y'             : '+0.0mm',
  'connection_pads'   : {
       'a'                 : {
            'pad_gap'           : '15um',
            'pad_width'         : '125um',
            'pad_height'        : '30um',
            'pad_cpw_shift'     : '5um',
            'pad_cpw_extent'    : '25um',
            'cpw_width'         : 'cpw_width',
            'cpw_gap'           : 'cpw_gap',
            'cpw_extend'        : '100um',
            'pocket_extent'     : '5um',
            'pocket_rise'       : '65um',
            'loc_W'             : 1,
            'loc_H'             : 1,
                             },
       'b'                 : {
            'pad_gap'           : '15um',
            'pad_width'         : '125um',
            'pad_height'        : '30um',
            'pad_cpw_shift'     : '5um',
            'pad_cpw_extent'    : '25um',
            'cpw_width'         : 'cpw_width',
            'cpw_gap'           : 'cpw_gap',
            'cpw_extend'        : '100um',
            'pocket_extent'     : '5um',
            'pocket_rise'       : '65um',
            'loc_W'             : -1,
            'loc_H'             : 1,
                             },
       'c'                 : {
            'pad_gap'           : '15um',
            'pad_width'         : '125um',
            'pad_height'        : '30um',
            'pad_cpw_shift'     : '5um',
            'pad_cpw_extent'    : '25um',
            'cpw_width'         : 'cpw_width',
            'cpw_gap'           : 'cpw_gap',
            'cpw_extend'        : '100um',
            'pocket_extent'     : '5um',
            'pocket_rise'       : '65um',
            'loc_W'             : 1,
            'loc_H'             : -1,
                             },
       'd'                 : {
            'pad_gap'           : '15um',
            'pad_width'         : '125um',
            'pad_height'        : '30um',
            'pad_cpw_shift'     : '5um',
            'pad_cpw_extent'    : '25um',
            'cpw_width'         : 'cpw_width',
            'cpw_gap'           : 'cpw_gap',
            'cpw_extend'        : '100um',
            'pocket_extent'     : '5um',
            'pocket_rise'       : '65um',
            'loc_W'             : -1,
            'loc_H'             : -1,
                             },
                        },
  'chip'              : 'main',
  'pad_gap'           : '30um',
  'inductor_width'    : '20um',
  'pad_width'         : 'pad_width',
  'pad_height'        : '90um',
  'pocket_width'      : '650um',
  'pocket_height'     : '650um',
  'orientation'       : '0',
  'hfss_wire_bonds'   : False,
  'q3d_wire_bonds'    : False,
  'hfss_inductance'   : '10nH',
  'hfss_capacitance'  : 0,
  'hfss_resistance'   : 0,
  'hfss_mesh_kw_jj'   : 7e-06,
  'q3d_inductance'    : '10nH',
  'q3d_capacitance'   : 0,
  'q3d_resistance'    : 0,
  'q3d_mesh_kw_jj'    : 7e-06,
  'gds_cell_name'     : 'my_other_junction',
module:  qiskit_metal.qlibrary.qubits.transmon_pocket
id:      1
>
[18]:
type(q1.qgeometry_table('poly'))
[18]:
geopandas.geodataframe.GeoDataFrame
[19]:
q1.qgeometry_table('poly')
[19]:
component name geometry layer subtract helper chip fillet
0 1 pad_top POLYGON ((-1.77500 0.01500, -1.22500 0.01500, ... 1 False False main NaN
1 1 pad_bot POLYGON ((-1.77500 -0.10500, -1.22500 -0.10500... 1 False False main NaN
2 1 rect_pk POLYGON ((-1.82500 -0.32500, -1.17500 -0.32500... 1 True False main NaN
3 1 a_connector_pad POLYGON ((-1.35000 0.12000, -1.22500 0.12000, ... 1 False False main NaN
4 1 b_connector_pad POLYGON ((-1.65000 0.12000, -1.77500 0.12000, ... 1 False False main NaN
5 1 c_connector_pad POLYGON ((-1.35000 -0.12000, -1.22500 -0.12000... 1 False False main NaN
6 1 d_connector_pad POLYGON ((-1.65000 -0.12000, -1.77500 -0.12000... 1 False False main NaN
[20]:
# outdated: gui.component_window.model.index(1,0)

For more information, review the Introduction to Quantum Computing and Quantum Hardware lectures below

  • Superconducting Qubits I: Quantizing a Harmonic Oscillator, Josephson Junctions Part 1
Lecture Video Lecture Notes Lab
  • Superconducting Qubits I: Quantizing a Harmonic Oscillator, Josephson Junctions Part 2
Lecture Video Lecture Notes Lab
  • Superconducting Qubits I: Quantizing a Harmonic Oscillator, Josephson Junctions Part 3
Lecture Video Lecture Notes Lab
  • Superconducting Qubits II: Circuit Quantum Electrodynamics, Readout and Calibration Methods Part 1
Lecture Video Lecture Notes Lab
  • Superconducting Qubits II: Circuit Quantum Electrodynamics, Readout and Calibration Methods Part 2
Lecture Video Lecture Notes Lab
  • Superconducting Qubits II: Circuit Quantum Electrodynamics, Readout and Calibration Methods Part 3
Lecture Video Lecture Notes Lab