@@ -179,7 +179,7 @@ def _sweep_on_symbols(sweep: Sweep, symbols: set[sympy.Symbol]) -> Sweep:
179
179
180
180
181
181
def _calc_phxz_sweeps (
182
- symbolized_circuit : cirq .Circuit , resolved_circuits : list [cirq .Circuit ]
182
+ symbolized_circuit : cirq .AbstractCircuit , resolved_circuits : list [cirq .AbstractCircuit ]
183
183
) -> Sweep :
184
184
"""Return the phxz sweep of the symbolized_circuit on resolved_circuits.
185
185
@@ -306,18 +306,16 @@ def merge_single_qubit_gates_to_phxz_symbolized(
306
306
]
307
307
308
308
# Step 2, get the new symbolized circuit by symbolizing on indexed symbolized_single_tag.
309
- new_circuit = align .align_right (
310
- tag_transformers .remove_tags ( # remove the temp tags used to track merges
311
- symbolize .symbolize_single_qubit_gates_by_indexed_tags (
312
- tag_transformers .index_tags ( # index all 1-qubit-ops merged from ops with symbols
313
- merged_circuits [0 ],
314
- context = transformer_api .TransformerContext (deep = deep ),
315
- target_tags = {symbolized_single_tag },
316
- ),
317
- symbolize_tag = symbolize .SymbolizeTag (prefix = symbolized_single_tag ),
309
+ new_circuit = tag_transformers .remove_tags ( # remove the temp tags used to track merges
310
+ symbolize .symbolize_single_qubit_gates_by_indexed_tags (
311
+ tag_transformers .index_tags ( # index all 1-qubit-ops merged from ops with symbols
312
+ merged_circuits [0 ],
313
+ context = transformer_api .TransformerContext (deep = deep ),
314
+ target_tags = {symbolized_single_tag },
318
315
),
319
- remove_if = lambda tag : str (tag ).startswith (symbolized_single_tag ),
320
- )
316
+ symbolize_tag = symbolize .SymbolizeTag (prefix = symbolized_single_tag ),
317
+ ),
318
+ remove_if = lambda tag : str (tag ).startswith (symbolized_single_tag ),
321
319
)
322
320
323
321
# Step 3, get N sets of parameterizations as new_sweep.
@@ -326,4 +324,4 @@ def merge_single_qubit_gates_to_phxz_symbolized(
326
324
_sweep_on_symbols (sweep , remaining_symbols ), # remaining sweeps
327
325
)
328
326
329
- return new_circuit , new_sweep
327
+ return align . align_right ( new_circuit ) , new_sweep
0 commit comments