We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5c37f95 commit 3819029Copy full SHA for 3819029
cirq-core/cirq/transformers/tag_transformers.py
@@ -26,7 +26,7 @@ def index_tags(
26
circuit: 'cirq.AbstractCircuit',
27
*,
28
context: Optional['cirq.TransformerContext'] = None,
29
- target_tags: set[Hashable],
+ target_tags: Optional[set[Hashable]] = None,
30
) -> 'cirq.Circuit':
31
"""Indexes tags in target_tags as tag_0, tag_1, ... per tag.
32
@@ -41,7 +41,7 @@ def index_tags(
41
if context and context.tags_to_ignore:
42
raise ValueError("index_tags doesn't support tags_to_ignore, use function args instead.")
43
if not target_tags:
44
- return circuit
+ return circuit.unfreeze(copy=False)
45
tag_iter_by_tags = {tag: itertools.count(start=0, step=1) for tag in target_tags}
46
47
def _map_func(op: 'cirq.Operation', _) -> 'cirq.OP_TREE':
0 commit comments