class kqcircuits.elements.waveguide_composite.Node(position, element=None, inst_name=None, align=(), angle=None, length_before=None, length_increment=None, **params)[source]

Bases: object

Specifies a single node of a composite waveguide.

Node is as a position and optionally other parameters. The element argument sets an Element type that gets inserted in the waveguide. Typically this is an Airbridge, but any element with port_a and port_b is supported.

  • position – The location of the Node. Represented as a DPoint object.

  • element – The Element type that gets inserted in the waveguide. None by default.

  • inst_name – If an instance name is supplied, the element refpoints will be exposed with that name. Default None.

  • align – Tuple with two refpoint names that correspond the input and output point of element, respectively Default value (None) uses ('port_a', 'port_b')

  • angle – Angle of waveguide direction in degrees

  • length_before – Length of the waveguide segment before this node

  • length_increment – Waveguide length increment produced by meander before this node

  • **params – Other optional parameters for the inserted element


A Node.

position: klayout.dbcore.DPoint
element: kqcircuits.elements.element.Element
align: Tuple
inst_name: str
angle: float
length_before: float
length_increment: float
classmethod deserialize(node)[source]

Create a Node object from a serialized form, such that from_serialized(ast.literal_eval(str(node_object))) returns an equivalent copy of node_obj.


node – serialized node, consisting of a tuple (x, y, element_name, params), where x and y are the node coordinates. The string element_name and dict params are optional.

Returns: a Node

static nodes_from_string(nodes)[source]

Converts the human readable text representation of Nodes to an actual Node object list.

Needed for storage in KLayout parameters. The string has to conform to a specific format: (x, y, class_str, parameter_dict). For example (0, 500, ‘Airbridge’, {‘n_bridges’: 2}), see also the Node.__str__ method. Empty class_str or parameter_dict may be omitted.


list of Node objects

class kqcircuits.elements.waveguide_composite.WaveguideComposite[source]

Bases: kqcircuits.elements.element.Element

A composite waveguide made of waveguides and other elements.

From the user’s perspective this is a WaveguideCoplanar that is extended with Airbridge, WaveguideCoplanarTaper and FlipChipConnector, so that a signal can be routed over other waveguides and several chip faces. As a bonus feature other arbitrary elements like coplanar capacitors are also supported.

A list of Nodes defines the shape of the waveguide. An empty node, i.e. Node.element is None, will set the next “waypoint” of the waveguide. If an Element is given it will be placed on the node, except for the first or last node where it will be adjacent to the edge.

Inserted elements are oriented collinear with the previous node. If the following node is not collinear with the previous element then for convenience an automatic bend is inserted in the waveguide. Note that back-to-back elements (i.e. without some empty Nodes in between) should only be placed collinear with each other.

Node parameters will be passed to the element. For convenience, empty nodes may also have parameters: a, b or face_id. They insert a WaveguideCoplanarTaper or a FlipChipConnector, respectively and change the defaults too.

The ab_across=True parameter places a single airbridge across the node. The n_bridges=N parameter puts N airbridges evenly distributed across the preceding edge.

The length_before parameter of a node can be specified to automatically set the length of the waveguide between that node and the previous one. It will in fact create a Meander element instead of a normal waveguide between those nodes to achieve the correct length. Alternative parameter length_increment sets the waveguide length increment compared to normal waveguide.

A notable implementation detail is that every Airbridge (sub)class is done as AirbridgeConnection. This way a waveguide taper is automatically inserted before and after the airbridge so the user does not have to manually add these. Other Node types do not have this feature.

A WaveguideComposite cell has a method segment_lengths that returns a list of lengths of each individual regular waveguide segment. Segments are bounded by any element that is not a standard waveguide, such as Airbridge, flip chip, taper or any custom element.

For examples see the test_waveguide_composite.lym script.

classmethod create(layout, library=None, **parameters)[source]

Create cell for this element in layout.

  • layout – pya.Layout object where this cell is created

  • library – LIBRARY_NAME of the calling PCell instance

  • **parameters – PCell parameters for the element as keyword arguments


default implementation


Produce the composite waveguide.

In practice this becomes an alternating chain of WaveguideCoplanar and some other Element subclass. Elements are oriented collinear to the preceding Node and an automatic bend is inserted after if the next Node is not collinear.

kqcircuits.elements.waveguide_composite.produce_fixed_length_bend(element, target_len, point_a, point_a_corner, point_b, point_b_corner, bridges)[source]

Inserts a waveguide bend with the given length to the chip.

  • element – The element to which the waveguide is inserted

  • target_len – Target length of the waveguide

  • point_a – Endpoint 1 of the waveguide

  • point_a_corner – Point towards which the waveguide goes from endpoint 1

  • point_b – Endpoint 2 of the waveguide

  • point_b_corner – Point towards which the waveguide goes from endpoint 2

  • bridges – String determining where airbridges are created, “no” | “middle” | “middle and ends”


Instance of the created waveguide


ValueError, if a bend with the given target length and points cannot be created.

PCell parameters:

  • nodes (String) - List of Nodes for the waveguide, default=(0, 0, 'Airbridge'), (200, 0)

  • gui_path (Shape) - Path for editing the waveguide in the KLayout GUI, default=(0,0;200,0) w=1 bx=0 ex=0 r=false

  • gui_path_shadow (Shape) - Hidden path to detect GUI operations, default=(0,0;200,0) w=1 bx=0 ex=0 r=false

  • tight_routing (Boolean) - Tight routing for corners, default=False

  • term1 (Double) - Termination length start, default=0, unit=μm

  • term2 (Double) - Termination length end, default=0, unit=μm

  • a (Double) - Width of center conductor, default=10, unit=μm

  • b (Double) - Width of gap, default=6, unit=μm

  • n (Int) - Number of points on turns, default=64

  • r (Double) - Turn radius, default=100, unit=μm

  • margin (Double) - Margin of the protection layer, default=5, unit=μm

  • face_ids (List) - Chip face IDs, list of b | t | c, default=['b', 't', 'c']

  • display_name (String) - Name displayed in GUI (empty for default), default=

  • protect_opposite_face (Boolean) - Add opposite face protection too, default=False

  • ubm_diameter (Double) - Under-bump metalization diameter, default=40, unit=μm

  • bump_diameter (Double) - Bump diameter, default=25, unit=μm

  • connector_type (String) - Connector type, default=Coax, choices=['Single', 'GSG', 'Coax']

  • inter_bump_distance (Double) - Distance between In bumps, default=100, unit=μm

  • output_rotation (Double) - Rotation of output port w.r.t. input port, default=180, unit=degrees

  • connector_a (Double) - Conductor width at the connector area, default=40, unit=μm

  • connector_b (Double) - Gap width at the connector area, default=40, unit=μm

  • round_connector (Boolean) - Use round connector shape, default=False

  • n_center_bumps (Int) - Number of center bumps in series, default=1

  • airbridge_type (String) - Airbridge type, default=Airbridge Rectangular, choices=['Airbridge Rectangular', 'Airbridge Multi Face']

  • taper_length (Double) - Taper length, default=100, unit=μm