qiskit_metal.qlibrary.QNLMetal.couplingpad

CouplingPad.

`pad` 
                                 /
 _______________________________/__________________________
|                              /                           |
| |‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾| | 
| |                                                      | | 
| |_________________________  * _________________________| | 
|                           |  |                           |
 ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾| |  | |‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾   
                          | |  | | 
                           ‾ /  ‾
                           `cpw`
  1# This code was written by Deval Deliwala.
  2# 
  3# This code is to be used by QNL. 
  4# 
  5# Any modifications or derivative works of this code must retain this 
  6# notice, and modified files need to carry a notice indicating 
  7# that they have been altered from the originals. 
  8
  9""" CouplingPad. 
 10
 11.. code-block:: 
 12
 13                                        `pad` 
 14                                         /
 15         _______________________________/__________________________
 16        |                              /                           |
 17        | |‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾| | 
 18        | |                                                      | | 
 19        | |_________________________  * _________________________| | 
 20        |                           |  |                           |
 21         ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾| |  | |‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾   
 22                                  | |  | | 
 23                                   ‾ /  ‾
 24                                   `cpw` 
 25""" 
 26
 27import numpy as np 
 28from qiskit_metal import draw, Dict 
 29from qiskit_metal.qlibrary.core import QComponent 
 30from qiskit_metal.toolbox_python.utility_functions import rotate_point
 31
 32class CouplingPad(QComponent): 
 33    """ 
 34    Inherits `QComponent` Class. 
 35
 36    Description: 
 37        A coupling pad. 
 38
 39    Options: 
 40        * cpw_width : The width of the CPW trace connected to the coupling pad 
 41        * cpw.gap   : The CPW gap of the trace connected to the coupling pad 
 42        * pad_length: The length (`y`) of the coupling pad 
 43        * pad_width : The width (`x`) of the coupling pad 
 44        * gap: The gap between the coupling pad and the ground plane 
 45        * cpw_length: The length of the CPW as measured from the origin 
 46        * pos_x/_y: position of the bandage on chip
 47        * orientation : 0-> is parallel to x-axis, with orientation (in degrees) counterclockwise 
 48        * layer   : the layer number for the bandage
 49
 50    """ 
 51
 52    # Default drawing options 
 53    default_options = Dict(
 54        cpw_width   ='20um', 
 55        cpw_gap     ='10um', 
 56        pad_length  ='300um', 
 57        pad_width   ='20um',
 58        gap         ='5um', 
 59        cpw_length  ='50um', 
 60        pos_x       ='0um', 
 61        pos_y       ='0um', 
 62        orientation ='0', 
 63        layer       ='1', 
 64    )
 65
 66    # Component metadata
 67    # Name prefix for component, if user doesn't provide name 
 68    component_metadata = Dict( 
 69        short_name='CouplingPad', 
 70        _qgeometry_table_poly='True', 
 71    )
 72
 73    def make(self): 
 74        """ Converts self.options into QGeometry. """ 
 75        p = self.parse_options() 
 76        nodes = Dict() 
 77
 78        # Encompassing cutout 
 79        cutout = draw.rectangle(p.pad_length + 2*p.gap, p.pad_width + 2*p.gap)
 80        cutout = draw.translate(cutout, 0, +p.pad_width/2) 
 81
 82        # Inner pad gap 
 83        pad = draw.rectangle(p.pad_length, p.pad_width) 
 84        pad = draw.translate(pad, 0, +p.pad_width/2) 
 85
 86        # Encompassing cpw 
 87        cpw_cutout = draw.rectangle(p.cpw_width + 2*p.gap, p.cpw_length) 
 88        cpw_cutout = draw.translate(cpw_cutout, 0, -p.cpw_length/2)
 89
 90        # CPW gap, 1e-10 to avoid rendering issues
 91        cpw = draw.rectangle(p.cpw_width, p.cpw_length+1e-10) 
 92        cpw = draw.translate(cpw, 0, -p.cpw_length/2) 
 93
 94        # Translations \& Rotations 
 95        geom_list = [cutout, pad, cpw_cutout, cpw] 
 96        geom_list = draw.rotate(geom_list, p.orientation, origin=(0, 0)) 
 97        geom_list = draw.translate(geom_list, p.pos_x, p.pos_y) 
 98        [cutout, pad, cpw_cutout, cpw] = geom_list 
 99
100        # Combining components 
101        coupling_pad = draw.union([pad, cpw]) 
102        coupling_cut = draw.union([cutout, cpw_cutout]) 
103        coupling_pad = draw.subtract(coupling_cut, coupling_pad) 
104
105        # Converting to QGeometry
106        self.add_qgeometry('poly', {'CouplingPad': coupling_pad}, layer=p.layer) 
107
108        # Positioning nodes 
109        nodes.origin = np.zeros(2) 
110        nodes.cpw = nodes.origin + [0, -max(p.gap, p.cpw_length)] 
111        nodes.pad = nodes.origin + [0, p.pad_width] 
112
113        # Moving nodes along with component  
114        translation_vec = np.array((p.pos_x, p.pos_y)) 
115        theta = np.deg2rad(p.orientation) 
116
117        for key, point in nodes.items():
118            rotated = rotate_point(point, theta) 
119            nodes[key] = rotated + translation_vec
120
121        self.nodes = nodes 
122        return 
123
124    def node(self, key): 
125        return self.nodes.get(key, None) 
class CouplingPad(qiskit_metal.qlibrary.core.base.QComponent):
 33class CouplingPad(QComponent): 
 34    """ 
 35    Inherits `QComponent` Class. 
 36
 37    Description: 
 38        A coupling pad. 
 39
 40    Options: 
 41        * cpw_width : The width of the CPW trace connected to the coupling pad 
 42        * cpw.gap   : The CPW gap of the trace connected to the coupling pad 
 43        * pad_length: The length (`y`) of the coupling pad 
 44        * pad_width : The width (`x`) of the coupling pad 
 45        * gap: The gap between the coupling pad and the ground plane 
 46        * cpw_length: The length of the CPW as measured from the origin 
 47        * pos_x/_y: position of the bandage on chip
 48        * orientation : 0-> is parallel to x-axis, with orientation (in degrees) counterclockwise 
 49        * layer   : the layer number for the bandage
 50
 51    """ 
 52
 53    # Default drawing options 
 54    default_options = Dict(
 55        cpw_width   ='20um', 
 56        cpw_gap     ='10um', 
 57        pad_length  ='300um', 
 58        pad_width   ='20um',
 59        gap         ='5um', 
 60        cpw_length  ='50um', 
 61        pos_x       ='0um', 
 62        pos_y       ='0um', 
 63        orientation ='0', 
 64        layer       ='1', 
 65    )
 66
 67    # Component metadata
 68    # Name prefix for component, if user doesn't provide name 
 69    component_metadata = Dict( 
 70        short_name='CouplingPad', 
 71        _qgeometry_table_poly='True', 
 72    )
 73
 74    def make(self): 
 75        """ Converts self.options into QGeometry. """ 
 76        p = self.parse_options() 
 77        nodes = Dict() 
 78
 79        # Encompassing cutout 
 80        cutout = draw.rectangle(p.pad_length + 2*p.gap, p.pad_width + 2*p.gap)
 81        cutout = draw.translate(cutout, 0, +p.pad_width/2) 
 82
 83        # Inner pad gap 
 84        pad = draw.rectangle(p.pad_length, p.pad_width) 
 85        pad = draw.translate(pad, 0, +p.pad_width/2) 
 86
 87        # Encompassing cpw 
 88        cpw_cutout = draw.rectangle(p.cpw_width + 2*p.gap, p.cpw_length) 
 89        cpw_cutout = draw.translate(cpw_cutout, 0, -p.cpw_length/2)
 90
 91        # CPW gap, 1e-10 to avoid rendering issues
 92        cpw = draw.rectangle(p.cpw_width, p.cpw_length+1e-10) 
 93        cpw = draw.translate(cpw, 0, -p.cpw_length/2) 
 94
 95        # Translations \& Rotations 
 96        geom_list = [cutout, pad, cpw_cutout, cpw] 
 97        geom_list = draw.rotate(geom_list, p.orientation, origin=(0, 0)) 
 98        geom_list = draw.translate(geom_list, p.pos_x, p.pos_y) 
 99        [cutout, pad, cpw_cutout, cpw] = geom_list 
100
101        # Combining components 
102        coupling_pad = draw.union([pad, cpw]) 
103        coupling_cut = draw.union([cutout, cpw_cutout]) 
104        coupling_pad = draw.subtract(coupling_cut, coupling_pad) 
105
106        # Converting to QGeometry
107        self.add_qgeometry('poly', {'CouplingPad': coupling_pad}, layer=p.layer) 
108
109        # Positioning nodes 
110        nodes.origin = np.zeros(2) 
111        nodes.cpw = nodes.origin + [0, -max(p.gap, p.cpw_length)] 
112        nodes.pad = nodes.origin + [0, p.pad_width] 
113
114        # Moving nodes along with component  
115        translation_vec = np.array((p.pos_x, p.pos_y)) 
116        theta = np.deg2rad(p.orientation) 
117
118        for key, point in nodes.items():
119            rotated = rotate_point(point, theta) 
120            nodes[key] = rotated + translation_vec
121
122        self.nodes = nodes 
123        return 
124
125    def node(self, key): 
126        return self.nodes.get(key, None) 

Inherits QComponent Class.

Description: A coupling pad.

Options: * cpw_width : The width of the CPW trace connected to the coupling pad * cpw.gap : The CPW gap of the trace connected to the coupling pad * pad_length: The length (y) of the coupling pad * pad_width : The width (x) of the coupling pad * gap: The gap between the coupling pad and the ground plane * cpw_length: The length of the CPW as measured from the origin * pos_x/_y: position of the bandage on chip * orientation : 0-> is parallel to x-axis, with orientation (in degrees) counterclockwise * layer : the layer number for the bandage

default_options = {'cpw_width': '20um', 'cpw_gap': '10um', 'pad_length': '300um', 'pad_width': '20um', 'gap': '5um', 'cpw_length': '50um', 'pos_x': '0um', 'pos_y': '0um', 'orientation': '0', 'layer': '1'}

Default drawing options

component_metadata = {'short_name': 'CouplingPad', '_qgeometry_table_poly': 'True'}

Component metadata

def make(self):
 74    def make(self): 
 75        """ Converts self.options into QGeometry. """ 
 76        p = self.parse_options() 
 77        nodes = Dict() 
 78
 79        # Encompassing cutout 
 80        cutout = draw.rectangle(p.pad_length + 2*p.gap, p.pad_width + 2*p.gap)
 81        cutout = draw.translate(cutout, 0, +p.pad_width/2) 
 82
 83        # Inner pad gap 
 84        pad = draw.rectangle(p.pad_length, p.pad_width) 
 85        pad = draw.translate(pad, 0, +p.pad_width/2) 
 86
 87        # Encompassing cpw 
 88        cpw_cutout = draw.rectangle(p.cpw_width + 2*p.gap, p.cpw_length) 
 89        cpw_cutout = draw.translate(cpw_cutout, 0, -p.cpw_length/2)
 90
 91        # CPW gap, 1e-10 to avoid rendering issues
 92        cpw = draw.rectangle(p.cpw_width, p.cpw_length+1e-10) 
 93        cpw = draw.translate(cpw, 0, -p.cpw_length/2) 
 94
 95        # Translations \& Rotations 
 96        geom_list = [cutout, pad, cpw_cutout, cpw] 
 97        geom_list = draw.rotate(geom_list, p.orientation, origin=(0, 0)) 
 98        geom_list = draw.translate(geom_list, p.pos_x, p.pos_y) 
 99        [cutout, pad, cpw_cutout, cpw] = geom_list 
100
101        # Combining components 
102        coupling_pad = draw.union([pad, cpw]) 
103        coupling_cut = draw.union([cutout, cpw_cutout]) 
104        coupling_pad = draw.subtract(coupling_cut, coupling_pad) 
105
106        # Converting to QGeometry
107        self.add_qgeometry('poly', {'CouplingPad': coupling_pad}, layer=p.layer) 
108
109        # Positioning nodes 
110        nodes.origin = np.zeros(2) 
111        nodes.cpw = nodes.origin + [0, -max(p.gap, p.cpw_length)] 
112        nodes.pad = nodes.origin + [0, p.pad_width] 
113
114        # Moving nodes along with component  
115        translation_vec = np.array((p.pos_x, p.pos_y)) 
116        theta = np.deg2rad(p.orientation) 
117
118        for key, point in nodes.items():
119            rotated = rotate_point(point, theta) 
120            nodes[key] = rotated + translation_vec
121
122        self.nodes = nodes 
123        return 

Converts self.options into QGeometry.

def node(self, key):
125    def node(self, key): 
126        return self.nodes.get(key, None)