cirq.ClassicallyControlledOperation raises "ValueError: Encountered unparseable op"
rht opened this issue · 1 comments
rht commented
Minimal reproducer:
import cirq
import qsimcirq
simulator = qsimcirq.QSimSimulator()
q = cirq.NamedQubit("q")
circuit = cirq.Circuit([
cirq.measure(q, key="c"),
cirq.ClassicallyControlledOperation(cirq.Z(q), "c")
])
simulator.simulate(circuit)
Traceback:
Traceback (most recent call last):
File "***/minimal_reproducer.py", line 12, in <module>
simulator.simulate(circuit)
File "***/venv/lib/python3.10/site-packages/cirq/sim/simulator.py", line 491, in simulate
return self.simulate_sweep(
File "***/venv/lib/python3.10/site-packages/cirq/sim/simulator.py", line 506, in simulate_sweep
return list(self.simulate_sweep_iter(program, params, qubit_order, initial_state))
File "***/venv/lib/python3.10/site-packages/qsimcirq/qsim_simulator.py", line 519, in simulate_sweep_iter
options["c"], _ = self._translate_circuit(
File "***/venv/lib/python3.10/site-packages/qsimcirq/qsim_simulator.py", line 808, in _translate_circuit
translated, moment_indices = translator_fn(qubit_order)
File "***/venv/lib/python3.10/site-packages/qsimcirq/qsim_circuit.py", line 473, in translate_cirq_to_qtrajectory
raise ValueError(f"Encountered unparseable op: {qsim_op}")
ValueError: Encountered unparseable op: Z(q).with_classical_controls(c)
Version:
cirq-core==1.0.0
qsimcirq==0.14.0
I happened to encounter this unsupported feature by chance. But I think it would be great if there is a comprehensive list of features still not yet supported by qsimcirq
.
95-martin-orion commented
See also: #149