Repository navigation
Move QFw to Qiskit 2.5 for the MQT compiler - #170
Conversation
mqt.core.mlir binds Qiskit's C API per minor release and accepts only the 2.5 series, so the Qiskit pin has to follow the Qiskit the MQT compiler was built for. pennylane-qiskit 0.45.0 declares qiskit<=2.3.0 but runs on 2.5; without an override the resolver satisfies the cap by downgrading pennylane-qiskit to 0.39 and qiskit-ibm-runtime to 0.29. Summary of changes: * setup/requirements.txt: pin `qiskit==2.5.2` (was 2.2.3) and `pennylane-qiskit==0.45.0` (was unpinned), so the override below is only applied to a tested release. * setup/overrides.txt: new uv override file that lifts the qiskit cap. It is passed as `uv pip install --override` by the build scripts. The changes in this commit were produced with AI assistance (GitHub Copilot, using various Claude models). --- Signed-off-by: Andy Stone <stonea@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Thanks for this. Couple of notes:
|
(from openQSE#170 (comment)) The documented install path no longer works. README.md, docs/usage.md (twice) and the two install recipes in docs/recipes still say python -m pip install -r setup/requirements.txt. pip has no override option, so with qiskit==2.5.2 and pennylane-qiskit==0.45.0 it stops with ResolutionImpossible. Could you switch those five places to the uv command with --override setup/overrides.txt, the same one the cluster uses? --- Signed-off-by: Andy Stone <stonea@users.noreply.github.com>
(from openQSE#170 (comment)) Please keep setup/overrides.txt as a file even after the pennylane-qiskit fix lands. QFw-SLURM-Cluster#73 passes --override on every build and fails when the file is missing. A file with only comments works fine with uv. Changing the last line of its header to "drop the override line, keep this file" would make that clear. --- Signed-off-by: Andy Stone <stonea@users.noreply.github.com>
--- Signed-off-by: Andy Stone <stonea@users.noreply.github.com>
Optional: the override drops Qiskit's qasm3-import extra. mqt-core[qiskit] and iqm-qdmi[qiskit] ask for qiskit[qasm3-import], but an override replaces the whole requirement, so qiskit-qasm3-import and openqasm3 are no longer installed. Nothing calls qasm3.load today (QFw and the adapters only export QASM 3), so nothing breaks yet. Writing the override as qiskit[qasm3-import]==2.5.2 keeps the environment the way those packages expect. --- Signed-off-by: Andy Stone <stonea@users.noreply.github.com>
(from openQSE#170 (comment)) Optional: no CI job installs the whole requirements.txt, which is why item 1 did not show up. A uv pip compile step over the requirements files would catch it. The changes in this commit were produced with AI assistance (GitHub Copilot, using various Claude models). --- Signed-off-by: Andy Stone <stonea@users.noreply.github.com>
The changes in this commit were produced with AI assistance (GitHub Copilot, using various Claude models). --- Signed-off-by: Andy Stone <stonea@users.noreply.github.com>
|
Thanks Doug, I've pushed some additional commits that should address your feedback. Let me know if there's anything else you'd like to see.
|
|
Thanks for the updates. All five points are addressed, and the new The five install snippets now call With that, it looks good to me. |
Please do not use |
The install snippets in the README and docs call `uv pip install` with `--override`, but a fresh `python3 -m venv` does not contain `uv`, so the step failed with "command not found" on machines without a system-wide uv. Bootstrapping uv into the venv fixes this; pip is used only for that one step and the dependency install is still done by uv. Summary of changes: * Add `uv` to the `pip install --upgrade pip setuptools wheel` line in README.md, docs/usage.md (both places), and docs/recipes/install-standard-location.md and docs/recipes/install-nonstandard-location.md. * The cluster image and Docker builds are not touched; these snippets are for plain-venv installs only. The changes in this commit were produced with AI assistance (GitHub Copilot, using various Claude models). --- Signed-off-by: Andy Stone <stonea@users.noreply.github.com>
I don't think the instructions here necessarily relate to Docker builds. I understand once we have Just to clarify what's being proposed, I pushed the instruction changes here but I'd be happy to revert it, if this is the wrong approach. -- Also @DougSO, once I get your approval, how should I go about getting my PRs merged in QFw and QFw-SLURM-Cluster? Do you or someone else hit the final 'merge' once its ready or do I need to be added as a contributor? Of course, either way, I'd want to get my stuff reviewed. Thanks! |
Briefly chiming in here: Ideally, we use uv to set up the venv in the first place. That is, |
Yeah. There is no need to get uv "into" the venv. It should be the tool that creates it. Should simplify quite a few things across the setup. |
|
@stonea I agree with @burgholzer and @denialhaag. Installing uv with pip works, but letting uv create the venv is cleaner. Nothing in the QFw build needs pip, setuptools or wheel: uv venv "${QFW_VENV}"
source "${QFW_VENV}/bin/activate"
uv pip install -r "${QFW_SRC}/setup/build-requirements.txt" -r "${QFW_SRC}/setup/requirements.txt" --override "${QFW_SRC}/setup/overrides.txt"That drops the One more line to change: README.md's Developer Testing section runs On merging: you don't need write access. Once a PR is approved and CI is green, I merge it. After #170 merges, QFw-SLURM-Cluster#73 needs its |
The install snippets bootstrapped uv into a `python3 -m venv` with pip, but nothing in the QFw build needs pip, setuptools, or wheel (`setup/build-requirements.txt` is only PyYAML and the CMake build never calls pip). Letting uv create the venv is simpler and removes the bootstrap step, which supersedes d47e47a. Summary of changes: * Replace `python3 -m venv` with `uv venv` and drop the `python -m pip install --upgrade pip setuptools wheel uv` line in README.md, docs/usage.md (both snippets), and docs/recipes/install-standard-location.md and docs/recipes/install-nonstandard-location.md. * Add a sentence telling readers to install uv first, linking the uv installation guide, before the venv snippets in the README, the two recipes, and the docs/usage.md "Create A Python Environment" section. * Use `uv pip install flake8 pytest` in the README Developer Testing section, since a venv created by `uv venv` has no pip. * The `uv pip install ... --override` dependency install commands are unchanged. The changes in this commit were produced with AI assistance (GitHub Copilot, using various Claude models). --- Signed-off-by: Andy Stone <stonea@users.noreply.github.com>
|
Ok cool, I agree it's simpler so long as we're fine asking users to install uv globally (which seems reasonable given how popular uv has become). Anyway, I pushed 306feb8 which uses uv to make the venv and instructs users to install it. |
(from openQSE#170 (comment)) The documented install path no longer works. README.md, docs/usage.md (twice) and the two install recipes in docs/recipes still say python -m pip install -r setup/requirements.txt. pip has no override option, so with qiskit==2.5.2 and pennylane-qiskit==0.45.0 it stops with ResolutionImpossible. Could you switch those five places to the uv command with --override setup/overrides.txt, the same one the cluster uses? --- Signed-off-by: Andy Stone <stonea@users.noreply.github.com>
(from openQSE#170 (comment)) Please keep setup/overrides.txt as a file even after the pennylane-qiskit fix lands. QFw-SLURM-Cluster#73 passes --override on every build and fails when the file is missing. A file with only comments works fine with uv. Changing the last line of its header to "drop the override line, keep this file" would make that clear. --- Signed-off-by: Andy Stone <stonea@users.noreply.github.com>
Optional: the override drops Qiskit's qasm3-import extra. mqt-core[qiskit] and iqm-qdmi[qiskit] ask for qiskit[qasm3-import], but an override replaces the whole requirement, so qiskit-qasm3-import and openqasm3 are no longer installed. Nothing calls qasm3.load today (QFw and the adapters only export QASM 3), so nothing breaks yet. Writing the override as qiskit[qasm3-import]==2.5.2 keeps the environment the way those packages expect. --- Signed-off-by: Andy Stone <stonea@users.noreply.github.com>
(from openQSE#170 (comment)) Optional: no CI job installs the whole requirements.txt, which is why item 1 did not show up. A uv pip compile step over the requirements files would catch it. The changes in this commit were produced with AI assistance (GitHub Copilot, using various Claude models). --- Signed-off-by: Andy Stone <stonea@users.noreply.github.com>
Currently, pennylane-qiskit (used by QFw) is specified to use
qiskit<=2.3.0.This is an issue since MQT wants to use Qiskit 2.5 or 2.6. Currently, in QFw-SLURM-Cluster we are putting MQT and QFw into separate virtual environments with separate versions of qiskit installed. This is an issue as we want to demo integrated MQT into QFw.
This PR force overrides to use qiskit==2.5.2.
This appears to be fine (or at least
examples/qfw_pennylane.shstill seems to work). But it's still less than ideal.@denialhaag made a PR for
pennylane-qiskitto update: PennyLaneAI/pennylane-qiskit#719Once that PR is merged, the changes made here should be reverted
Note: The changes in this commit were produced with AI assistance (GitHub Copilot, using various Claude models).