atlas_q.quantum_hybrid_system.GPUAccelerator#
- class atlas_q.quantum_hybrid_system.GPUAccelerator[source]#
Bases:
objectGPU acceleration for period-finding and tensor operations
Note: Requires CuPy for actual GPU execution (pip install cupy-cuda12x) This provides the interface and CPU fallback
NEW: GPU modular exponentiation for massive O(√r) speedup
Methods
accelerated_mps_contraction(mps, basis_state)GPU-accelerated MPS tensor contraction
batched_period_check(a, N, candidates)GPU-accelerated batched period checking Uses custom CUDA kernel for maximum performance
gpu_modular_exponentiation(a, exponents, N)GPU-accelerated batch modular exponentiation Computes a^r mod N for many r values in parallel
parallel_period_check(a, N, candidates)Check multiple period candidates in parallel on GPU Falls back to CPU if GPU unavailable or problem is small
to_cpu(array)Move array to CPU
to_gpu(array)Move array to GPU
Methods
__init__()accelerated_mps_contraction(mps, basis_state)GPU-accelerated MPS tensor contraction
batched_period_check(a, N, candidates)GPU-accelerated batched period checking Uses custom CUDA kernel for maximum performance
gpu_modular_exponentiation(a, exponents, N)GPU-accelerated batch modular exponentiation Computes a^r mod N for many r values in parallel
parallel_period_check(a, N, candidates)Check multiple period candidates in parallel on GPU Falls back to CPU if GPU unavailable or problem is small
to_cpu(array)Move array to CPU
to_gpu(array)Move array to GPU
- gpu_modular_exponentiation(a, exponents, N)[source]#
GPU-accelerated batch modular exponentiation Computes a^r mod N for many r values in parallel
This is MUCH faster than sequential pow() calls!
NEW: Uses Triton kernel (3-17× speedup!) if available, falls back to CuPy
- batched_period_check(a, N, candidates)[source]#
GPU-accelerated batched period checking Uses custom CUDA kernel for maximum performance