Skip to content

Remove deprecated BackendV1 elements, including base class, providers.models and qobj modules#13793

Merged
mtreinish merged 15 commits intoQiskit:mainfrom
ElePT:macro-removal
Mar 5, 2025
Merged

Remove deprecated BackendV1 elements, including base class, providers.models and qobj modules#13793
mtreinish merged 15 commits intoQiskit:mainfrom
ElePT:macro-removal

Conversation

@ElePT
Copy link
Copy Markdown
Contributor

@ElePT ElePT commented Feb 5, 2025

Summary

This PR builds upon (and is BLOCKED BY) the changes in #13805.
This PR removes BackendV1 and all related modules and utils. This includes:

  • from qiskit/providers:

    • BackendV1
    • BackendV2Converter
    • convert_to_target
    • BackendPropertyError
    • BackendConfigurationError
  • from qiskit/providers/models: these were BackendV1 data structures. Full module removed

    • BackendConfiguration
    • BackendProperties
    • BackendStatus
    • QasmBackendConfiguration
    • PulseBackendConfiguration
    • UchannelLO
    • GateConfig
    • PulseDefaults
    • Command
    • JobStatus
    • GateProperties
    • Nduv
  • Removed PulseQobjDef from qiskit/providers/models (this steps a bit into pulse removal realm)

  • from qiskit/qobj: Full module removed.

    • QobjExperimentHeader
    • QobjHeader
    • QasmQobj
    • QasmQobjInstruction
    • QasmQobjExperimentConfig
    • QasmQobjExperiment
    • QasmQobjConfig
    • QasmExperimentCalibrations
    • GateCalibration
    • PulseQobj
    • PulseQobjInstruction
    • PulseQobjExperimentConfig
    • PulseQobjExperiment
    • PulseQobjConfig
    • QobjMeasurementOption
    • PulseLibraryItem

Note that there were two classes defined in the qobj utils (MeasLevel and MeasReturnType) used in the result class, so they have been moved to result/models.py.

TODOs

  • Reno

Details

qiskit.exceptions.OptionalDependencyImportWarning: While trying to import 'Qiskit Aer', some components were located but raised other errors during import. You might have an incompatible version installed. Qiskit will continue as if the optional is not available.
module 'qiskit_aer' failed to import with: ImportError("cannot import name 'convert_to_target' from 'qiskit.providers' (/home/vsts/work/1/s/qiskit/providers/__init__.py)")

@ElePT ElePT changed the title [WIP] Remove deprecated qobj, pulse module, and related tools from BackendV1 [WIP] Remove deprecated BackendV1 elements, including base class, providers.models and qobj modules Feb 17, 2025
@ElePT ElePT added the on hold Can not fix yet label Feb 17, 2025
@coveralls
Copy link
Copy Markdown

coveralls commented Feb 17, 2025

Pull Request Test Coverage Report for Build 13684630517

Details

  • 29 of 67 (43.28%) changed or added relevant lines in 9 files are covered.
  • 12 unchanged lines in 6 files lost coverage.
  • Overall coverage increased (+1.1%) to 88.101%

Changes Missing Coverage Covered Lines Changed/Added Lines %
qiskit/visualization/pulse_v2/device_info.py 0 1 0.0%
qiskit/visualization/gate_map.py 0 37 0.0%
Files with Coverage Reduction New Missed Lines %
qiskit/pulse/calibration_entries.py 1 83.49%
qiskit/pulse/parameter_manager.py 1 96.97%
qiskit/pulse/schedule.py 1 88.03%
qiskit/utils/deprecate_pulse.py 1 94.12%
crates/circuit/src/circuit_instruction.rs 3 89.46%
crates/qasm2/src/lex.rs 5 91.73%
Totals Coverage Status
Change from base Build 13683975981: 1.1%
Covered Lines: 75167
Relevant Lines: 85319

💛 - Coveralls

@ElePT ElePT changed the title [WIP] Remove deprecated BackendV1 elements, including base class, providers.models and qobj modules Remove deprecated BackendV1 elements, including base class, providers.models and qobj modules Feb 17, 2025
@ElePT ElePT marked this pull request as ready for review February 17, 2025 16:14
@qiskit-bot
Copy link
Copy Markdown
Collaborator

One or more of the following people are relevant to this code:

@ElePT ElePT removed the on hold Can not fix yet label Mar 3, 2025
@mtreinish mtreinish added priority: high Changelog: Removed Add a "Removed" entry in the GitHub Release changelog. labels Mar 4, 2025
mtreinish pushed a commit to Qiskit/qiskit-neko that referenced this pull request Mar 5, 2025
…55)

BackendV1 and qiskit.qobj removals in Qiskit/qiskit#13793 cause the test in qiskit_neko/tests/experiments/test_tomography.py to fail. This is part of the tests that are blocking the Qiskit/qiskit#13793 and Qiskit/qiskit#13872 PR in Qiskit from being merged.

There is a PR in Qiskit Experiments that address these removals: qiskit-community/qiskit-experiments#1526. Until it is merged, we need to skip this failing test.

Tracked in #54
Copy link
Copy Markdown
Member

@mtreinish mtreinish left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall this LGTM. Thanks for doing this! This finally finishes a process I started back in 2019 with #3383 of trying to clean up these interfaces. I'm glad to see that 4 years later we're finally able to remove this legacy code from Qiskit. This is incredibly satisfying to see.

I just had a couple small comments inline. I thinkt he only one that needs an update is the release notes one though.

provider is anything that provides an external service to Qiskit. The typical
example of this is a Backend provider which provides
:class:`~qiskit.providers.Backend` objects which can be used for executing
:class:`~qiskit.circuit.QuantumCircuit` and/or :class:`~qiskit.pulse.Schedule`
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR doesn't remove schedules yet but it's fine. :)

Comment on lines -292 to -297
If migrating a provider from :class:`~qiskit.providers.BackendV1`
one thing to keep in mind is for
backwards compatibility you might need to add a configuration method that
will build a :class:`~qiskit.providers.models.BackendConfiguration` object
and :class:`~qiskit.providers.models.BackendProperties` from the attributes
defined in this class for backwards compatibility.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could have left this comment in the docstring because someone could conceivably be migrating from BackendV1 post removal (as part of fixing 2.0 compatibility). But it also is fine to remove it since this lives in the 1.4 docs.


class Bloch:
"""Class for plotting data on the Bloch sphere. Valid data can be
either points, vectors, or qobj objects.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lol, what!? There is nothing that ever took a qobj here afaik.

Comment on lines +4 to +7
The ``BackendV1`` model has been removed following its deprecation in
Qiskit 1.2.0. This includes the ``BackendV1`` class as well as related
modules and utils, as they have been superseded by the :class:`.BackendV2`
model. The list of removed items includes:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You might want to mention this also includes things that previously could accept a backend v1 object like generate_preset_pass_manager etc.

legacy ``BackendV1`` components (such as ``BackendConfiguration`` or ``BackendProperties``)

* ``BackendPropertyError`` and ``BackendConfigurationError``: exceptions linked to removed classes

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there are a couple of removals missing here. The ones I caught are:

  • Target.from_configuration() backend_properties` arg
  • target_to_backend_properties

I might have missed others though.

Copy link
Copy Markdown
Member

@mtreinish mtreinish left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for the quick update.

@mtreinish mtreinish enabled auto-merge March 5, 2025 20:11
@mtreinish mtreinish added this pull request to the merge queue Mar 5, 2025
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Mar 5, 2025
@ElePT ElePT added this pull request to the merge queue Mar 5, 2025
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Mar 5, 2025
@mtreinish mtreinish added this pull request to the merge queue Mar 5, 2025
Merged via the queue into Qiskit:main with commit 9c00a93 Mar 5, 2025
jakelishman added a commit to jakelishman/qiskit-terra that referenced this pull request Sep 29, 2025
This is an undocumented internal module, so not subject to the
deprecation policy.  The module has been empty since Qiskitgh-13793 (and the
handful of other `qiskit.providers` PRs that logically went with that
one) in the Qiskit 2.0 transition, but since everything was using
precise imports, we didn't notice the `__init__` file was now useless.
github-merge-queue Bot pushed a commit that referenced this pull request Sep 29, 2025
This is an undocumented internal module, so not subject to the
deprecation policy.  The module has been empty since gh-13793 (and the
handful of other `qiskit.providers` PRs that logically went with that
one) in the Qiskit 2.0 transition, but since everything was using
precise imports, we didn't notice the `__init__` file was now useless.
aaryav-3 pushed a commit to aaryav-3/qiskit that referenced this pull request Oct 21, 2025
…15091)

This is an undocumented internal module, so not subject to the
deprecation policy.  The module has been empty since Qiskitgh-13793 (and the
handful of other `qiskit.providers` PRs that logically went with that
one) in the Qiskit 2.0 transition, but since everything was using
precise imports, we didn't notice the `__init__` file was now useless.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Changelog: Removed Add a "Removed" entry in the GitHub Release changelog.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove BackendV1 and related dependencies, deprecated in 1.2 Remove qobj, deprecated in 1.2

6 participants