pygsti.tools.internalgates.unitary_to_standard_gatename

pygsti.tools.internalgates.unitary_to_standard_gatename#

unitary_to_standard_gatename(unitary, up_to_phase=False, return_phase=False)#

Looks up and returns the standard gate name for a unitary gate matrix, if one exists.

Parameters:
  • unitary (complex np.array) – The unitary to convert.

  • up_to_phase (bool, optional (default False)) – If true then after checking if the unitary is exactly equivalent to a built-in one, this then checks if the input unitary is equal to to a built-in one up to a global phase.

  • return_phase (bool, optional (default False)) – If true, and up_to_phase is true, then if a unitary is equivalent up to a global phase to a built-in one, we return that phase (i.e. the phase the built-in one would need to be multiplied by).

Returns:

If gate_unitary matches a standard gate, the standard name of this gate (a key in the dictionary given by standard_gatename_unitaries()). None otherwise.

Return type:

str or None