From b15703f4316c0a670fbb71644e8e54133da31977 Mon Sep 17 00:00:00 2001 From: Stavros Efthymiou <35475381+stavros11@users.noreply.github.com> Date: Mon, 16 Oct 2023 14:24:55 +0400 Subject: [PATCH] Correct check --- src/qibo/parallel.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/qibo/parallel.py b/src/qibo/parallel.py index ab69c3fdfd..b79c4e348d 100644 --- a/src/qibo/parallel.py +++ b/src/qibo/parallel.py @@ -92,7 +92,11 @@ def parallel_circuits_execution( if not isinstance(circuits, Iterable): # pragma: no cover raise_error(TypeError, "circuits must be iterable.") - if isinstance(states, (list, tuple)) and len(states) != len(circuits): + if ( + isinstance(states, (list, tuple)) + and isinstance(circuits, (list, tuple)) + and len(states) != len(circuits) + ): raise_error(ValueError, "states must have the same length as circuits.") elif states is not None and not isinstance(states, Iterable): raise_error(TypeError, "states must be iterable.")