pygsti.tools.symplectic.apply_internal_gate_to_symplectic

pygsti.tools.symplectic.apply_internal_gate_to_symplectic#

apply_internal_gate_to_symplectic(s, gate_name, qindex_list, optype='row')#

Applies a Clifford gate to the n-qubit Clifford gate specified by the 2n x 2n symplectic matrix.

The Clifford gate is specified by the internally hard-coded name gate_name. This gate is applied to the qubits with indices in qindex_list, where these indices are w.r.t to indeices of s. This gate is applied from the left (right) of s if optype is ‘row’ (‘column’), and has a row-action (column-action) on s. E.g., the Hadmard (‘H’) on qubit with index i swaps the ith row (or column) with the (i+n)th row (or column) of s; CNOT adds rows, etc.

Note that this function updates s, and returns None.

Parameters:
  • s (np.array) – A even-dimension square array over [0,1] that is the symplectic representation of some (normally multi-qubit) Clifford gate.

  • gate_name (str) – The gate name. Should be one of the gate-names of the hard-coded gates used internally in pyGSTi that is also a Clifford gate. Currently not all of those gates are supported, and gate_name must be one of: ‘H’, ‘P’, ‘CNOT’, ‘SWAP’.

  • qindex_list (list or tuple) – The qubit indices that gate_name acts on (can be either length 1 or 2 depending on whether the gate acts on 1 or 2 qubits).

  • optype ({'row', 'column'}, optional) – Whether the symplectic operator type uses rows or columns: TODO: docstring - better explanation.

Return type:

None