Skip to content

Commit c69be2a

Browse files
committed
Fix type check.
1 parent be837b3 commit c69be2a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cirq-core/cirq/transformers/tag_transformers.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def index_tags(
2626
circuit: 'cirq.AbstractCircuit',
2727
*,
2828
context: Optional['cirq.TransformerContext'] = None,
29-
target_tags: set[Hashable],
29+
target_tags: Optional[set[Hashable]] = None,
3030
) -> 'cirq.Circuit':
3131
"""Indexes tags in target_tags as tag_0, tag_1, ... per tag.
3232
@@ -41,7 +41,7 @@ def index_tags(
4141
if context and context.tags_to_ignore:
4242
raise ValueError("index_tags doesn't support tags_to_ignore, use function args instead.")
4343
if not target_tags:
44-
return circuit
44+
return circuit.unfreeze(copy=False)
4545
tag_iter_by_tags = {tag: itertools.count(start=0, step=1) for tag in target_tags}
4646

4747
def _map_func(op: 'cirq.Operation', _) -> 'cirq.OP_TREE':

0 commit comments

Comments
 (0)