<jupyter_start><jupyter_text>Star shaped qubitWe'll be creating a 2D design and adding a star shaped qubit QComponent.There's a central star shaped component. This component is essentially a circle with trpezoids subtracted from it. A T-junction qubit is attached to this central shape. Then there are four coupling resonators and one readout resonator present in the default setting. The shape of the central component and the number coupling resonators are customizable. Let's try out a few diferent ways to create and render this component.<jupyter_code># So, let us dive right in. For convenience, let's begin by enabling
# automatic reloading of modules when they change.
%load_ext autoreload
%autoreload 2<jupyter_output><empty_output><jupyter_text>Next, we import the relevant modules. You can add new modules as and when needed.<jupyter_code>import qiskit_metal as metal
import numpy as np
from math import *
from qiskit_metal import designs, draw, Dict
from qiskit_metal.qlibrary.core import BaseQubit, QComponent<jupyter_output><empty_output><jupyter_text>Next we import the GUI<jupyter_code>from qiskit_metal import MetalGUI<jupyter_output><empty_output><jupyter_text>A QDesign class must be instantiated each time a new quantum circuit design is created. The design class `DesignPlanar` is best for 2D circuit designs.<jupyter_code>design = designs.DesignPlanar()
gui = MetalGUI(design)
gui.rebuild()<jupyter_output><empty_output><jupyter_text>A Star QubitYou can create a ready-made star qubit from the QComponent Library, qiskit_metal.qlibrary.qubits. star_qubit.py is the file containing our qubit so StarQubit is the module we import.<jupyter_code>from qiskit_metal.qlibrary.qubits.star_qubit import StarQubit
# The following default_options can be overridden by user.
StarQubit.get_template_options(design)
# To force overwrite a QComponent with an existing name.  
# This is useful when re-running cells in a notebook. 
design.overwrite_enabled = True<jupyter_output><empty_output><jupyter_text>Let us place the qubit at (x,y) =(5,5), and change the default rotation values. As this design is meant to have up to 5 contacts including one readout and up to 4 coupling resonators, these angles should be 72 degrees apart. However, the number of connectors may be changed to any value between 0 and 4.<jupyter_code>qubit_options = dict(
    pos_x = '5um',
    pos_y = '5um',  
    number_of_connectors = 4 # Change the number of connectors
)

# Create a new Concentric Transmon object with name 'Q1' 
q1 = StarQubit(design, 'Star', options=qubit_options)

gui.rebuild()  # rebuild the design and plot 
gui.autoscale() #resize GUI to see QComponent
gui.zoom_on_components(['Star']) #Can also gui.zoom_on_components([q1.name])
#Let's see what the Q1 object looks like

q1 #print Q1 information
#Save screenshot as a .png formatted file.
gui.screenshot()
# Screenshot the canvas only as a .png formatted file.
gui.figure.savefig('shot.png')

from IPython.display import Image, display
_disp_ops = dict(width=500)
display(Image('shot.png', **_disp_ops))<jupyter_output><empty_output><jupyter_text>Closing the Qiskit Metal GUI<jupyter_code>gui.main_window.close()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.06899781454886045, 'fraction_numerical': 0.007180768029971901, 'mean_word_length': 5.846153846153846, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 29, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '7', 'dir': 'jupyter-structured-clean-dedup', 'id': '466960', 'license': 'Apache-2.0', 'n_tokens_mistral': 1002, 'n_tokens_neox': 952, 'n_words': 372, 'path': 'docs/circuit-examples/A.Qubits/11-Star_shaped_qubit.ipynb', 'repo_name': 'camponogaraviera/qiskit-metal', 'size': '3203'}