Skip to content

[CQT-467] Add three-qubit gates CCX and CSWAP - #711

Merged
SoufiTNO merged 7 commits into
developfrom
CQT-467-add-three-qubit-gates
Sep 14, 2026
Merged

SoufiTNO merged 7 commits into
developfrom
CQT-467-add-three-qubit-gates

Conversation

@SoufiTNO

@SoufiTNO SoufiTNO commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

I added ThreeQubitGate with CCX (alias CCNOT) and CSWAP, a ThreeQubitGateDecomposer into CZ and single-qubit gates, and cQASM v1 export of the Toffoli gate.

The CCX decomposition uses 6 CZ gates, which Shende and Markov (2008) prove is minimal. CSWAP uses 8, but that's an upper bound only: the Fredkin CNOT-cost is still open. Both preserve global phase exactly.

@SoufiTNO SoufiTNO changed the title Cqt 467 Add three-qubit gates CCX and CSWAP [CQT-467] Add three-qubit gates CCX and CSWAP Sep 8, 2026
@SoufiTNO SoufiTNO self-assigned this Sep 8, 2026
@SoufiTNO
SoufiTNO requested a review from elenbaasc September 8, 2026 08:14
@SoufiTNO
SoufiTNO marked this pull request as ready for review September 8, 2026 08:38

@elenbaasc elenbaasc left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice work here, great implementation!

I have no comments on the changes made 🙂!

What is still missing though, is the additions to the User documentation, i.e., a page on the ThreeQubitGateDecomposer, adding the three qubit gates to the list of gates that the CircuitBuilder accepts, and it would be good to add the toffoli gate to (some of) the examples of the cQASM v1 exporter.

@elenbaasc elenbaasc left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! Nice addition of the documentation (and also thanks for spotting the missing tow-qubit gates and mistakes in the docs of the cQASM v1 exporter).

Comment thread docs/compilation-passes/decomposition/predefined-decomposers.md
@SoufiTNO
SoufiTNO merged commit 8525150 into develop Sep 14, 2026
16 checks passed
@SoufiTNO
SoufiTNO deleted the CQT-467-add-three-qubit-gates branch September 14, 2026 12:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants