Skip to content

Commit

Permalink
Revert "Fix non-complex dtypes in OneQubitEulerDecomposer methods (Qi…
Browse files Browse the repository at this point in the history
…skit#9828)"

This reverts commit 6cec912.

This is currently causing flaky CI, so it's being reverted while work is
done to determine the cause and fix it.
  • Loading branch information
jakelishman committed Mar 22, 2023
1 parent eb4c5cb commit 003a5b6
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 50 deletions.
2 changes: 0 additions & 2 deletions qiskit/quantum_info/synthesis/one_qubit_decompose.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,6 @@ def angles(self, unitary):
Returns:
tuple: (theta, phi, lambda).
"""
unitary = np.asarray(unitary, dtype=complex)
theta, phi, lam, _ = self._params(unitary)
return theta, phi, lam

Expand All @@ -265,7 +264,6 @@ def angles_and_phase(self, unitary):
Returns:
tuple: (theta, phi, lambda, phase).
"""
unitary = np.asarray(unitary, dtype=complex)
return self._params(unitary)

_params_zyz = staticmethod(euler_one_qubit_decomposer.params_zyz)
Expand Down

This file was deleted.

38 changes: 0 additions & 38 deletions test/python/quantum_info/test_synthesis.py
Original file line number Diff line number Diff line change
Expand Up @@ -591,44 +591,6 @@ def test_psx_zsx_special_cases(self):
self.assertTrue(np.allclose(unitary, Operator(qc_zsx).data))
self.assertTrue(np.allclose(unitary, Operator(qc_zsxx).data))

def test_float_input_angles_and_phase(self):
"""Test angles and phase with float input."""
decomposer = OneQubitEulerDecomposer("PSX")
input_matrix = np.array(
[
[0.70710678, 0.70710678],
[0.70710678, -0.70710678],
],
dtype=np.float64,
)
(theta, phi, lam, gamma) = decomposer.angles_and_phase(input_matrix)
expected_theta = 1.5707963267948966
expected_phi = 0.0
expected_lam = 3.141592653589793
expected_gamma = -0.7853981633974483
self.assertAlmostEqual(theta, expected_theta)
self.assertAlmostEqual(phi, expected_phi)
self.assertAlmostEqual(lam, expected_lam)
self.assertAlmostEqual(gamma, expected_gamma)

def test_float_input_angles(self):
"""Test angles with float input."""
decomposer = OneQubitEulerDecomposer("PSX")
input_matrix = np.array(
[
[0.70710678, 0.70710678],
[0.70710678, -0.70710678],
],
dtype=np.float64,
)
(theta, phi, lam) = decomposer.angles(input_matrix)
expected_theta = 1.5707963267948966
expected_phi = 0.0
expected_lam = 3.141592653589793
self.assertAlmostEqual(theta, expected_theta)
self.assertAlmostEqual(phi, expected_phi)
self.assertAlmostEqual(lam, expected_lam)


# FIXME: streamline the set of test cases
class TestTwoQubitWeylDecomposition(CheckDecompositions):
Expand Down

0 comments on commit 003a5b6

Please sign in to comment.