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_classaspartition_region_functionargument, or a manually implementedSimulationclass could implement theget_partition_regionsfunction 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_showparameter 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_simulationsascorrection_cutsargument. If a composition of multiple such functions is needed (for examplesimulationcontains multiple elements, for each we want to calculate EPR), a function can be defined that returns a dict consisting of multiplecorrection_cutscalls, 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_showparameter 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_regionsandcorrection_cutsfunctions forsimulationthat is composed of multiple single elements, implementextract_fromfunction like this, where in the last list argument allsimulationparameters (note: not refpoints) that were used to implementpartition_regionsandcorrection_cutsare listed.