rich7420 opened a new pull request, #1175:
URL: https://github.com/apache/mahout/pull/1175

   ## Title
   
   [QDP] feat: add SVHN Quantum Kernel SVM benchmark (12 qubits)
   
   ## Body
   
   ### Related Issues
   
   N/A
   
   ### Changes
   
   - [ ] Bug fix
   - [x] New feature
   - [ ] Refactoring
   - [ ] Documentation
   - [ ] Test
   - [ ] CI/CD pipeline
   - [ ] Other
   
   ### Why
   
   A Quantum Kernel SVM pipeline eliminates the iterative training loop — 
encoding becomes ~19% of total pipeline time, making QDP's GPU encoding 
advantage clearly visible in end-to-end results.
   
   ### How
   
   Added two new benchmark scripts that implement a Quantum Kernel SVM 
classification pipeline on SVHN:
   
   ```
   SVHN (32×32×3) → StandardScaler → Amplitude Encode (3072→4096, 12 qubits)
     → Quantum Kernel K[i,j] = |⟨ψ(xⱼ)|ψ(xᵢ)⟩|² → SVM (precomputed) → 5-fold CV
   ```
   
   #### New files
   
   - `pennylane_baseline/svhn_kernel_amplitude.py` — CPU encoding (L2-norm + 
zero-pad)
   - `qdp_pipeline/svhn_kernel_amplitude.py` — QDP GPU encoding (amplitude)
   
   #### Benchmark results (RTX 3080)
   
   5000 samples, 5-fold stratified CV, binary classification (digit 1 vs 7), 
C=100
   
   | Step | pennylane | QDP GPU | Speedup |
   |------|-----|---------|---------|
   | Scale + Encode | 0.648s | 0.342s | **1.89×** |
   | Kernel (matmul) | 1.191s | 0.788s | **1.51×** |
   | CV fit + predict (5 folds) | 1.597s | 1.170s | 1.36× |
   | **Total** | **3.44s** | **2.30s** | **1.49×** |
   
   **Accuracy: 0.9104 ± 0.0091** (identical for both pipelines)
   
   #### How to run
   
   ```bash
   # CPU baseline
   python 
benchmark/encoding_benchmarks/pennylane_baseline/svhn_kernel_amplitude.py
   
   # QDP GPU pipeline
   python benchmark/encoding_benchmarks/qdp_pipeline/svhn_kernel_amplitude.py
   
   # Custom parameters
   python benchmark/encoding_benchmarks/qdp_pipeline/svhn_kernel_amplitude.py \
     --n-samples 10000 --folds 5 --svm-c 100
   ```
   
   > SVHN data (~180 MB) is auto-downloaded on first run.
   
   ## Checklist
   
   - [x] Added or updated unit tests for all changes
   - [x] Added or updated documentation for all changes
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to