pygsti.processors.random_compilation.randomize_central_pauli

pygsti.processors.random_compilation.randomize_central_pauli#

randomize_central_pauli(circ, rand_state=None, return_bs=False, return_target_pauli=False, insert_test_layer=False, test_layer=None)#

Perform circuit randomization by propagating a central Pauli layer through the circuit. This function is designed to handle the “back half” of the mirror circuit: i.e., given a circuit C whose fidelity is to be estimated using central Pauli mirroring, this function should be passed C_inv + L_inv, where L_inv is Haar-random U3 layer. Refer to make_mirror_edesign in protocols/mirror_design.py for more information.

Parameters:
  • circ (Circuit) – The circuit through which the central Pauli layer is to be propagated.

  • rand_state (np.random.RandomState, optional) – A random state for reproducibility. Default is None, which initializes a new random state.

  • return_bs (bool, optional) – If True, returns the target bitstring for the full mirror central Pauli circuit. Default is False.

  • return_target_pauli (bool, optional) – If True, returns the target Pauli vector that has been propagated through the circuit. Default is False.

  • insert_test_layer (bool, optional) – If True, uses test_layer as the central Pauli layer instead of randomly generating a central Pauli layer.

  • test_layer (np.ndarray[int], optional) – A length-2*n array representing the test layer to be inserted if `insert_test_layer `is True. Default is None.

Returns:

A list containing the randomized circuit, and optionally the bitstring and target Pauli vector if specified.

Return type:

list[pygsti.circuits.Circuit, str (optional), np.ndarray (optional)]