Skip to content

Commit

Permalink
once again try to iterate over the annotated queue
Browse files Browse the repository at this point in the history
  • Loading branch information
albi3ro committed Jun 17, 2024
1 parent 23d7ca8 commit fdfce53
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pennylane/queuing.py
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,9 @@ def process_queue(
list_order = {"_ops": 1, "_measurements": 2}
current_list = "_ops"

for obj in queue.queue:
# cant use for obj in queue.queue, as OperatorRecorder overrides the definition of queue
# cant use for obj in queue, as QuantumTape overrides the definition of __iter__
for obj, _ in queue.items():
if not hasattr(obj, "_queue_category"):
raise QueuingError(
f"{obj} encountered in AnnotatedQueue and is not an object that can "
Expand Down

0 comments on commit fdfce53

Please sign in to comment.