cirq.ClassicallyControlledOperation raises "ValueError: Encountered unparseable op"

Đang mở
#571 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 2 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
22/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
python
Lĩnh vực
quantum-computing

Hướng nghiên cứu

The error is raised in translate_cirq_to_qtrajectory in the qsimcirq package's qsim_circuit.py, around line 473, when an op is not recognized. Start by reading how that function matches Cirq ops, and how ClassicallyControlledOperation wrapping a gate reaches it. Done means the reproducer in the issue runs without the ValueError and gives results consistent with plain Cirq. The thread has had no reply in about 1392 days, so ask maintainers for the expected behaviour before starting.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

a: qsimcirq contributors welcome P1

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.

Ngôn ngữ chính
C++
Star
702
Fork
219
Merge trung bình
1 ngày 2 giờ
Pull request đã merge (30 ngày)
8

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của quantumlib/qsim

Tất cả issue của quantumlib/qsim

Issue tương tự

Thêm issue về C++

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.