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

オープン
#1,965 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 3 日以内に返信

@aadityarshah がすでに取り組んでいます。

2026年10月5日 から。

評価

難易度
4/5
見積もり時間
1〜2日
初心者へのやさしさ
57/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
python

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
Python
スター
397
フォーク
127
平均マージ
2日 19時間
マージ済み PR(30日)
4

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

quantumlib/Qualtran のほかの issue

quantumlib/Qualtran の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。