OneQubitEulerDecomposer
class OneQubitEulerDecomposer(basis='U3')
Bases: object
A class for decomposing 1-qubit unitaries into Euler angle rotations.
The resulting decomposition is parameterized by 3 Euler rotation angle parameters , and a phase parameter . The value of the parameters for an input unitary depends on the decomposition basis. Allowed bases and the resulting circuits are shown in the following table. Note that for the non-Euler bases (U3, U1X, RR), the ZYZ Euler parameters are used.
Basis | Euler Angle Basis | Decomposition Circuit |
---|---|---|
‘ZYZ’ | ||
‘ZXZ’ | ||
‘XYX’ | ||
‘XZX’ | ||
‘U3’ | ||
‘U321’ | ||
‘U’ | ||
‘PSX’ | ||
‘ZSX’ | ||
‘ZSXX’ | or | |
‘U1X’ | ||
‘RR’ |
Initialize decomposer
Supported bases are: ‘U’, ‘PSX’, ‘ZSXX’, ‘ZSX’, ‘U321’, ‘U3’, ‘U1X’, ‘RR’, ‘ZYZ’, ‘ZXZ’, ‘XYX’, ‘XZX’.
Parameters
basis (str) – the decomposition basis [Default: ‘U3’]
Raises
QiskitError – If input basis is not recognized.
Methods
angles
OneQubitEulerDecomposer.angles(unitary)
Return the Euler angles for input array.
Parameters
unitary (np.ndarray) – 2x2 unitary matrix.
Returns
(theta, phi, lambda).
Return type
tuple
angles_and_phase
OneQubitEulerDecomposer.angles_and_phase(unitary)
Return the Euler angles and phase for input array.
Parameters
unitary (np.ndarray) – 2x2 unitary matrix.
Returns
(theta, phi, lambda, phase).
Return type
tuple
Attributes
basis
The decomposition basis.