pygsti.tools.symplectic.symplectic_rep_of_clifford_layer

pygsti.tools.symplectic.symplectic_rep_of_clifford_layer#

symplectic_rep_of_clifford_layer(layer, n=None, q_labels=None, srep_dict=None, add_internal_sreps=True)#

Constructs the symplectic representation of the n-qubit Clifford implemented by a single quantum circuit layer.

(Gates in a “single layer” must act on disjoint sets of qubits, but not all qubits need to be acted upon in the layer.)

Parameters:
  • layer (Label) – A layer label, often a compound label with components. Specifies The Clifford gate(s) to calculate the global action of.

  • n (int, optional) – The total number of qubits. Must be specified if q_labels is None.

  • q_labels (list, optional) – A list of all the qubit labels. If the layer is over qubits that are not labelled by integers 0 to n-1 then it is necessary to specify this list. Note that this should contain all the qubit labels for the circuit that this is a layer from, and they should be ordered as in that circuit, otherwise the symplectic rep returned might not be of the correct dimension or of the correct order.

  • srep_dict (dict, optional) – If not None, a dictionary providing the (symplectic matrix, phase vector) tuples associated with each operation label. If the circuit layer contains only ‘standard’ gates which have a hard-coded symplectic representation this may be None. Otherwise it must be specified. If the layer contains some standard gates it is not necessary to specify the symplectic representation for those gates.

  • add_internal_sreps (bool, optional) – If True, the symplectic reps for internal gates are calculated and added to srep_dict. For speed, calculate these reps once, store them in srep_dict, and set this to False.

Returns:

  • s (numpy array) – The symplectic matrix representing the Clifford implement by specified circuit layer

  • p (numpy array) – The phase vector representing the Clifford implement by specified circuit layer