MakeGDS
- class MakeGDS(design, threshold: float = 1e-09, precision: float = 1e-09, curve_resolution: int = 22, smooth_radius: float = 0, export_type: str = 'all', export_layers: list[int] = [], print_statements: bool = False)
Bases:
objectClass to export a Qiskit-Metal design into GDS.
- Parameters:
design (QDesign) – The QiskitMetal design object
fuse_threshold (float) – The smallest feature crack that can exist; anything smaller will get sealed together. This is to help remove artefacts from floating-point inaccuracies. It is given in metres and defaults to 1e-9.
precision (float) – The GDS granularity/precision given in metres (defaults to 1e-9).
curve_resolution (int) – Number of vertices to use on a path fillet; that is, number of points over a quarter arc. Default value is 22.
smooth_radius (float) – The radius to use upon applying a final postprocessing step to round off all corners into smooth bends. The default value is 0, in which case no rounding is performed.
export_type (str) –
Select which layers to export (default is
'all'):'all'(exports positive and negative patterns and GND plane as seperate layers),'positive'(exports flattened metals to layer 0), or'negative'(exports negative flattened metals to layer 0)
export_layers (list[int]) – Layers to export given as a list of integers or single integer (WIP). Default is an empty list in which case all layers are exported.
print_statements (bool) – Print debug/status messages when exporting. Default value is False.
- add_boolean_layer(layer1_ind: int, layer2_ind: int, operation: str, output_layer: int = None)
Perform a boolean operation on the polygonal components across two layers.
- Parameters:
layer1_ind (int) – Index of first layer
layer2_ind (int) – Index of second layer
operation (str) – Boolean operation to perform over the two layers. It can be:
"and","or","xor","not"output_layer (int) – If an integer is given here, the result of the boolean operation is written into this layer (creating one if it does not exist). Default value is None, in which case, the layer is automatically created by taking an integer one above the largest index thus far.
- Returns:
output_layer – Integer index of the layer containing the result of the boolean operation.
- Return type:
int
- add_text(text_label: str = '', layer: int = 0, size: int = 300, position=None)
Add a text label to the gds export on a given layer at a given position.
- Parameters:
text_label (str) – Text label to add
layer (int) – Layer number to export the text to (defaults to layer 0)
size (str) – Text size in GDS Units (default value is 300)
position (tuple) – Tuple containing position (normalised to 1); e.g. (0,0) is bottom left, (1,1) is top right.
- delete_layers(layers_to_remove: list[int])
Delete a list of layers.
- Parameters:
layers_to_remove (list[int]) – Layers to remove given as a list of integers.
- export(file_name: str, export_type=None, export_layers=None)
Perform the final export to write to the GDS file.
- Parameters:
file_name (str) – File path to the exported GDS file output.
export_type (str) –
Select which layers to export (default is None and thus, the value given in the initialiser is used):
'all'(exports positive and negative patterns and GND plane as seperate layers),'positive'(exports flattened metals to layer 0), or'negative'(exports negative flattened metals to layer 0)
export_layers (list[int]) – Layers to export given as a list of integers or single integer (WIP). Default is None and thus, the value given in the initialiser is used.
- get_cell_layers()
Get all layers across the current cell.
- Returns:
layers – List of layers present in current cell.
- Return type:
list[int]
- static merge_gds_per_layer_inplace(gds_input_file: str, inplace: bool = True)
Open a GDS file, go through every layer in every cell/region and merge all polygons within, then save the GDS file.
- Parameters:
gds_input_file (str) – Path to the GDS file
inplace (bool) – If True (the default value), the input file is overwritten with the polygons merged within every layer. Otherwise, the output is written into the same location as the input file with the suffix _merged added to the name.
- perforate_layer(layer_ind: int = 0, x_space: float = 2e-05, y_space: float = 2e-05, hole_size: float = 2e-06, keep_hole_layer: bool = False, x_space_edge_proportion: float = 0.5, y_space_edge_proportion: float = 0.5)
Perforate a given layer with a uniform grid of square holes (a.k.a. cheesing).
- Parameters:
layer_ind (int) – Index of layer to perforate
x_space (float) – Spacing of the holes along the x-axis given in metres. Default value is 20e-6.
y_space (float) – Spacing of the holes along the y-axis given in metres. Default value is 20e-6.
hole_size (float) – Size of each square hole in metres. Default value is 2e-6
keep_hole_layer (bool) – If True, the temporary layer created as a stencil (i.e. the hole polygons) is removed. Defaults to False.
x_space_edge_proportion (float) – Padding on the left and right edges before placing the holes. Given as a proportion of x_space (default value being 0.5).
y_space_edge_proportion (float) – Padding on the top and bottom edges before placing the holes. Given as a proportion of y_space (default value being 0.5).
- Returns:
hole_layer – Integer index of the perforated layer.
- Return type:
int