pygsti.processors.random_compilation.update_u3_parameters#
- update_u3_parameters(layer, p, q, qubit_map)#
Updates the parameters of U3 gates in a given layer based on the provided Pauli random compiling vectors.
- Parameters:
layer (iterable[pygsti.baseobjs.Label]) – A list of gate labels representing the layer containing U3 gates.
p (np.ndarray[int]) – A vector describing the Pauli gates preceding the layer. 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.
p – A vector describing the Pauli gates following the layer. For an n-qubit layer, q is a length-2n array. q[0:n] indicates Pauli-Z (2 is yes Z, 0 is no Z), q[n:2*n] is Pauli-X (2 yes, 0 no). E.g., if n = 5, p[1] = 0, and p[6] = 2, then there is an X gate on qubit 3.
qubit_map (dict[str, int]) – A mapping of qubit labels to their corresponding indices.
q (ndarray)
- Returns:
A new layer containing updated U3 gates based on the applied Pauli gates.
- Return type:
list