atlas_q.quantum_hybrid_system.PeriodicState#

class atlas_q.quantum_hybrid_system.PeriodicState(num_qubits, offset=0, period=1)[source]#

Bases: CompressedQuantumState

O(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()

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

__init__(num_qubits, offset=0, period=1)[source]#

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()

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

get_amplitude(basis_state)[source]#

Constant time amplitude lookup

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.

measure(num_shots=1, use_qft=False)[source]#

Simulate measurement of the quantum state

Args:

num_shots: Number of measurements use_qft: If True, sample from QFT of state (for Shor’s algorithm)

memory_usage()[source]#

Memory usage in bytes (constant!)