mirror of
https://github.com/TheAlgorithms/Python.git
synced 2026-09-28 21:45:27 +08:00
* quantum: modernize QFT to Qiskit 2.x + re-enable its test quantum/q_fourier_transform.py used the Aer and execute symbols that were removed from qiskit in the 1.0 API break, so it could never run and was on the pytest --ignore list. Port it to the current API: - Drop 'from qiskit import Aer, execute'. Build the circuit unchanged, then simulate with the pure-Python BasicSimulator via transpile() + backend.run(), so no compiled qiskit-aer backend is needed (qiskit-aer has no Python 3.14 wheels yet; BasicSimulator ships inside qiskit core). - Seed the run (seed_simulator=42) and rewrite the doctest to assert the reproducible, shot-noise-independent facts (the four outcomes appear and the counts sum to the shot total) instead of exact per-state counts, which random sampling can never hit. - Add 'qiskit>=2' to project dependencies and drop the quantum ignore + the stale '# TODO: #8818 Re-enable quantum tests' comment in build.yml. Draft until CI confirms qiskit installs and imports on the repo's Python 3.14. * Update quantum/q_fourier_transform.py --------- Co-authored-by: Christian Clauss <cclauss@me.com>