qiskit_metal.qlibrary.QNLMetal.claw

Claw.

`finger0`   `finger1` 
                 /          / 
            |‾‾‾/‾|    |‾‾‾/‾| 
            | |‾| |    | |‾| | 
            | | | |    | | | | 
            | | | |    | | | | 
            | | |  ‾/‾‾  | | | 
            | |  ‾‾//‾‾‾‾  | | 
            |  ‾‾‾//  |‾‾‾‾  | 
             ‾‾‾‾//| *| |‾‾‾‾
                // |  | | 
`pad_cutout`__ //| |  | | 
               /  ‾ /  ‾
      `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""" Claw. 
 10
 11.. code-block:: 
 12
 13
 14                `finger0`   `finger1` 
 15                    /          / 
 16               |‾‾‾/‾|    |‾‾‾/‾| 
 17               | |‾| |    | |‾| | 
 18               | | | |    | | | | 
 19               | | | |    | | | | 
 20               | | |  ‾/‾‾  | | | 
 21               | |  ‾‾//‾‾‾‾  | | 
 22               |  ‾‾‾//  |‾‾‾‾  | 
 23                ‾‾‾‾//| *| |‾‾‾‾
 24                   // |  | | 
 25   `pad_cutout`__ //| |  | | 
 26                  /  ‾ /  ‾
 27         `pad` __/    /
 28                     /
 29            `cpw` __/
 30"""
 31
 32import numpy as np 
 33from qiskit_metal import draw, Dict 
 34from qiskit_metal.qlibrary.core import QComponent 
 35from qiskit_metal.toolbox_python.utility_functions import rotate_point
 36
 37class Claw(QComponent): 
 38    """ 
 39    Inherits `QComponent` class. 
 40
 41    Description: 
 42        A claw-shaped coupling pad.  
 43
 44    Options: 
 45        * cpw_width: The width of the CPW trace 
 46        * cpw_gap  : The CPW gap of the connected trace 
 47        * base_length: The length (`x`) of the base segment 
 48        * base_width : The width (`y`) of the base segment 
 49        * finger_length: The length (`y`) of the finger measured w.r.t bottom of base 
 50        * finger_width : The width (`x`) of the fingers 
 51        * gap: The substrate gap between the coupling pad and the ground plane 
 52        * cpw_length   : The length of the CPW as measured from the origin (*)
 53        * pos_x/_y: position of the bandage on chip
 54        * orientation : 0-> is parallel to x-axis, with orientation (in degrees) counterclockwise 
 55        * layer   : the layer number for the bandage
 56
 57    """ 
 58
 59    # Default drawing options 
 60    default_options = Dict(
 61        cpw_width='20um', 
 62        cpw_gap='10um', 
 63        base_length='100um', 
 64        base_width='20um',
 65        finger_length='100um', 
 66        finger_width='20um', 
 67        gap='5um', 
 68        cpw_length='30um', 
 69        pos_x='0um', 
 70        pos_y='0um', 
 71        orientation='0', 
 72        layer='1', 
 73    )
 74
 75    # Component metadata
 76    # Name prefix for component, if user doesn't provide name 
 77    component_metadata = Dict( 
 78        short_name='Claw', 
 79        _qgeometry_table_poly='True', 
 80    )
 81
 82    def make(self): 
 83        """ Convert self.options into QGeometry. """ 
 84        p = self.parse_options() 
 85        nodes = Dict() 
 86
 87        # Base section 
 88        base = draw.rectangle(p.base_length, p.base_width) 
 89        base = draw.translate(base, 0, p.base_width/2) 
 90
 91        base_cutout = draw.rectangle(p.base_length + 2*p.cpw_gap, p.base_width + 2*p.cpw_gap) 
 92        base_cutout = draw.translate(base_cutout, 0, p.base_width/2)
 93
 94        # Left and right fingers 
 95        finger = draw.rectangle(p.finger_width, p.finger_length) 
 96        l_fing = draw.translate(finger, (-p.base_length+p.finger_width)/2, p.finger_length/2)
 97        r_fing = draw.translate(finger, (+p.base_length-p.finger_width)/2, p.finger_length/2)
 98
 99        finger_cutout = draw.rectangle(p.finger_width + 2*p.cpw_gap, p.finger_length + 2*p.cpw_gap) 
100        l_fing_cutout = draw.translate(finger_cutout, (-p.base_length+p.finger_width)/2, p.finger_length/2) 
101        r_fing_cutout = draw.translate(finger_cutout, (+p.base_length-p.finger_width)/2, p.finger_length/2)
102
103        # Bottom connecting CPW section 
104        cpw_rect = draw.rectangle(p.cpw_width, p.cpw_length) 
105        cpw_rect = draw.translate(cpw_rect, 0, -p.cpw_length/2) 
106
107        cpw_cutout = draw.rectangle(p.cpw_width + p.cpw_gap*2, p.cpw_length) 
108        cpw_cutout = draw.translate(cpw_cutout, 0, -p.cpw_length/2) 
109
110        # Performing rotations and translations 
111        geom_list = [
112            base, l_fing, r_fing, cpw_rect, 
113            base_cutout, l_fing_cutout, r_fing_cutout, cpw_cutout, 
114        ] 
115        geom_list = draw.rotate(geom_list, p.orientation, origin=(0,0)) 
116        geom_list = draw.translate(geom_list, p.pos_x, p.pos_y) 
117        [
118            base, l_fing, r_fing, cpw_rect, base_cutout, 
119            l_fing_cutout, r_fing_cutout, cpw_cutout,
120        ] = geom_list 
121
122        # Finishing component 
123        claw = draw.union([base, l_fing, r_fing, cpw_rect])
124        cutout = draw.union([base_cutout, l_fing_cutout, r_fing_cutout, cpw_cutout]) 
125        claw = draw.subtract(cutout, claw)
126
127        # Converting to QGeometry
128        self.add_qgeometry('poly', {'Claw': claw}, layer=p.layer) 
129
130        # Positioning nodes 
131        nodes.origin = np.zeros(2) 
132        nodes.pad = nodes.origin + [0, p.base_width] 
133        nodes.pad_cutout = nodes.pad + [0, p.cpw_gap] 
134        nodes.cpw = nodes.origin + [0, -max(p.cpw_length, p.cpw_gap)] 
135        nodes.finger1 = nodes.origin + [+(p.base_length-p.finger_width)/2, p.finger_length] 
136        nodes.finger0 = np.array((-nodes.finger1[0], nodes.finger1[1]))
137
138        # Moving nodes along with component  
139        translation_vec = np.array((p.pos_x, p.pos_y)) 
140        theta = np.deg2rad(p.orientation) 
141
142        for key, point in nodes.items():
143            rotated = rotate_point(point, theta) 
144            nodes[key] = rotated + translation_vec
145
146        self.nodes = nodes 
147        return 
148
149    def node(self, key): 
150        return self.nodes.get(key, None)
class Claw(qiskit_metal.qlibrary.core.base.QComponent):
 38class Claw(QComponent): 
 39    """ 
 40    Inherits `QComponent` class. 
 41
 42    Description: 
 43        A claw-shaped coupling pad.  
 44
 45    Options: 
 46        * cpw_width: The width of the CPW trace 
 47        * cpw_gap  : The CPW gap of the connected trace 
 48        * base_length: The length (`x`) of the base segment 
 49        * base_width : The width (`y`) of the base segment 
 50        * finger_length: The length (`y`) of the finger measured w.r.t bottom of base 
 51        * finger_width : The width (`x`) of the fingers 
 52        * gap: The substrate gap between the coupling pad and the ground plane 
 53        * cpw_length   : The length of the CPW as measured from the origin (*)
 54        * pos_x/_y: position of the bandage on chip
 55        * orientation : 0-> is parallel to x-axis, with orientation (in degrees) counterclockwise 
 56        * layer   : the layer number for the bandage
 57
 58    """ 
 59
 60    # Default drawing options 
 61    default_options = Dict(
 62        cpw_width='20um', 
 63        cpw_gap='10um', 
 64        base_length='100um', 
 65        base_width='20um',
 66        finger_length='100um', 
 67        finger_width='20um', 
 68        gap='5um', 
 69        cpw_length='30um', 
 70        pos_x='0um', 
 71        pos_y='0um', 
 72        orientation='0', 
 73        layer='1', 
 74    )
 75
 76    # Component metadata
 77    # Name prefix for component, if user doesn't provide name 
 78    component_metadata = Dict( 
 79        short_name='Claw', 
 80        _qgeometry_table_poly='True', 
 81    )
 82
 83    def make(self): 
 84        """ Convert self.options into QGeometry. """ 
 85        p = self.parse_options() 
 86        nodes = Dict() 
 87
 88        # Base section 
 89        base = draw.rectangle(p.base_length, p.base_width) 
 90        base = draw.translate(base, 0, p.base_width/2) 
 91
 92        base_cutout = draw.rectangle(p.base_length + 2*p.cpw_gap, p.base_width + 2*p.cpw_gap) 
 93        base_cutout = draw.translate(base_cutout, 0, p.base_width/2)
 94
 95        # Left and right fingers 
 96        finger = draw.rectangle(p.finger_width, p.finger_length) 
 97        l_fing = draw.translate(finger, (-p.base_length+p.finger_width)/2, p.finger_length/2)
 98        r_fing = draw.translate(finger, (+p.base_length-p.finger_width)/2, p.finger_length/2)
 99
100        finger_cutout = draw.rectangle(p.finger_width + 2*p.cpw_gap, p.finger_length + 2*p.cpw_gap) 
101        l_fing_cutout = draw.translate(finger_cutout, (-p.base_length+p.finger_width)/2, p.finger_length/2) 
102        r_fing_cutout = draw.translate(finger_cutout, (+p.base_length-p.finger_width)/2, p.finger_length/2)
103
104        # Bottom connecting CPW section 
105        cpw_rect = draw.rectangle(p.cpw_width, p.cpw_length) 
106        cpw_rect = draw.translate(cpw_rect, 0, -p.cpw_length/2) 
107
108        cpw_cutout = draw.rectangle(p.cpw_width + p.cpw_gap*2, p.cpw_length) 
109        cpw_cutout = draw.translate(cpw_cutout, 0, -p.cpw_length/2) 
110
111        # Performing rotations and translations 
112        geom_list = [
113            base, l_fing, r_fing, cpw_rect, 
114            base_cutout, l_fing_cutout, r_fing_cutout, cpw_cutout, 
115        ] 
116        geom_list = draw.rotate(geom_list, p.orientation, origin=(0,0)) 
117        geom_list = draw.translate(geom_list, p.pos_x, p.pos_y) 
118        [
119            base, l_fing, r_fing, cpw_rect, base_cutout, 
120            l_fing_cutout, r_fing_cutout, cpw_cutout,
121        ] = geom_list 
122
123        # Finishing component 
124        claw = draw.union([base, l_fing, r_fing, cpw_rect])
125        cutout = draw.union([base_cutout, l_fing_cutout, r_fing_cutout, cpw_cutout]) 
126        claw = draw.subtract(cutout, claw)
127
128        # Converting to QGeometry
129        self.add_qgeometry('poly', {'Claw': claw}, layer=p.layer) 
130
131        # Positioning nodes 
132        nodes.origin = np.zeros(2) 
133        nodes.pad = nodes.origin + [0, p.base_width] 
134        nodes.pad_cutout = nodes.pad + [0, p.cpw_gap] 
135        nodes.cpw = nodes.origin + [0, -max(p.cpw_length, p.cpw_gap)] 
136        nodes.finger1 = nodes.origin + [+(p.base_length-p.finger_width)/2, p.finger_length] 
137        nodes.finger0 = np.array((-nodes.finger1[0], nodes.finger1[1]))
138
139        # Moving nodes along with component  
140        translation_vec = np.array((p.pos_x, p.pos_y)) 
141        theta = np.deg2rad(p.orientation) 
142
143        for key, point in nodes.items():
144            rotated = rotate_point(point, theta) 
145            nodes[key] = rotated + translation_vec
146
147        self.nodes = nodes 
148        return 
149
150    def node(self, key): 
151        return self.nodes.get(key, None)

Inherits QComponent class.

Description: A claw-shaped coupling pad.

Options: * cpw_width: The width of the CPW trace * cpw_gap : The CPW gap of the connected trace * base_length: The length (x) of the base segment * base_width : The width (y) of the base segment * finger_length: The length (y) of the finger measured w.r.t bottom of base * finger_width : The width (x) of the fingers * gap: The substrate 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', 'base_length': '100um', 'base_width': '20um', 'finger_length': '100um', 'finger_width': '20um', 'gap': '5um', 'cpw_length': '30um', 'pos_x': '0um', 'pos_y': '0um', 'orientation': '0', 'layer': '1'}

Default drawing options

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

Component metadata

def make(self):
 83    def make(self): 
 84        """ Convert self.options into QGeometry. """ 
 85        p = self.parse_options() 
 86        nodes = Dict() 
 87
 88        # Base section 
 89        base = draw.rectangle(p.base_length, p.base_width) 
 90        base = draw.translate(base, 0, p.base_width/2) 
 91
 92        base_cutout = draw.rectangle(p.base_length + 2*p.cpw_gap, p.base_width + 2*p.cpw_gap) 
 93        base_cutout = draw.translate(base_cutout, 0, p.base_width/2)
 94
 95        # Left and right fingers 
 96        finger = draw.rectangle(p.finger_width, p.finger_length) 
 97        l_fing = draw.translate(finger, (-p.base_length+p.finger_width)/2, p.finger_length/2)
 98        r_fing = draw.translate(finger, (+p.base_length-p.finger_width)/2, p.finger_length/2)
 99
100        finger_cutout = draw.rectangle(p.finger_width + 2*p.cpw_gap, p.finger_length + 2*p.cpw_gap) 
101        l_fing_cutout = draw.translate(finger_cutout, (-p.base_length+p.finger_width)/2, p.finger_length/2) 
102        r_fing_cutout = draw.translate(finger_cutout, (+p.base_length-p.finger_width)/2, p.finger_length/2)
103
104        # Bottom connecting CPW section 
105        cpw_rect = draw.rectangle(p.cpw_width, p.cpw_length) 
106        cpw_rect = draw.translate(cpw_rect, 0, -p.cpw_length/2) 
107
108        cpw_cutout = draw.rectangle(p.cpw_width + p.cpw_gap*2, p.cpw_length) 
109        cpw_cutout = draw.translate(cpw_cutout, 0, -p.cpw_length/2) 
110
111        # Performing rotations and translations 
112        geom_list = [
113            base, l_fing, r_fing, cpw_rect, 
114            base_cutout, l_fing_cutout, r_fing_cutout, cpw_cutout, 
115        ] 
116        geom_list = draw.rotate(geom_list, p.orientation, origin=(0,0)) 
117        geom_list = draw.translate(geom_list, p.pos_x, p.pos_y) 
118        [
119            base, l_fing, r_fing, cpw_rect, base_cutout, 
120            l_fing_cutout, r_fing_cutout, cpw_cutout,
121        ] = geom_list 
122
123        # Finishing component 
124        claw = draw.union([base, l_fing, r_fing, cpw_rect])
125        cutout = draw.union([base_cutout, l_fing_cutout, r_fing_cutout, cpw_cutout]) 
126        claw = draw.subtract(cutout, claw)
127
128        # Converting to QGeometry
129        self.add_qgeometry('poly', {'Claw': claw}, layer=p.layer) 
130
131        # Positioning nodes 
132        nodes.origin = np.zeros(2) 
133        nodes.pad = nodes.origin + [0, p.base_width] 
134        nodes.pad_cutout = nodes.pad + [0, p.cpw_gap] 
135        nodes.cpw = nodes.origin + [0, -max(p.cpw_length, p.cpw_gap)] 
136        nodes.finger1 = nodes.origin + [+(p.base_length-p.finger_width)/2, p.finger_length] 
137        nodes.finger0 = np.array((-nodes.finger1[0], nodes.finger1[1]))
138
139        # Moving nodes along with component  
140        translation_vec = np.array((p.pos_x, p.pos_y)) 
141        theta = np.deg2rad(p.orientation) 
142
143        for key, point in nodes.items():
144            rotated = rotate_point(point, theta) 
145            nodes[key] = rotated + translation_vec
146
147        self.nodes = nodes 
148        return 

Convert self.options into QGeometry.

def node(self, key):
150    def node(self, key): 
151        return self.nodes.get(key, None)