Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cirq.ClassicallyControlledOperation raises "ValueError: Encountered unparseable op" #571

Open
rht opened this issue Dec 16, 2022 · 1 comment

Comments

@rht
Copy link

rht commented Dec 16, 2022

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
Copy link
Collaborator

See also: #149

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants