kqcircuits.util.merge

kqcircuits.util.merge.merge_layers(layout, cell_list, layer_1, layer_2, layer_merged)[source]

Inserts shapes in layer_1 and layer_2 to layer_merged.

Parameters:
  • layout – Layout of the cells

  • cell_list – list of Cells whose shapes are merged (recursively)

  • layer_1 – LayerInfo of the layer to be merged with layer_2

  • layer_2 – LayerInfo of the layer to be merged with layer_1

  • layer_merged – LayerInfo of the layer where the merged shapes are inserted

kqcircuits.util.merge.merge_layout_layers_on_face(layout, cell, face, tolerance=0.004)[source]

Creates “base_metal_gap” layer on given face.

The layer shape is combination of three layers using subtract (-) and insert (+) operations:

“base_metal_gap” = “base_metal_gap_wo_grid” - “base_metal_addition” + “ground_grid”

Parameters:
  • layout – Layout containing the cell

  • cell – Cell to merge

  • face – face dictionary containing layer names as keys and layer info objects as values

  • tolerance – gap length to be ignored while merging (µm)

kqcircuits.util.merge.convert_child_instances_to_static(layout: Layout, cell: Cell, only_elements: bool = True, prune: bool = True)[source]

Convert child instances of a cell to static.

This function avoids duplicating cells: in case there are multiple instances pointing to the same PCell, only one static cell is created and all instances are pointed to that cell. This is in contrast to calling Instance.convert_to_static() on each instance separately.

Parameters:
  • layout – the Layout that contains the cell

  • cell – static cell that may contain PCell instances to be converted

  • only_elements – if True (default), only PCells which are descendants of Element are made static

  • prune – if True, the PCells are deleted if they are no longer used anywhere in the layout.

../_images/kqcircuits.util.merge.png