Implement Gidney's in-place ripple-carry adder with carry-out

Abierto
#1,965 2 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 3 días

@aadityarshah ya está trabajando en esto.

Desde el 5/10/2026.

Evaluación

Dificultad
4/5
Tiempo estimado
1-2 días
Aptitud para principiantes
57/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
python

Línea de trabajo

Start by locating the existing Add, OutOfPlaceAdder, and ControlledAddOrSubtract implementations and their tests; the issue does not name file paths. Compare the in-place adder without carry-out to Fig. 1(b) of the linked paper to identify the expected carry-out behavior. Done means adding the in-place carry-out variant and tests that verify its behavior and Toffoli count.

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

Descripción

While working upon the issue #1462 and going through the paper Quantum schoolbook multiplication with fewer Toffoli gates, I found that the current codebase does not provide a Gidney ripple-carry adder with carry-out.

Currently, it provides Add, which performs in-place addition without carry-out using n-1 Toffoli gates, as described in Fig. 1 (a) of the paper. However, it does not implement the corresponding adder with carry-out as described in Fig. 1(b), which uses n Toffoli gates.

This also differs from the existing OutOfPlaceAdder, which preserves both input registers and computes the n+1-bit sum into a separate output register.

The carry-out version of the adder would be useful to implement the schoolbook multiplications with fewer Toffolis as described in the paper in Fig. 2 (b). This will be useful in the first correction step that fixes the intermediate result obtained after the n iterations of ControlledAddOrSubtract gates.

Lenguaje dominante
Python
Estrellas
397
Forks
127
Merge medio
2 d 19 h
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 quantumlib/Qualtran

Todos los issues de quantumlib/Qualtran

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.