atlas_q.quantum_hybrid_system.PeriodicState#
- class atlas_q.quantum_hybrid_system.PeriodicState(num_qubits, offset=0, period=1)[source]#
Bases:
CompressedQuantumStateO(1) memory representation of periodic quantum states Perfect for Shor’s algorithm and period-finding
Represents: |ψ⟩ = 1/√k Σ |offset + j*period⟩
NEW: Analytic QFT sampling for exact/cheap QFT-step emulation
Methods
get_amplitude(basis_state)Constant time amplitude lookup
get_probability(basis_state)Get measurement probability for a basis state
measure([num_shots, use_qft])Simulate measurement of the quantum state
Memory usage in bytes (constant!)
qft_amplitude(fourier_state)Analytic QFT amplitude computation
sample_qft_measurement([num_shots])Sample from QFT of periodic state analytically
Methods
__init__(num_qubits[, offset, period])get_amplitude(basis_state)Constant time amplitude lookup
get_probability(basis_state)Get measurement probability for a basis state
measure([num_shots, use_qft])Simulate measurement of the quantum state
Memory usage in bytes (constant!)
qft_amplitude(fourier_state)Analytic QFT amplitude computation
sample_qft_measurement([num_shots])Sample from QFT of periodic state analytically
- qft_amplitude(fourier_state)[source]#
Analytic QFT amplitude computation
For a periodic state |ψ⟩ = 1/√k Σⱼ |offset + j*r⟩, QFT gives peaks at multiples of N/r where N = 2^n
This makes QFT-step emulation exact and O(1)!
- sample_qft_measurement(num_shots=1)[source]#
Sample from QFT of periodic state analytically
This is EXACT and much faster than computing full QFT! Returns measurements that would result from measuring after QFT.