Skip to content

Commit

Permalink
Correct check
Browse files Browse the repository at this point in the history
  • Loading branch information
stavros11 committed Oct 16, 2023
1 parent 10796fa commit b15703f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/qibo/parallel.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.")
Expand Down

0 comments on commit b15703f

Please sign in to comment.