OpenQASM import and export

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

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

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
35/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
python, rust
Lĩnh vực
api, backend

Hướng nghiên cứu

Start with src/circuit.rs, especially Label and how instructions retain names and angles; inspect the circuit API for import and export entry points. The issue outlines OpenQASM 2 and 3 edge cases, unsupported import statements, and unitary decomposition, so first map the supported gates and conditions. Done means circuits can be imported from and exported to the described QASM versions with clear errors for unsupported cases.

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

Mô tả

enhancement
What you want to do

Move circuits between qsengine and Qiskit, other simulators, or hardware. Today there is no way
in or out except rebuilding the circuit gate by gate.

Implementation notes
  • Each instruction already keeps its name and angles (Label in src/circuit.rs, described as
    kept "for drawing and later for export").
  • OpenQASM 2 limits:
    • if (c == v) compares the whole register, but qsengine conditions on any subset of bits.
      Export conditions only when they cover the whole register; otherwise raise and point to version 3.
    • p / cp are u1 / cu1 in qelib1.inc.
  • unitary gates have no name in QASM. Export them as U(θ,φ,λ) from a ZYZ decomposition
    (record the global phase as gphase in QASM 3). Controlled unitary gates need a controlled-U
    decomposition, or should raise.
  • Import: parse the subset qsengine supports, and give a clear error naming the first unsupported
    statement (custom gate definitions, loops and so on).
What it could look like
qc = qsengine.QuantumCircuit.from_qasm(open("bell.qasm").read())
print(qc.to_qasm())            # OpenQASM 3 by default
print(qc.to_qasm(version=2))
Contributing
  • I would like to open a pull request for this (see CONTRIBUTING.md).
Ngôn ngữ chính
Rust
Star
1
Fork
0
Merge trung bình
12 phút
Pull request đã merge (30 ngày)
4

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 kaiwave/qsengine

Tất cả issue của kaiwave/qsengine

Issue tương tự

Thêm issue về Rust

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.