OpenQASM import and export

Abierto
#11 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
35/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
python, rust
Área
api, backend

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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).
Lenguaje dominante
Rust
Estrellas
1
Forks
0
Merge medio
12 min
PR fusionados (30 d)
4

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de kaiwave/qsengine

Todos los issues de kaiwave/qsengine

Issues similares

Más issues de Rust

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.