Source code for qiskit_metal.qlibrary.sample_shapes.circle_raster
# -*- coding: utf-8 -*-# This code is part of Qiskit.## (C) Copyright IBM 2017, 2021.## This code is licensed under the Apache License, Version 2.0. You may# obtain a copy of this license in the LICENSE.txt file in the root directory# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.## Any modifications or derivative works of this code must retain this# copyright notice, and modified files need to carry a notice indicating# that they have been altered from the originals."""This is the CircleCaterpillar module."""fromqiskit_metalimportdraw,Dict# , QComponentfromqiskit_metal.qlibrary.coreimportQComponent#from qiskit_metal import is_truefromshapely.geometryimportCAP_STYLE,JOIN_STYLE
[docs]defmake(self):"""The make function implements the logic that creates the geometry (poly, path, etc.) from the qcomponent.options dictionary of parameters, and the adds them to the design, using qcomponent.add_qgeometry(...), adding in extra needed information, such as layer, subtract, etc."""p=self.p# p for parsed parameters. Access to the parsed options.# create the geometrycircle=draw.Point(p.pos_x,p.pos_y).buffer(p.radius,resolution=int(p.resolution),cap_style=getattr(CAP_STYLE,p.cap_style),#join_style = getattr(JOIN_STYLE, p.join_style))# add qgeometryself.add_qgeometry('poly',{'circle':circle},subtract=p.subtract,helper=p.helper,layer=p.layer,chip=p.chip)