diff --git a/qiskit/quantum_info/synthesis/two_qubit_decompose.py b/qiskit/quantum_info/synthesis/two_qubit_decompose.py index b15e25a476eb..b0407961f768 100644 --- a/qiskit/quantum_info/synthesis/two_qubit_decompose.py +++ b/qiskit/quantum_info/synthesis/two_qubit_decompose.py @@ -382,7 +382,7 @@ def traces(self, target): 4] @staticmethod - def decomp0(target): + def decomp0(target, eps=1e-15): """Decompose target ~Ud(x, y, z) with 0 uses of the basis gate. Result Ur has trace: :math:`|Tr(Ur.Utarget^dag)| = 4|(cos(x)cos(y)cos(z)+ j sin(x)sin(y)sin(z)|`, @@ -390,7 +390,10 @@ def decomp0(target): U0l = target.K1l.dot(target.K2l) U0r = target.K1r.dot(target.K2r) - + U0l.real[abs(U0l.real) < eps] = 0.0 + U0l.imag[abs(U0l.imag) < eps] = 0.0 + U0r.real[abs(U0r.real) < eps] = 0.0 + U0r.imag[abs(U0r.imag) < eps] = 0.0 return U0r, U0l def decomp1(self, target):