From 02e22f99d4710fe3638a7a6941db96a82e91466e Mon Sep 17 00:00:00 2001 From: Renato Mello Date: Fri, 13 Sep 2024 15:34:11 +0400 Subject: [PATCH] fix bug --- src/qibo/quantum_info/superoperator_transformations.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 (