pygsti.tools.symplectic.unitary_to_symplectic#
- unitary_to_symplectic(u, flagnonclifford=True)#
Returns the symplectic representation of a one-qubit or two-qubit Clifford unitary.
The Clifford is input as a complex matrix in the standard computational basis.
- Parameters:
u (numpy array) – The unitary matrix to construct the symplectic representation for. This must be a one-qubit or two-qubit gate (so, it is a 2 x 2 or 4 x 4 matrix), and it must be provided in the standard computational basis. It also must be a Clifford gate in the standard sense.
flagnonclifford (bool, opt) – If True, a ValueError is raised when the input unitary is not a Clifford gate. If False, when the unitary is not a Clifford the returned s and p are None.
- Returns:
s (numpy array or None) – The symplectic matrix representing the unitary, or None if the input unitary is not a Clifford and flagnonclifford is False
p (numpy array or None) – The phase vector representing the unitary, or None if the input unitary is not a Clifford and flagnonclifford is False