Skip to content

Closes #3 - adding Toffoli (CCNOT gate) - #11

Open
MKorp7 wants to merge 16 commits into
gstenzel:mainfrom
MKorp7:main
Open

Closes #3 - adding Toffoli (CCNOT gate)#11
MKorp7 wants to merge 16 commits into
gstenzel:mainfrom
MKorp7:main

Conversation

@MKorp7

@MKorp7 MKorp7 commented Jul 12, 2025

Copy link
Copy Markdown
Collaborator

Overview

Adds native Toffoli (CCNOT) gate to QANDLE. Tested against pennylane manually, added automated testing of circuit splitting

Closes #3

Motivation

As mentioned in issue: "The Toffoli gate is essential for universal quantum computation and widely used in quantum algorithms and error correction."

Changes

  • Core: qandle/operators.pyCCNOT implementation
  • Drawer: qandle/drawer.py – drawing of circuits with CCNOT
  • Splitting: Toffoli decomposition based on
    Shende, V. V., & Markov, I. L. (2009). On the CNOT-cost of Toffoli gates. Quantum Inf. Comput., 9(5), 461-486
  • Tests: tests/test_ccnot_split.py – 3- and 10-qubit circuits with CCNOT splitting

Checklist

  • Checked performance of CCNOT againt pennylane implementation
  • Splitting implemented and tested
  • New test for pytest, passes
  • Code style mirrors existing CNOT implementation
  • Docs updated

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.

Add Toffoli gate with full support (operation, printing, exporting, and circuit splitting analysis)

1 participant