pygsti.protocols.mirror_edesign.make_mirror_edesign

pygsti.protocols.mirror_edesign.make_mirror_edesign#

make_mirror_edesign(test_edesign, account_for_routing, ref_edesign=None, ref_id_lookup_dict=None, num_mcs_per_circ=10, num_ref_per_qubit_subset=10, mirroring_strategy='pauli_rc', gate_set='u3_cx_cz', inverse=None, inv_kwargs=None, rc_function=None, rc_kwargs=None, state_initialization=None, state_init_kwargs=None, rand_state=None)#

Creates an experiment design containing the mirror circuits needed for mirror circuit fidelity estimation (MCFE).

Parameters:
  • test_edesign (pygsti.protocols.FreeformDesign) – The experiment design containing the test circuits.

  • account_for_routing (bool) – Indicates whether to account for routing in the design.

  • ref_edesign (Optional[pygsti.protocols.FreeformDesign], optional) – The experiment design containing the reference circuits. Default is None.

  • ref_id_lookup_dict (Optional[dict], optional) – A lookup dictionary for matching test circuits with reference circuits. Default is None.

  • num_mcs_per_circ (int, optional) – The number of mirror circuits to generate for each test circuit. Default is 10.

  • num_ref_per_qubit_subset (int, optional) – The number of SPAM reference circuits to use for each qubit subset. Default is 10.

  • mirroring_strategy (Literal['pauli_rc', 'central_pauli'], optional) – The strategy to use for mirroring (‘pauli_rc’ or ‘central_pauli’). Default is ‘pauli_rc’.

  • gate_set (str, optional) – The set of gates to be used in the design. Default is ‘u3_cx_cz’.

  • inverse (Optional[Callable[[_Circuit], _Circuit]], optional) – A custom function to compute the inverse of a circuit. Default is None. Signature: inverse(circ: pygsti.circuits.Circuit, …) -> pygsti.circuits.Circuit If providing a custom inverse function, ‘circ’ must be the circuit parameter name.

  • inv_kwargs (Optional[dict], optional) – Additional keyword arguments for a custom inverse function. Default is None.

  • rc_function (Optional[Callable[[_Circuit], Tuple[_Circuit, str]]], optional) –

    A custom function for random compilation. Default is None.

    Signature: rc_function(circ: pygsti.circuits.Circuit, rand_state: Optional[_np.random.RandomState] = None, …) -> Tuple[pygsti.circuits.Circuit, str] The user-defined function must return the randomized circuit, along with the expected bitstring measurement given the randomization.

    This function is called twice: 1) On the reverse half of the circuit, when creating the init-test-ref_inv-init_inv circuit. ref_inv and init_inv are randomized. The bitstring should be the expected measurement for the full circuit, not ref_inv-init_inv in isolation from the forward half of the circuit. Pass the forward half of the circuit as a kwarg in rc_kwargs if necessary.

    1. On the entire circuit, when creating the init-ref-ref_inv-init_inv circuit. All four pieces are randomized. The bitstring should again be the expected measurement for the full circuit, but it is more clear in this case than in the previous.

  • rc_kwargs (Optional[dict], optional) – Additional keyword arguments for the random compilation function. Default is None.

  • state_initialization (Optional[Union[str, Callable[..., _Circuit]]], optional) – A function or string for state initialization. Default is None. Signature: state_initialization(qubits, rand_state: Optional[_np.random.RandomState] = None, …) -> pygsti.circuits.Circuit If providing a custom state initialization, the parameter names must be ‘qubits’ (list of the qubits being used) and ‘rand_state’.

  • state_init_kwargs (Optional[dict], optional) – Additional keyword arguments for a custom state initialization function. Default is None.

  • rand_state (Optional[_np.random.RandomState], optional) – A random state for reproducibility. Default is None.

Returns:

A combined experiment design containing the MCFE circuits.

Return type:

pygsti.protocols.CombinedExperimentDesign