Modular addition is fundamental to quantum algorithms like Shor's factorization. Optimize a quantum circuit for computing (a + b) mod N using Alice-Bob's cat-qubit architecture.
🎯 Competition Challenge
Design and implement an efficient quantum circuit that performs modular addition (a + b) mod N optimized for Alice-Bob's cat-qubit hardware. Your solution will be evaluated on correctness, circuit depth, gate count, and qubit efficiency.
I. Introduction and Motivation
Modular arithmetic is a cornerstone of quantum computing, powering critical algorithms including:
- Shor's Algorithm: Integer factorization for cryptography
- Quantum Phase Estimation: Foundation for many quantum algorithms
- Quantum Cryptography: Secure communication protocols
The Challenge: Classical modular addition is straightforward, but implementing it efficiently on quantum hardware requires careful circuit design. Alice-Bob's cat-qubits offer unique advantages through bias-preserving gates and exponential error suppression, enabling more efficient implementations.
Your Task: Build a quantum modular adder that leverages these hardware advantages to minimize resource usage while maintaining correctness.
II. The Core Challenge
Task: Implement Quantum Modular Addition
Create a quantum circuit that computes (a + b) mod N for arbitrary inputs.
Goal: Minimize circuit resources (depth, gates, qubits) while achieving 100% correctness.
Steps:
-
Download the Challenge: Click the "Download" button on this page to set up your local environment using the Aqora CLI
-
Implement Your Circuit: Design your modular adder using the provided template:
def modular_adder(a: int, b: int, N: int, n_bits: int) -> QuantumCircuit:
"""
Implements quantum modular addition: (a + b) mod N
Args:
a: First operand (0 ≤ a < N)
b: Second operand (0 ≤ b < N)
N: Modulus (2 ≤ N < 2^n)
n_bits: Number of bits for representation
Returns:
QuantumCircuit: Circuit computing (a + b) mod N
"""
# Your implementation here
pass
-
Optimize for Alice-Bob: Leverage cat-qubit properties:
- Bias-preserving gates for reduced errors
- Hardware-native operations for efficiency
- Symmetries to reduce qubit count
-
Test Locally: Validate against test cases (n = 3 to 10 bits)
-
Submit: Upload your solution via the Aqora platform for automated grading
Deliverable: Python implementation passing all test cases with optimal resource usage.
Automated Grading: All submissions are evaluated automatically by the Aqora platform. Results and detailed feedback are available immediately after submission.
Getting Started
- Use the "Download" button above to set up your environment with the Aqora CLI
- All starter code, examples, and documentation are included in the download