More standard gates

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

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
55/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
python, rust
Área
backend

Línea de trabajo

Start with src/gates.rs and the existing gate methods; the issue says single-qubit and controlled gates follow that pattern, while mcx uses control_mask and the multi-qubit rotations and cswap need the listed decompositions. Then inspect the drawer’s SYMBOLS table, the type stub, and the gates documentation page. Done means adding the requested gates and measure_all behavior, with each represented in those supporting files.

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

Descripción

enhancement
What you want to do

Build common circuits without writing unitary matrices by hand.

Implementation notes
  • The single-qubit and controlled ones need only a matrix in src/gates.rs and a method, the same
    as existing gates. mcx maps straight onto control_mask.
  • rzz is diagonal, so it is a phase that depends on the parity of the two bits. Without a two-qubit
    kernel, decompose it as CX · RZ · CX. rxx and ryy are the same with basis changes.
  • cswap(c, a, b) (control c, swap a and b) is cx(b, a), then ccx(c, a, b), then cx(b, a).
  • Add every gate to the drawer's SYMBOLS table, the type stub and the gates docs page.
What it could look like
qc.sx(0); qc.sxdg(0)
qc.cy(0, 1); qc.ch(0, 1); qc.crx(0, 1, t); qc.cry(0, 1, t)
qc.rzz(0, 1, t); qc.rxx(0, 1, t); qc.ryy(0, 1, t)
qc.cswap(0, 1, 2)
qc.mcx([0, 1, 2, 3], 4)     # any number of controls
qc.measure_all()            # adds classical bits if needed, like Qiskit
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.