kqcircuits.simulations.export.xsection.xsection_export

kqcircuits.simulations.export.xsection.xsection_export.xsection_call(input_oas: Path, output_oas: Path, cut1: DPoint, cut2: DPoint, process_path: Path = PosixPath('/home/runner/work/KQCircuits/KQCircuits/xsection/kqc_process.xs'), parameters_path: Path | None = None) None[source]

Calls on KLayout to run the XSection plugin

Parameters:
  • input_oas – Input OAS file (top-down geometry)

  • output_oas – Output OAS file (Cross-section of input geometry)

  • cut1 – DPoint of first endpoint of the cross-section cut

  • cut2 – DPoint of second endpoint of the cross-section cut

  • process_path – XSection process file that defines cross-section etching depths etc

  • parameters_path – If process_path points to kqc_process.xs, parameters_path should point to the XSection parameters json file containing sweeped parameters and layer information.

kqcircuits.simulations.export.xsection.xsection_export.create_xsections_from_simulations(simulations: list[~kqcircuits.simulations.simulation.Simulation], output_path: ~pathlib.Path, cuts: tuple[~klayout.pyacore.DPoint, ~klayout.pyacore.DPoint] | list[tuple[~klayout.pyacore.DPoint, ~klayout.pyacore.DPoint]], process_path: ~pathlib.Path = PosixPath('/home/runner/work/KQCircuits/KQCircuits/xsection/kqc_process.xs'), post_processing_function: ~typing.Callable[[~kqcircuits.simulations.cross_section_simulation.CrossSectionSimulation], None] | None = None, oxidise_layers_function: ~typing.Callable[[~kqcircuits.simulations.cross_section_simulation.CrossSectionSimulation, float, float, float], None] = <function _oxidise_layers>, ma_permittivity: float = 0, ms_permittivity: float = 0, sa_permittivity: float = 0, ma_thickness: float = 0, ms_thickness: float = 0, sa_thickness: float = 0, vertical_cull: tuple[float, float] | None = None, mer_box: ~klayout.pyacore.DBox | list[~klayout.pyacore.DBox] | None = None, london_penetration_depth: float | list = 0, magnification_order: int = 0, layout: ~klayout.pyacore.Layout | None = None) list[Simulation][source]

Create cross-sections of all simulation geometries in the list. Will set ‘box’ and ‘cell’ parameters according to the produced cross-section geometry data.

Parameters:
  • simulations – List of Simulation objects, usually produced by a sweep

  • output_path – Path for the exported simulation files

  • cuts

    1. A tuple (p1, p2), where p1 and p2 are endpoints of a cross-section cut or

    2. a list of such tuples such that each Simulation object gets an individual cut

  • process_path – XSection process file that defines cross-section etching depths etc

  • post_processing_function – Additional function to post-process the cross-section geometry. Defaults to None, in which case no post-processing is performed. The function takes a CrossSectionSimulation object as argument

  • oxidise_layers_function – Set this argument if you have a custom way of introducing oxidization layers to the cross-section metal deposits and substrate. See expected function signature from pyhints

  • ma_permittivity – Permittivity of metal–vacuum (air) interface

  • ms_permittivity – Permittivity of metal–substrate interface

  • sa_permittivity – Permittivity of substrate–vacuum (air) interface

  • ma_thickness – Thickness of metal–vacuum (air) interface

  • ms_thickness – Thickness of metal–substrate interface

  • sa_thickness – Thickness of substrate–vacuum (air) interface

  • vertical_cull – Tuple of two y-coordinates, will cull all geometry not in-between the y-coordinates. None by default, which means all geometry is retained.

  • mer_box – If set as pya.DBox, will create a specified box as metal edge region, meaning that the geometry inside the region are separated into different layers with ‘_mer’ suffix

  • london_penetration_depth – London penetration depth of the superconducting material

  • magnification_order – Increase magnification of simulation geometry to accomodate more precise spacial units. 0 = no magnification with 1e-3 dbu 1 = 10x magnification with 1e-4 dbu 2 = 100x magnification with 1e-5 dbu etc Consider setting non-zero value when using oxide layers with < 1e-3 layer thickness or taking cross-sections of thin objects

  • layout – predefined layout for the cross-section simulation (optional)

Returns:

List of CrossSectionSimulation objects for each Simulation object in simulations

kqcircuits.simulations.export.xsection.xsection_export.separate_signal_layer_shapes(simulation: Simulation, sort_key: Callable[[Shape], float] | None = None)[source]

Separate shapes in signal layer to their own dedicated signal layers for each face

Parameters:
  • simulation – A Simulation object where the layer will be separated

  • sort_key – A function that, given a Shape object, returns a number. Shapes are sorted according to the number in increasing order. If None, picks a point in shape polygon, sorts points top to bottom then tie-breaks left to right

kqcircuits.simulations.export.xsection.xsection_export.find_layer_by_name(layer_name, layout)[source]

Returns layerinfo if there already is a layer by layer_name in layout. None if no such layer exists

kqcircuits.simulations.export.xsection.xsection_export.free_layer_slots(layout)[source]

A generator of available layer slots

kqcircuits.simulations.export.xsection.xsection_export.visualise_xsection_cut_on_original_layout(simulations: list[Simulation], cuts: tuple[DPoint, DPoint] | list[tuple[DPoint, DPoint]], cut_label: str = 'cut', width_ratio: float = 0.0)[source]

Visualise requested xsection cuts on the original simulation layout.

Will add a rectangle between two points of the cut, and two text points into layer “xsection_cut”:

* f"{cut_label}_1" representing the left side of the cross section simulation
* f"{cut_label}_2" representing the right side of the cross section simulation

In case the export takes xsections for one simulation multiple times, this function can be called on same simulation sweep multiple times so that multiple cuts can be visualised in the same layout. In such case it is recommended to differentiate the cuts using cut_label.

Parameters:
  • simulations – list of simulations from which xsections are taken. After this call these simulations will be modified to include the visualised cuts.

  • cuts

    1. A tuple (p1, p2), where p1 and p2 are endpoints of a cross-section cut or

    2. a list of such tuples such that each Simulation object gets an individual cut

  • cut_label – prefix of the two text points shown for the cut

  • width_ratio – rectangles visualising cuts will have a width of length of the cut multiplied by width_ratio

../_images/kqcircuits.simulations.export.xsection.xsection_export.png