OpenQASM import and export
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
Research direction
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.
Written by the indexing model from the issue text.
Description
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 (
Labelinsrc/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/cpareu1/cu1inqelib1.inc.
unitarygates have no name in QASM. Export them asU(θ,φ,λ)from a ZYZ decomposition
(record the global phase asgphasein QASM 3). Controlledunitarygates need a controlled-U
decomposition, or should raise.- Import: parse the subset qsengine supports, and give a clear error naming the first unsupported
statement (customgatedefinitions, 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).
- Dominant language
- Rust
- Stars
- 1
- Forks
- 0
- Avg merge
- 12m
- Merged PRs (30d)
- 4
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from kaiwave/qsengine
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
bug good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 4/5 3-5 days Newbie friendliness 55/100
-
enhancement
Difficulty 4/5 3-5 days Newbie friendliness 48/100
-
enhancement
Difficulty 4/5 3-5 days Newbie friendliness 55/100
All issues in kaiwave/qsengine
Similar issues
-
bug order-flow studies ui
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
userFRM/egui-charts#2417 ·
Maintainers usually reply within 1 day
-
In a plain-text message, Font, Font Size, Font Color and Text Highlight Color stay livePossibly taken @ragelfundionctrumnar claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
UCS-Care-Group/mailcraft#862 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
smoltcp-rs/smoltcp#1243 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 4 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day