diff --git a/src/qibo/quantum_info/random_ensembles.py b/src/qibo/quantum_info/random_ensembles.py index dd66a7e0a6..3d11c0d1ce 100644 --- a/src/qibo/quantum_info/random_ensembles.py +++ b/src/qibo/quantum_info/random_ensembles.py @@ -426,7 +426,7 @@ def random_statevector(dims: int, seed=None, backend=None): state /= np.linalg.norm(state) state = backend.cast(state, dtype=state.dtype) - return backend.cast(state, dtype=state.dtype) + return state def random_density_matrix(