Refactor to Qiskit 1.x, add alternative ansatze#1
Open
barkol wants to merge 5 commits into
Open
Conversation
- Migrate all code from deprecated Qiskit 0.x API (execute, Aer, IBMQ) to Qiskit 1.x (qiskit_aer, qiskit_ibm_runtime, Statevector) - Extract shared circuits and cost functions into sqgen.py module - Add 3 alternative variational ansatze (hardware_efficient, strongly_entangling, circular) alongside original MCMT - Fix mutable default arguments, remove globals, clean up imports - Replace readme.txt with README.md, add .gitignore, requirements.txt - Add test suite (test_sqgen.py) and benchmarking scripts - Include benchmark_results.csv: 1500-eval budget, n=1..5, 5 seeds Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- sqgen_fast.py: JIT-compiled statevector simulator (2652x faster than Qiskit Statevector path) with pre-allocated work arrays and split real/imaginary representation - Direct fidelity cost J = 1-F eliminates discriminator circuit overhead - L-BFGS-B with maxiter=5 replaces BFGS maxiter=1 - Achieves F=1.000 for n=1..5 with hardware_efficient and circular ansatze at budget=1500 evals (vs F=0.235/0.160 previously at n=5) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The direct fidelity cost J = 1 - F is the exact synergic regime
of the full SQGEN objective when θ_{z_D} = 0 (Remark after Def. 3.2
in sqgen_proof_revised.tex), not an approximation.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
qiskit_aer,qiskit_ibm_runtime,Statevector)sqgen.pymodule (removes code duplication between script and notebook)hardware_efficient,strongly_entangling,circular) alongside originalmcmt.gitignore,requirements.txt,README.mdBenchmark highlights (mean fidelity at 1500 evals)
Test plan
python test_sqgen.py— all 8 tests pass (param counts, circuit build, cost functions, QGAN loop, SQGEN loop)qiskit-ibm-runtimefake backend🤖 Generated with Claude Code