Skip to content

Enable QSVC and VQC baselines in quantum classification example#5

Merged
varunccf merged 1 commit into
mainfrom
copilot/enable-qsvc-and-vqe
Jul 2, 2026
Merged

Enable QSVC and VQC baselines in quantum classification example#5
varunccf merged 1 commit into
mainfrom
copilot/enable-qsvc-and-vqe

Conversation

Copilot AI commented Jul 2, 2026

Copy link
Copy Markdown

examples/quantum/classification.py had the QSVC (QSVM) and VQC (QNN) Qiskit baselines commented out. This re-enables them so they run alongside the classical and quantum HD models under the existing K-fold harness.

Note: the request mentioned "VQE"; the file only contains a VQC (Variational Quantum Classifier) — no VQE code exists. Enabled VQC on that assumption.

Changes (all in examples/quantum/classification.py)

  • Imports: uncommented COBYLA, ZFeatureMap, ZZFeatureMap, RealAmplitudes, VQC, QSVC, ComputeUncompute, FidelityQuantumKernel, StatevectorSampler.
  • run_fold: restored the QSVC block (ZZFeatureMap + FidelityQuantumKernel via StatevectorSampler/ComputeUncompute, fit/predict, timing, report, confusion matrix, decision-function ROC data) and the VQC block (ZFeatureMap + RealAmplitudes ansatz + COBYLA(maxiter=100), fit/predict, neural_network.forward for class-1 scores).
  • Checkpointing: re-added vqc_* / qsvc_* entries to the per-fold fold_data JSON payload.
  • Aggregation: re-added the vqc_reports/matrices/times/roc_data and qsvc_* lists plus their per-fold append/extend in the deterministic-order loop.
  • Reporting: re-added the print_cv_summary calls, raw ROC data prints, and roc_curve-based (FPR, TPR) plot-point sections for both models.

@varunccf varunccf marked this pull request as ready for review July 2, 2026 18:55
@varunccf varunccf merged commit 96745a3 into main Jul 2, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants