Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove legacy providers interface #7886

Merged
merged 8 commits into from
Apr 19, 2022
Merged

Conversation

mtreinish
Copy link
Member

Summary

This commit removes the legacy providers interface from terra. This
includes the BaseBackend, BaseJob, BaseProvider abstract classes and
everything that inherits from them in the tree. These classes were
deprecated as part of qiskit-terra 0.18.0 and have been supersceded by
the versioned provider interface and all providers should have migrated
by now to these new supported interface. This also means we no longer
support the qobj execution path and QuantumCircuit and Schedule objects
are used directly everywhere for running. In the future we can look at
deprecating and removing the assemble() function and qobj class in the
future as nothing in tree is using them directly. But before we can
deprecate these the IBM provider and aer will need to have native
implementations.

Details and comments

This commit removes the legacy providers interface from terra. This
includes the BaseBackend, BaseJob, BaseProvider abstract classes and
everything that inherits from them in the tree. These classes were
deprecated as part of qiskit-terra 0.18.0 and have been supersceded by
the versioned provider interface and all providers should have migrated
by now to these new supported interface. This also means we no longer
support the qobj execution path and QuantumCircuit and Schedule objects
are used directly everywhere for running. In the future we can look at
deprecating and removing the assemble() function and qobj class in the
future as nothing in tree is using them directly. But before we can
deprecate these the IBM provider and aer will need to have native
implementations.
@mtreinish mtreinish added Changelog: Deprecation Include in "Deprecated" section of changelog Changelog: Removal Include in the Removed section of the changelog labels Apr 4, 2022
@mtreinish mtreinish added this to the 0.21 milestone Apr 4, 2022
@coveralls
Copy link

coveralls commented Apr 4, 2022

Pull Request Test Coverage Report for Build 2192587403

  • 80 of 91 (87.91%) changed or added relevant lines in 36 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage increased (+0.2%) to 84.189%

Changes Missing Coverage Covered Lines Changed/Added Lines %
qiskit/opflow/converters/circuit_sampler.py 2 3 66.67%
qiskit/transpiler/passes/calibration/builders.py 3 4 75.0%
qiskit/execute_function.py 4 6 66.67%
qiskit/tools/jupyter/jupyter_magics.py 0 2 0.0%
qiskit/utils/quantum_instance.py 16 21 76.19%
Files with Coverage Reduction New Missed Lines %
qiskit/providers/backend.py 1 80.54%
Totals Coverage Status
Change from base Build 2192516462: 0.2%
Covered Lines: 53731
Relevant Lines: 63822

💛 - Coveralls

Copy link
Member

@jakelishman jakelishman left a comment

Choose a reason for hiding this comment

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

The one minor comment aside, this all looks like a very straightforwards removal (hopefully!), and it'll certainly be good to see the back of all this legacy code.

qiskit/utils/backend_utils.py Outdated Show resolved Hide resolved
mtreinish added a commit to mtreinish/qiskit-core that referenced this pull request Apr 4, 2022
This commit updates the documentation of the execute() function to
clarify its purpose and intent. The execute() function is provided as a
higher level abstraction and convenience function for use cases where
you just want to execute a circuit and not worry about how it gets
compiled for a particular backend. The set of options the function is
minimal by design because it should just be about running circuits with
no options needed and if you need to exert more control over the
compilation you should use transpile() and backend.run() together
instead. As part of this a large number of legacy kwargs defined on the
function are deprecated as they are mostly holdovers from before the
purpose of the function was clear and really are just needless
duplication of transpile(), schedule(), and assemble() (even though this
isn't used anymore after Qiskit#7886).

Closes Qiskit#7640
Now that BaseBackend is no longer in qiskit we don't need to special
handle the case where backend.version is not the interface version
(since it was a method in BaseBackend). This commit drops the handling
for this and uses the interface for the versioned interface as it was
originally intended.
jakelishman
jakelishman previously approved these changes Apr 4, 2022
The tests were failing because one of the default values for getting the
backend version attribute was None instead of 0 causing a type error
when an integer was expected. This was not caught previously because the
BaseBackend handling checked for non integer versions and converted
those to 0. However, now without BaseBackend we need to be more explicit
and use an integer for the backend interface version.
mtreinish added a commit to mtreinish/qiskit-aer that referenced this pull request Apr 5, 2022
The BaseBackend class in qiskit-terra (along with the rest of the legacy
provider interface) is deprecated and being removed soon in
Qiskit/qiskit#7886. To avoid potential compatibility issues or
deprecation warnings we shouldn't be using this class anymore. This
commit removes the last 2 uses of these legacy classes to avoid issues
moving forward.
hhorii added a commit to Qiskit/qiskit-aer that referenced this pull request Apr 6, 2022
The BaseBackend class in qiskit-terra (along with the rest of the legacy
provider interface) is deprecated and being removed soon in
Qiskit/qiskit#7886. To avoid potential compatibility issues or
deprecation warnings we shouldn't be using this class anymore. This
commit removes the last 2 uses of these legacy classes to avoid issues
moving forward.

Co-authored-by: Hiroshi Horii <hhorii@users.noreply.github.com>
mtreinish added a commit to hhorii/qiskit-aer that referenced this pull request Apr 6, 2022
The BaseBackend class in qiskit-terra (along with the rest of the legacy
provider interface) is deprecated and being removed soon in
Qiskit/qiskit#7886. To avoid potential compatibility issues or
deprecation warnings we shouldn't be using this class anymore. This
commit removes the last 2 uses of these legacy classes to avoid issues
moving forward.

Co-authored-by: Hiroshi Horii <hhorii@users.noreply.github.com>
(cherry picked from commit 07a8532)
mtreinish added a commit to mtreinish/qiskit-core that referenced this pull request Apr 8, 2022
This commit updates the FakeBackend and FakeBackendV2 classes
(FakeLegacyBackend is being removed in Qiskit#7886) to only build a noise
model from the stored properties one. This is done by initializing the
internal simulator object only once at storing it as an instance
attribute. The noise model is then constructed once at object
initialization and used to update the backend at the same time.

Fixes Qiskit#7500
Fixes Qiskit#7911
jakelishman
jakelishman previously approved these changes Apr 14, 2022
mergify bot added a commit that referenced this pull request Apr 19, 2022
* Initialize simulator at FakeBackend inititialization

This commit updates the FakeBackend and FakeBackendV2 classes
(FakeLegacyBackend is being removed in #7886) to only build a noise
model from the stored properties one. This is done by initializing the
internal simulator object only once at storing it as an instance
attribute. The noise model is then constructed once at object
initialization and used to update the backend at the same time.

Fixes #7500
Fixes #7911

* Lazy load simulator backend objects and properties

This commit fixes another regression introduced in the previous commit
around the import and __init__ performance of fake backends. By parsing
the properties payload and creating a noise model we significantly
slowed down the initialization of fake backend objects. This commit
fixes this by ensuring we are lazy loading the noise model and simulator
object creation as well as not parsing the properties (or defaults)
payloads until we actually need them.

* Use qubit properties in target for backendv2

* Filter all noise model warnings

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
mergify bot pushed a commit that referenced this pull request Apr 19, 2022
* Initialize simulator at FakeBackend inititialization

This commit updates the FakeBackend and FakeBackendV2 classes
(FakeLegacyBackend is being removed in #7886) to only build a noise
model from the stored properties one. This is done by initializing the
internal simulator object only once at storing it as an instance
attribute. The noise model is then constructed once at object
initialization and used to update the backend at the same time.

Fixes #7500
Fixes #7911

* Lazy load simulator backend objects and properties

This commit fixes another regression introduced in the previous commit
around the import and __init__ performance of fake backends. By parsing
the properties payload and creating a noise model we significantly
slowed down the initialization of fake backend objects. This commit
fixes this by ensuring we are lazy loading the noise model and simulator
object creation as well as not parsing the properties (or defaults)
payloads until we actually need them.

* Use qubit properties in target for backendv2

* Filter all noise model warnings

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
(cherry picked from commit 57f16ab)
mergify bot added a commit that referenced this pull request Apr 19, 2022
* Initialize simulator at FakeBackend inititialization

This commit updates the FakeBackend and FakeBackendV2 classes
(FakeLegacyBackend is being removed in #7886) to only build a noise
model from the stored properties one. This is done by initializing the
internal simulator object only once at storing it as an instance
attribute. The noise model is then constructed once at object
initialization and used to update the backend at the same time.

Fixes #7500
Fixes #7911

* Lazy load simulator backend objects and properties

This commit fixes another regression introduced in the previous commit
around the import and __init__ performance of fake backends. By parsing
the properties payload and creating a noise model we significantly
slowed down the initialization of fake backend objects. This commit
fixes this by ensuring we are lazy loading the noise model and simulator
object creation as well as not parsing the properties (or defaults)
payloads until we actually need them.

* Use qubit properties in target for backendv2

* Filter all noise model warnings

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
(cherry picked from commit 57f16ab)

Co-authored-by: Matthew Treinish <mtreinish@kortar.org>
@jakelishman
Copy link
Member

@mtreinish: looks like this had an unfortunate CI timeout, and now there's a merge conflict.

@mergify mergify bot merged commit ad4283e into Qiskit:main Apr 19, 2022
@mtreinish mtreinish deleted the drop-base-backend branch April 20, 2022 11:26
ElePT pushed a commit to ElePT/qiskit that referenced this pull request Jun 27, 2023
* Remove legacy providers interface

This commit removes the legacy providers interface from terra. This
includes the BaseBackend, BaseJob, BaseProvider abstract classes and
everything that inherits from them in the tree. These classes were
deprecated as part of qiskit-terra 0.18.0 and have been supersceded by
the versioned provider interface and all providers should have migrated
by now to these new supported interface. This also means we no longer
support the qobj execution path and QuantumCircuit and Schedule objects
are used directly everywhere for running. In the future we can look at
deprecating and removing the assemble() function and qobj class in the
future as nothing in tree is using them directly. But before we can
deprecate these the IBM provider and aer will need to have native
implementations.

* Drop handling for incorrect backend.version in BaseBackend

Now that BaseBackend is no longer in qiskit we don't need to special
handle the case where backend.version is not the interface version
(since it was a method in BaseBackend). This commit drops the handling
for this and uses the interface for the versioned interface as it was
originally intended.

* Fix lint

* Fix typo causing test failures

The tests were failing because one of the default values for getting the
backend version attribute was None instead of 0 causing a type error
when an integer was expected. This was not caught previously because the
BaseBackend handling checked for non integer versions and converted
those to 0. However, now without BaseBackend we need to be more explicit
and use an integer for the backend interface version.

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
ElePT pushed a commit to ElePT/qiskit-algorithms-test that referenced this pull request Jul 17, 2023
* Remove legacy providers interface

This commit removes the legacy providers interface from terra. This
includes the BaseBackend, BaseJob, BaseProvider abstract classes and
everything that inherits from them in the tree. These classes were
deprecated as part of qiskit-terra 0.18.0 and have been supersceded by
the versioned provider interface and all providers should have migrated
by now to these new supported interface. This also means we no longer
support the qobj execution path and QuantumCircuit and Schedule objects
are used directly everywhere for running. In the future we can look at
deprecating and removing the assemble() function and qobj class in the
future as nothing in tree is using them directly. But before we can
deprecate these the IBM provider and aer will need to have native
implementations.

* Drop handling for incorrect backend.version in BaseBackend

Now that BaseBackend is no longer in qiskit we don't need to special
handle the case where backend.version is not the interface version
(since it was a method in BaseBackend). This commit drops the handling
for this and uses the interface for the versioned interface as it was
originally intended.

* Fix lint

* Fix typo causing test failures

The tests were failing because one of the default values for getting the
backend version attribute was None instead of 0 causing a type error
when an integer was expected. This was not caught previously because the
BaseBackend handling checked for non integer versions and converted
those to 0. However, now without BaseBackend we need to be more explicit
and use an integer for the backend interface version.

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
ElePT pushed a commit to ElePT/qiskit-algorithms that referenced this pull request Jul 27, 2023
* Remove legacy providers interface

This commit removes the legacy providers interface from terra. This
includes the BaseBackend, BaseJob, BaseProvider abstract classes and
everything that inherits from them in the tree. These classes were
deprecated as part of qiskit-terra 0.18.0 and have been supersceded by
the versioned provider interface and all providers should have migrated
by now to these new supported interface. This also means we no longer
support the qobj execution path and QuantumCircuit and Schedule objects
are used directly everywhere for running. In the future we can look at
deprecating and removing the assemble() function and qobj class in the
future as nothing in tree is using them directly. But before we can
deprecate these the IBM provider and aer will need to have native
implementations.

* Drop handling for incorrect backend.version in BaseBackend

Now that BaseBackend is no longer in qiskit we don't need to special
handle the case where backend.version is not the interface version
(since it was a method in BaseBackend). This commit drops the handling
for this and uses the interface for the versioned interface as it was
originally intended.

* Fix lint

* Fix typo causing test failures

The tests were failing because one of the default values for getting the
backend version attribute was None instead of 0 causing a type error
when an integer was expected. This was not caught previously because the
BaseBackend handling checked for non integer versions and converted
those to 0. However, now without BaseBackend we need to be more explicit
and use an integer for the backend interface version.

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
ElePT pushed a commit to ElePT/qiskit-ibm-provider that referenced this pull request Oct 4, 2023
* Remove legacy providers interface

This commit removes the legacy providers interface from terra. This
includes the BaseBackend, BaseJob, BaseProvider abstract classes and
everything that inherits from them in the tree. These classes were
deprecated as part of qiskit-terra 0.18.0 and have been supersceded by
the versioned provider interface and all providers should have migrated
by now to these new supported interface. This also means we no longer
support the qobj execution path and QuantumCircuit and Schedule objects
are used directly everywhere for running. In the future we can look at
deprecating and removing the assemble() function and qobj class in the
future as nothing in tree is using them directly. But before we can
deprecate these the IBM provider and aer will need to have native
implementations.

* Drop handling for incorrect backend.version in BaseBackend

Now that BaseBackend is no longer in qiskit we don't need to special
handle the case where backend.version is not the interface version
(since it was a method in BaseBackend). This commit drops the handling
for this and uses the interface for the versioned interface as it was
originally intended.

* Fix lint

* Fix typo causing test failures

The tests were failing because one of the default values for getting the
backend version attribute was None instead of 0 causing a type error
when an integer was expected. This was not caught previously because the
BaseBackend handling checked for non integer versions and converted
those to 0. However, now without BaseBackend we need to be more explicit
and use an integer for the backend interface version.

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
ElePT pushed a commit to ElePT/qiskit-ibm-provider that referenced this pull request Oct 9, 2023
* Remove legacy providers interface

This commit removes the legacy providers interface from terra. This
includes the BaseBackend, BaseJob, BaseProvider abstract classes and
everything that inherits from them in the tree. These classes were
deprecated as part of qiskit-terra 0.18.0 and have been supersceded by
the versioned provider interface and all providers should have migrated
by now to these new supported interface. This also means we no longer
support the qobj execution path and QuantumCircuit and Schedule objects
are used directly everywhere for running. In the future we can look at
deprecating and removing the assemble() function and qobj class in the
future as nothing in tree is using them directly. But before we can
deprecate these the IBM provider and aer will need to have native
implementations.

* Drop handling for incorrect backend.version in BaseBackend

Now that BaseBackend is no longer in qiskit we don't need to special
handle the case where backend.version is not the interface version
(since it was a method in BaseBackend). This commit drops the handling
for this and uses the interface for the versioned interface as it was
originally intended.

* Fix lint

* Fix typo causing test failures

The tests were failing because one of the default values for getting the
backend version attribute was None instead of 0 causing a type error
when an integer was expected. This was not caught previously because the
BaseBackend handling checked for non integer versions and converted
those to 0. However, now without BaseBackend we need to be more explicit
and use an integer for the backend interface version.

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
ElePT pushed a commit to ElePT/qiskit-ibm-runtime that referenced this pull request Oct 10, 2023
* Remove legacy providers interface

This commit removes the legacy providers interface from terra. This
includes the BaseBackend, BaseJob, BaseProvider abstract classes and
everything that inherits from them in the tree. These classes were
deprecated as part of qiskit-terra 0.18.0 and have been supersceded by
the versioned provider interface and all providers should have migrated
by now to these new supported interface. This also means we no longer
support the qobj execution path and QuantumCircuit and Schedule objects
are used directly everywhere for running. In the future we can look at
deprecating and removing the assemble() function and qobj class in the
future as nothing in tree is using them directly. But before we can
deprecate these the IBM provider and aer will need to have native
implementations.

* Drop handling for incorrect backend.version in BaseBackend

Now that BaseBackend is no longer in qiskit we don't need to special
handle the case where backend.version is not the interface version
(since it was a method in BaseBackend). This commit drops the handling
for this and uses the interface for the versioned interface as it was
originally intended.

* Fix lint

* Fix typo causing test failures

The tests were failing because one of the default values for getting the
backend version attribute was None instead of 0 causing a type error
when an integer was expected. This was not caught previously because the
BaseBackend handling checked for non integer versions and converted
those to 0. However, now without BaseBackend we need to be more explicit
and use an integer for the backend interface version.

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
ElePT pushed a commit to ElePT/qiskit that referenced this pull request Oct 12, 2023
* Remove legacy providers interface

This commit removes the legacy providers interface from terra. This
includes the BaseBackend, BaseJob, BaseProvider abstract classes and
everything that inherits from them in the tree. These classes were
deprecated as part of qiskit-terra 0.18.0 and have been supersceded by
the versioned provider interface and all providers should have migrated
by now to these new supported interface. This also means we no longer
support the qobj execution path and QuantumCircuit and Schedule objects
are used directly everywhere for running. In the future we can look at
deprecating and removing the assemble() function and qobj class in the
future as nothing in tree is using them directly. But before we can
deprecate these the IBM provider and aer will need to have native
implementations.

* Drop handling for incorrect backend.version in BaseBackend

Now that BaseBackend is no longer in qiskit we don't need to special
handle the case where backend.version is not the interface version
(since it was a method in BaseBackend). This commit drops the handling
for this and uses the interface for the versioned interface as it was
originally intended.

* Fix lint

* Fix typo causing test failures

The tests were failing because one of the default values for getting the
backend version attribute was None instead of 0 causing a type error
when an integer was expected. This was not caught previously because the
BaseBackend handling checked for non integer versions and converted
those to 0. However, now without BaseBackend we need to be more explicit
and use an integer for the backend interface version.

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changelog: Deprecation Include in "Deprecated" section of changelog Changelog: Removal Include in the Removed section of the changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants