Repository: Qiskit/qiskit

Issue:
bug in dealing with data type at `one_qubit_decompose.py`
### Environment

- **Qiskit Terra version**: 
`{'qiskit-terra': '0.23.0', 'qiskit-aer': '0.11.2', 'qiskit-ignis': '0.7.0', 'qiskit-ibmq-provider': '0.19.2', 'qiskit': '0.40.0', 'qiskit-nature': None, 'qiskit-finance': None, 'qiskit-optimization': None, 'qiskit-machine-learning': None}`
- **Python version**: 
`python3.8`
- **Operating system**:  linux


### What is happening?

I see error message as below:
```
"/home/labuser/.virtualenvs/controller/lib/python3.8/site-packages/qiskit/quantum_info/synthesis/one_qubit_decompose.py", line 242, in angles_and_phase
    return self._params(unitary)
  File "/home/labuser/.virtualenvs/controller/lib/python3.8/site-packages/qiskit/quantum_info/synthesis/one_qubit_decompose.py", line 265, in _params_u1x
    theta, phi, lam, phase = OneQubitEulerDecomposer._params_zyz(mat)
TypeError: argument 'unitary': type mismatch:
 from=float64, to=complex128
```
this was with input
```
[[ 0.70710678  0.70710678]                          
 [ 0.70710678 -0.70710678]] 
```

### How can we reproduce the issue?

```
from   qiskit.quantum_info import OneQubitEulerDecomposer

rzsxDecomposer = OneQubitEulerDecomposer('PSX')
M=[[ 0.70710678,  0.70710678] , [ 0.70710678, -0.70710678]] 
(theta, phi, lam, gamma) = rzsxDecomposer.angles_and_phase(M)
```
The error can be resolved by manually casting M to complex;
```
from   qiskit.quantum_info import OneQubitEulerDecomposer

rzsxDecomposer = OneQubitEulerDecomposer('PSX')
M=[[ 0.70710678,  0.70710678] , [ 0.70710678, -0.70710678]] 
(theta, phi, lam, gamma) = rzsxDecomposer.angles_and_phase(np.array(M).astype(complex))
```

### What should happen?

flag the data type error

### Any suggestions?

add wrapper before pass it to rust so that every variable we are passing is casted to complex


Discussion:

Resolving patch:
diff --git a/qiskit/quantum_info/synthesis/one_qubit_decompose.py b/qiskit/quantum_info/synthesis/one_qubit_decompose.py
--- a/qiskit/quantum_info/synthesis/one_qubit_decompose.py
+++ b/qiskit/quantum_info/synthesis/one_qubit_decompose.py
@@ -227,6 +227,7 @@ 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
 
@@ -239,6 +240,7 @@ 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)


Test patch:
diff --git a/test/python/quantum_info/test_synthesis.py b/test/python/quantum_info/test_synthesis.py
--- a/test/python/quantum_info/test_synthesis.py
+++ b/test/python/quantum_info/test_synthesis.py
@@ -591,6 +591,44 @@ 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):