kqcircuits.simulations.epr.example
- kqcircuits.simulations.epr.example.partition_regions(simulation: Simulation | Element, prefix: str = '') list[PartitionRegion] [source]
Derives partition regions needed to simulate a single element. Function pointer can be either passed to
get_single_element_sim_class
aspartition_region_function
argument, or a manually implementedSimulation
class could implement theget_partition_regions
function such that it calls this function.When KLayout is open in GUI mode, the partition region defined here can be visualised by enabling the
_epr_show
parameter and assigning layers for each partition region using_epr_part_reg_XXX_layer
. For partition regions to be detected in GUI mode, they need to be listed inkqcircuits.simulations.epr.gui_config
.- Parameters:
simulation – refpoints and parameters of the single element simulation are used to derive the partition regions
prefix – optional prefix differentiates sets of partition regions if extracted from multiple elements within
simulation
- Returns:
List of partition regions
- kqcircuits.simulations.epr.example.correction_cuts(simulation: Simulation | Element, prefix: str = '') dict[str, dict] [source]
Derives correction cuts for each partition region in a single element. This function is meant to be passed to
get_epr_correction_simulations
ascorrection_cuts
argument. If a composition of multiple such functions is needed (for examplesimulation
contains multiple elements, for each we want to calculate EPR), a function can be defined that returns a dict consisting of multiplecorrection_cuts
calls, then that function can be passed toget_epr_correction_simulations
.When KLayout is open in GUI mode, the correction cuts defined here can be visualised by enabling the
_epr_show
parameter and assigning a layer for correction cuts using_epr_cross_section_cut_layer
.- Parameters:
simulation – refpoints and parameters of the single element simulation are used to derive the partition regions
prefix – optional prefix differentiates sets of partition regions if extracted from multiple elements within
simulation
- Returns:
Configuration dict of correction cuts used by
get_epr_correction_simulations
- kqcircuits.simulations.epr.example.extract_from(simulation: Simulation | Element, refpoint_prefix: str, parameter_remap_function: Callable[[Simulation | Element, str], any]) Simulation [source]
To enable reusing
partition_regions
andcorrection_cuts
functions forsimulation
that is composed of multiple single elements, implementextract_from
function like this, where in the last list argument allsimulation
parameters (note: not refpoints) that were used to implementpartition_regions
andcorrection_cuts
are listed.