{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Simple CPW Meander\n", "\n", "We'll be creating a 2D design and adding a meandered resonator QComponent. \n", "Will use component called OpenToGround for termination of resonators.\n", "\n", "Simple RouteMeander resonator object will be shown. \n", "\n", "RouteMeander: Implements a simple CPW, with a single meander. \n", "OpenToGround: A basic open to ground termination. Functions as a pin for auto drawing." ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "# For convenience, let's begin by enabling\n", "# automatic reloading of modules when they change.\n", "%load_ext autoreload\n", "%autoreload 2" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "import qiskit_metal as metal\n", "from qiskit_metal import designs, draw\n", "from qiskit_metal import MetalGUI, Dict, Headings" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [], "source": [ "# Each time you create a new quantum circuit design, \n", "# you start by instantiating a QDesign class. \n", "\n", "# The design class `DesignPlanar` is best for 2D circuit designs.\n", "design = designs.DesignPlanar()\n", "gui = MetalGUI(design)" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [], "source": [ "from qiskit_metal.qlibrary.terminations.open_to_ground import OpenToGround\n", "from qiskit_metal.qlibrary.tlines.meandered import RouteMeander" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{'pin_inputs': {'start_pin': {'component': '', 'pin': ''},\n", " 'end_pin': {'component': '', 'pin': ''}},\n", " 'fillet': '0',\n", " 'lead': {'start_straight': '0mm',\n", " 'end_straight': '0mm',\n", " 'start_jogged_extension': '',\n", " 'end_jogged_extension': ''},\n", " 'total_length': '7mm',\n", " 'chip': 'main',\n", " 'layer': '1',\n", " 'trace_width': 'cpw_width',\n", " 'meander': {'spacing': '200um', 'asymmetry': '0um'},\n", " 'snap': 'true',\n", " 'prevent_short_edges': 'true'}" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Be aware of the default_options that can be overridden by user.\n", "RouteMeander.get_template_options(design)" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{'width': '10um',\n", " 'gap': '6um',\n", " 'termination_gap': '6um',\n", " 'pos_x': '0um',\n", " 'pos_y': '0um',\n", " 'orientation': '0',\n", " 'chip': 'main',\n", " 'layer': '1'}" ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Be aware of the default_options that can be overridden by user.\n", "OpenToGround.get_template_options(design)" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [], "source": [ "# To force overwrite a QComponent with an existing name. \n", "# This is useful when re-running cells in a notebook. \n", "design.overwrite_enabled = True" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "A RouteMeander connector are shown. The terminations are open-to-ground. \n", "\n", "The pin_inputs is the default dictionary for passing pins into a component, **BUT** how the dictionary is structured is component dependent. Using the below structure (eg. start_pin, end_pin) is suggested for any 2 port type connection, but you should always check the documentation for the specific component you are wanting to use." ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [], "source": [ "open_start_options = Dict(pos_x='1000um',\n", " pos_y='0um',\n", " orientation = '-90')\n", "\n", "open_start_meander = OpenToGround(design,'Open_meander_start',options=open_start_options)\n", "\n", "\n", "\n", "\n", "\n", "open_end_options = Dict(pos_x='1000um',\n", " pos_y='1500um',\n", " orientation='90',\n", " termination_gap='10um')\n", "\n", "open_end_meander = OpenToGround(design,'Open_meander_end',options=open_end_options)" ] }, { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [], "source": [ "meander_options = Dict(pin_inputs=Dict(start_pin=Dict(\n", " component='Open_meander_start',\n", " pin='open'),\n", " end_pin=Dict(\n", " component='Open_meander_end',\n", " pin='open')\n", " ),\n", " total_length='9mm',\n", " fillet='99.99um')\n", "\n", "testMeander = RouteMeander(design,'meanderTest',options=meander_options)\n", "gui.rebuild()\n", "gui.autoscale()\n", "gui.zoom_on_components([testMeander.name, open_start_meander.name, open_end_meander.name]) " ] }, { "cell_type": "code", "execution_count": 10, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "\u001b[95m\u001b[1mname: \u001b[94m\u001b[1mmeanderTest\u001b[0m\n", "\u001b[95m\u001b[1mclass: \u001b[94m\u001b[1mRouteMeander \u001b[0m\n", "\u001b[95m\u001b[1moptions: \u001b[0m\n", " \u001b[1m'pin_inputs' \u001b[0m: {\n", " \u001b[1m'start_pin' \u001b[0m: {\n", " 'component' : 'Open_meander_start', \n", " 'pin' : 'open', \n", " },\n", " \u001b[1m'end_pin' \u001b[0m: {\n", " 'component' : 'Open_meander_end', \n", " 'pin' : 'open', \n", " },\n", " },\n", " 'fillet' : '99.99um', \n", " \u001b[1m'lead' \u001b[0m: {\n", " 'start_straight' : '0mm', \n", " 'end_straight' : '0mm', \n", " 'start_jogged_extension': '', \n", " 'end_jogged_extension': '', \n", " },\n", " 'total_length' : '9mm', \n", " 'chip' : 'main', \n", " 'layer' : '1', \n", " 'trace_width' : 'cpw_width', \n", " \u001b[1m'meander' \u001b[0m: {\n", " 'spacing' : '200um', \n", " 'asymmetry' : '0um', \n", " },\n", " 'snap' : 'true', \n", " 'prevent_short_edges': 'true', \n", " 'trace_gap' : 'cpw_gap', \n", " '_actual_length' : '9.0 mm', \n", "\u001b[95m\u001b[1mmodule: \u001b[94m\u001b[1mqiskit_metal.qlibrary.tlines.meandered\u001b[0m\n", "\u001b[95m\u001b[1mid: \u001b[94m\u001b[1m3\u001b[0m" ] }, "execution_count": 10, "metadata": {}, "output_type": "execute_result" } ], "source": [ "#Let's see what the testMeander object looks like\n", "testMeander #print meanderTest information" ] }, { "cell_type": "code", "execution_count": 11, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "\u001b[95m\u001b[1mname: \u001b[94m\u001b[1mOpen_meander_start\u001b[0m\n", "\u001b[95m\u001b[1mclass: \u001b[94m\u001b[1mOpenToGround \u001b[0m\n", "\u001b[95m\u001b[1moptions: \u001b[0m\n", " 'width' : '10um', \n", " 'gap' : '6um', \n", " 'termination_gap' : '6um', \n", " 'pos_x' : '1000um', \n", " 'pos_y' : '0um', \n", " 'orientation' : '0', \n", " 'chip' : 'main', \n", " 'layer' : '1', \n", " 'orientation' : '-90', \n", "\u001b[95m\u001b[1mmodule: \u001b[94m\u001b[1mqiskit_metal.qlibrary.terminations.open_to_ground\u001b[0m\n", "\u001b[95m\u001b[1mid: \u001b[94m\u001b[1m1\u001b[0m" ] }, "execution_count": 11, "metadata": {}, "output_type": "execute_result" } ], "source": [ "#Let's see what the open_start_meander object looks like\n", "open_start_meander #print Open_meander_start information" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We can also see what active connections there are from the netlist. Pins that share the same net_id indicate they are connected. Pins that are not on the net list are currently open." ] }, { "cell_type": "code", "execution_count": 12, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
| \n", " | net_id | \n", "component_id | \n", "pin_name | \n", "
|---|---|---|---|
| 0 | \n", "3 | \n", "1 | \n", "open | \n", "
| 1 | \n", "3 | \n", "3 | \n", "start | \n", "
| 2 | \n", "4 | \n", "2 | \n", "open | \n", "
| 3 | \n", "4 | \n", "3 | \n", "end | \n", "