kqcircuits.simulations.export.cross_section.cross_section_export
- kqcircuits.simulations.export.cross_section.cross_section_export.create_cross_sections_from_simulations(simulations: list[~kqcircuits.simulations.simulation.Simulation], cuts: tuple[~klayout.pyacore.DPoint, ~klayout.pyacore.DPoint] | list[tuple[~klayout.pyacore.DPoint, ~klayout.pyacore.DPoint]], profile: ~kqcircuits.simulations.export.cross_section.cross_section_profile.CrossSectionProfile | ~typing.Callable[[~kqcircuits.simulations.simulation.Simulation], ~kqcircuits.simulations.export.cross_section.cross_section_profile.CrossSectionProfile] = <function get_cross_section_profile>, post_processing_function: None | ~typing.Callable[[~kqcircuits.simulations.cross_section_simulation.CrossSectionSimulation], 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
cuts –
A tuple (p1, p2), where p1 and p2 are endpoints of a cross-section cut or
a list of such tuples such that each Simulation object gets an individual cut
profile – CrossSectionProfile object that defines vertical level values for each layer. If not set, will use
default_cross_section_profile
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 typehints
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
layout – predefined layout for the cross-section simulation. If not set, will create new layout.
- Returns:
List of CrossSectionSimulation objects for each Simulation object in simulations
- kqcircuits.simulations.export.cross_section.cross_section_export.find_layer_by_name(layer_name: str, layout: Layout) LayerInfo [source]
Returns layerinfo if there already is a layer by layer_name in layout. None if no such layer exists
- kqcircuits.simulations.export.cross_section.cross_section_export.free_layer_slots(layout: Layout)[source]
A generator of available layer slots
- kqcircuits.simulations.export.cross_section.cross_section_export.visualise_cross_section_cut_on_original_layout(simulations: list[Simulation], cuts: tuple[DPoint, DPoint] | list[tuple[DPoint, DPoint]], cut_label: str = 'cut', width_ratio: float = 0.0) None [source]
Visualise requested cross section cuts on the original simulation layout.
Will add a rectangle between two points of the cut, and two text points into layer “cross_section_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 cross sections 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 cross sections are taken. After this call these simulations will be modified to include the visualised cuts.
cuts –
A tuple (p1, p2), where p1 and p2 are endpoints of a cross-section cut or
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. By default will set 0 width line, which is visualised in KLayout.
- kqcircuits.simulations.export.cross_section.cross_section_export.take_cross_section(cell: Cell, cut: tuple[DPoint, DPoint], profile: CrossSectionProfile) dict[LayerInfo, list[tuple[float, float]]] [source]
Collect intersections between
cut
and polygons incell
for each layer taken into account inprofile
.Returns: Dictionary mapping each pya.LayerInfo into segments where
cut
overlaps with layer polygon. Segments are given as sorted list of tuples (start, end) indicating distances fromcut[0]
to the segment points.
- kqcircuits.simulations.export.cross_section.cross_section_export.produce_intersection_shapes(simulation: Simulation, layout: Layout, segments_by_layer: dict[LayerInfo, list[tuple[float, float]]], profile: CrossSectionProfile) Cell [source]
Based on collected intersections of a cut, produces cross-section shapes. Shapes are placed to same layers, but to separate cell existing at separate layout.
- Parameters:
simulation – Original Simulation object from which cross-section is taken from.
layout – Layout where cross-section cell will be placed.
segments_by_layer – layer segment data returned by
take_cross_section
profile – CrossSectionProfile object that defines vertical level values for each layer.
- Returns:
Cell placed to
layout
that contains cross-section shapes
