Commit Graph
4 Commits
Author SHA1 Message Date
priya-sundaram-devandChristian Clauss dde1e49fe1 quantum: modernize QFT to Qiskit 2.x and re-enable its test (#15120)
* 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>
2026-08-30 08:29:03 +00:00
Christian Claussandpre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> c909da9b08 pre-commit: Upgrade psf/black for stable style 2023 (#8110)
* pre-commit: Upgrade psf/black for stable style 2023

Updating https://github.com/psf/black ... updating 22.12.0 -> 23.1.0 for their `2023 stable style`.
* https://github.com/psf/black/blob/main/CHANGES.md#2310

> This is the first [psf/black] release of 2023, and following our stability policy, it comes with a number of improvements to our stable style…

Also, add https://github.com/tox-dev/pyproject-fmt and https://github.com/abravalheri/validate-pyproject to pre-commit.

I only modified `.pre-commit-config.yaml` and all other files were modified by pre-commit.ci and psf/black.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-02-01 18:44:54 +05:30
Mark Mayo f32d611689 clean of unnecessary checks, imports, calls (#7993) 2022-11-21 00:00:27 +13:00
Kevin Jovenpre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>Christian Clauss
21601a4070 create quantum_fourier_transform (#6682)
* create quantum_fourier_transform

This is part of the #Hacktoberfest.
I build the quantum fourier transform for N qubits. (n = 3 in the example)
Best,
Kevin

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update q_fourier_transform.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Add the doctest!

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update q_fourier_transform.py

* Pass first then fail

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
2022-10-31 18:32:54 +01:00