-
Notifications
You must be signed in to change notification settings - Fork 17
Closed
Labels
Description
🚀 Advanced Multi-Qubit Gate Library
Overview
Expand the current gate library with essential multi-qubit operations needed for real quantum algorithms like Grover's search and Shor's algorithm.
Current State
The simulator has basic single and two-qubit gates but lacks advanced multi-qubit operations required for sophisticated quantum algorithms.
Implementation Tasks
Core Gates (C++)
- Toffoli Gate (CCX) - Double-controlled X gate
- Fredkin Gate (CSWAP) - Controlled SWAP gate
- Multi-controlled X/Z gates - Variable number of controls
- Quantum Fourier Transform (QFT) - Both primitive and decomposed versions
File Extensions qubitverse/simulator/gates/ ├── gates.hh # Extend with new declarations ├── gates.cc # Extend with implementations
├── advanced_gates.hh # New - advanced gate declarations └── advanced_gates.cc # New - advanced gate implementations
Integration Points
- Extend parser (
lexer/parser/) for new gate syntax - Update visualizer (
visualizer/src/components/) for gate display - Add CMake build configuration
- Follow existing
.clang-formatstyle guidelines
Success Criteria
- All gates pass numerical precision tests (< 1e-12 error)
- Implement Grover's algorithm as validation
- Complete API documentation
- Seamless parser/visualizer integration
Technical Approach
// Example API extension
namespace qubitverse {
void toffoli(QuantumState& state, int ctrl1, int ctrl2, int target);
void qft(QuantumState& state, const std::vector<int>& qubits);
}