Skip to content

Conversation

@wshanks
Copy link
Collaborator

@wshanks wshanks commented Nov 24, 2025

  • Import cvxpy only when a cvxpy tomography fitter is used.
  • Import qiskit_ibm_runtime only when an experiment is run without passing a sampler argument (so that the backend can be wrapped in SamplerV2).
  • Add test that optional dependencies are not imported immediately with qiskit_experiments (note that qiskit_ibm_runtime eagerly imports qiskit_aer so it was necessary to delay its import to delay the qiskit_aer import).

@wshanks wshanks linked an issue Nov 24, 2025 that may be closed by this pull request
* Import `cvxpy` only when a cvxpy tomography fitter is used.
* Import `qiskit_ibm_runtime` only when an experiment is run without
  passing a sampler argument (so that the backend can be wrapped in
  `SamplerV2`).
* Add test that optional dependencies are not imported immediately with
  `qiskit_experiments` (note that `qiskit_ibm_runtime` eagerly imports
  `qiskit_aer` so it was necessary to delay its import to delay the
  `qiskit_aer` import).
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.

Make cvxpy import lazy

1 participant