kqcircuits.simulations.epr.example

kqcircuits.simulations.epr.example.partition_regions(simulation: Simulation, 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 as partition_region_function argument, or a manually implemented Simulation class could implement the get_partition_regions function such that it calls this function.

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, 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 as correction_cuts argument. If a composition of multiple such functions is needed (for example simulation contains multiple elements, for each we want to calculate EPR), a function can be defined that returns a dict consisting of multiple correction_cuts calls, then that function can be passed to get_epr_correction_simulations.

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, refpoint_prefix: str, parameter_remap_function: Callable[[Simulation, str], any])[source]

To enable reusing partition_regions and correction_cuts functions for simulation that is composed of multiple single elements, implement extract_from function like this, where in the last list argument all simulation parameters (note: not refpoints) that were used to implement partition_regions and correction_cuts are listed.

../_images/kqcircuits.simulations.epr.example.png