pygsti.processors.random_compilation.pauli_vector_to_u3_layer

pygsti.processors.random_compilation.pauli_vector_to_u3_layer#

pauli_vector_to_u3_layer(p, qubits)#

Converts a Pauli vector into a corresponding layer of U3 gates.

Parameters:
  • p (np.ndarray[int]) – A vector representing the Pauli gates to be converted. For an n-qubit layer, p is a length-2n array. p[0:n] indicates Pauli-Z (2 is yes Z, 0 is no Z), p[n:2*n] is Pauli-X (2 yes, 0 no). E.g., if n = 5, p[3] = 2, and p[8] = 2, then there is a Y gate on qubit 3.

  • qubits (list[str]) – A list of qubit labels corresponding to the Pauli vector.

Returns:

Label containing the layer of U3 gates derived from the Pauli vector.

Return type:

pygsti.baseobjs.Label