diff --git a/src/qibo/quantum_info/superoperator_transformations.py b/src/qibo/quantum_info/superoperator_transformations.py index dbdb136ad1..158dd73ac4 100644 --- a/src/qibo/quantum_info/superoperator_transformations.py +++ b/src/qibo/quantum_info/superoperator_transformations.py @@ -2136,8 +2136,6 @@ def _reshuffling(super_op, order: str = "row", backend=None): Returns: ndarray: Choi (Liouville) representation of the quantum channel. """ - super_op = backend.cast(super_op) - if not isinstance(order, str): raise_error(TypeError, f"order must be type str, but it is type {type(order)}.") @@ -2156,6 +2154,8 @@ def _reshuffling(super_op, order: str = "row", backend=None): backend = _check_backend(backend) + super_op = backend.cast(super_op, dtype=super_op.dtype) + dim = np.sqrt(super_op.shape[0]) if (