pygsti.processors.random_compilation.pauli_randomize_circuit#
- pauli_randomize_circuit(circ, rand_state=None, return_bs=False, return_target_pauli=False, insert_test_layers=False, test_layers=None)#
Performs random compilation on a given circuit by inserting Pauli gates between layers.
- Parameters:
circ (pygsti.circuits.Circuit) – The circuit to be randomized.
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 randomly compiled circuit. Default is False.
return_target_pauli (bool, optional) – If True, returns the target Pauli vector for the circuit. Default is False.
insert_test_layers (bool, optional) – If True, uses test_layers as the Pauli layers to randomly compile instead of randomly generating Pauli layers.
test_layers (list[np.ndarray[int]], optional) – A list of length-2*n arrays representing the test layers to be inserted if `insert_test_layers `is True. The number of test layers must equal the number of U3 layers in the circuit. 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)]