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

Deprecate BackendV1 and qiskit.providers.models (backport #12629) #12864

Merged
merged 3 commits into from
Jul 31, 2024

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Jul 31, 2024

Summary

Time to deprecate BackendV1 in favor of Target (for hardware description) and primitives (for execution). We should still keep BackendV2 as a supported alternative.

This requieres (i.e this branch is on top of these PRs, only makes sense once they are merged. Therefore on hold):

once this one is merged, the rest of the _assemble code needs to be cleaned. Hopefully, it can be done after the release of this PR.


This is an automatic backport of pull request #12629 done by Mergify.

* initial commit

* reno

* Apply suggestions from code review

* deprecate qobj and assemble

* reno

* first attempt on Fake1QV2

* deprecate Fake1Q

* Fake1QV2 should not have two-qubit gates

Co-authored-by: Elena Peña Tapia <57907331+ElePT@users.noreply.github.com>

* test.python.circuit.test_parameters.TestParameters

* test.python.providers.fake_provider.test_fake_backends.FakeBackendsTest

* test.python.providers.test_fake_backends.TestFakeBackends

* test.python.result.test_mitigators

* test.python.transpiler.test_preset_passmanagers

* test.python.transpiler.test_target

* test.python.transpiler.test_unitary_synthesis

* test.python.transpiler.test_vf2_layout

* test.python.transpiler.test_vf2_post_layout

* test/python/visualization/test_circuit_latex

* test.python.transpiler.test_sabre_layout

* test.python.transpiler.test_sabre_layout

* test.python.transpiler.test_pulse_gate_pass

* test.python.scheduler.test_basic_scheduler.TestBasicSchedule

* test.python.pulse.test_transforms

* test.python.pulse.test_schedule

* test.python.pulse.test_macros

* test.python.pulse.test_instruction_schedule_map

* test.python.pulse.test_block

* test.python.circuit.test_scheduled_circuit

* test.python.transpiler.test_calibrationbuilder

* test.python.providers.test_backendconfiguration

* test.python.compiler.test_transpiler

* test.python.transpiler.test_passmanager_run

* test.python.transpiler.test_passmanager_config.TestPassManagerConfig.test_from_backend_and_user

* test.python.transpiler.test_passmanager_config

* test.python.primitives.test_backend_estimator.TestBackendEstimator

* test.python.circuit.test_scheduled_circuit.TestScheduledCircuit.test_schedule_circuit_when_backend_tells_dt

* test.python.circuit.test_scheduled_circuit

* test.python.transpiler.test_vf2_layout

* shallow deprecation of assemble

* test.python.compiler.test_disassembler

* fakebackend pulse

* test.python.circuit.test_parameters

* PulseQobjInstruction  is used by GenericBackendV2

* test.python.scheduler.test_basic_scheduler

* test.python.result.test_result

* test.python.pulse.test_calibration_entries

* test.python.compiler.test_assembler

* test.python.transpiler.test_star_prerouting

* test.python.pulse.test_instruction_schedule_map

* test.python.providers.basic_provider.test_basic_simulator

* test.python.primitives.test_backend_sampler_v2

* test.python.compiler.test_disassembler

* test.python.compiler.test_compiler

* test.python.circuit.test_scheduled_circuit

* test.python.providers.test_fake_backends

* test.python.circuit.test_unitary

* test.python.transpiler.test_sabre_swap

* test.python.providers.fake_provider.test_fake_backends

* Aer using Provider ABC

* aer warnings

* reno

* another pass on reno

* test.python.pulse

* test.python.compiler.test_compiler

* add module to fiterwarning

* test.python.compiler.test_transpiler

* fixing obscure expcetion handleing for comparison

* test.python.transpiler.test_stochastic_swap test.python.transpiler.test_sabre_swap

* test.python.transpiler.test_echo_rzx_weyl_decomposition

* test.python.transpiler.test_instruction_durations

* test.python.providers.test_backendproperties

* test.python.qpy.test_circuit_load_from_qpy

* test.python.providers.test_pulse_defaults

* test.python.primitives.test_backend_sampler_v2

* test.python.primitives.test_backend_sampler

* test.python.compiler.test_scheduler

* test/python/compiler/test_scheduler.py

* test.python.compiler.test_disassembler

* test.python.compiler.test_assembler

* test.python.compiler.test_sequencer

* test.python.compiler.test_transpiler

* test.python.primitives.test_primitive

* better depreaction handleling from Aer

* test.python.primitives.test_backend_estimator_v2

* test.python.compiler.test_compiler

* ignore warnings, because the output is otherwise very verbose

* ignore to avoid fludding the CI log

* seeding all GenericBackendV2

* test.python.visualization.test_gate_map

* deprecation warnings: once

* default

* default

* BackendConfiguration

* PulseBackendConfiguration

* QasmBackendConfiguration

* QasmBackendConfiguration and adjust stacklevel

* UchannelLO

* GateConfig

* test.python.providers.test_fake_backends.TestFakeBackends

* test.python.providers.test_fake_backends

* test.python.compiler.test_transpiler

* remove catch

* Apply suggestions from code review

Co-authored-by: Elena Peña Tapia <57907331+ElePT@users.noreply.github.com>

* remove catch

* new deprecate warning message

* lint qiskit/assembler/assemble_circuits.py

* concurrency warnings

* ignore aer warnings

* Update test/python/providers/fake_provider/test_fake_backends.py

Co-authored-by: Elena Peña Tapia <57907331+ElePT@users.noreply.github.com>

* Update test/python/circuit/test_parameters.py

Co-authored-by: Elena Peña Tapia <57907331+ElePT@users.noreply.github.com>

* Update qiskit/providers/models/pulsedefaults.py

Co-authored-by: Elena Peña Tapia <57907331+ElePT@users.noreply.github.com>

* Update test/python/providers/fake_provider/test_fake_backends.py

Co-authored-by: Elena Peña Tapia <57907331+ElePT@users.noreply.github.com>

* Update test/python/providers/fake_provider/test_generic_backend_v2.py

Co-authored-by: Elena Peña Tapia <57907331+ElePT@users.noreply.github.com>

* lint

* #12649 (comment)

* #12649 (comment)

* Update test/python/transpiler/test_sabre_swap.py

Co-authored-by: Elena Peña Tapia <57907331+ElePT@users.noreply.github.com>

* Update qiskit/providers/models/pulsedefaults.py

Co-authored-by: Elena Peña Tapia <57907331+ElePT@users.noreply.github.com>

* ignore Treating CircuitInstruction...

* another unnecessary catch from aer

* another unnecessary catch from aer, again

* removing more unnecesary catches

* less lines

* seeding

* remove those comments

* test.python.compiler.test_transpiler.TestTranspile.test_scheduling_timing_constraints

* tokyo cmap

* test.python.circuit.test_scheduled_circuit.TestScheduledCircuit.test_schedule_circuit_when_backend_tells_dt

* comment in test_sequencer.py

* test.python.compiler.test_transpiler.TestPostTranspileIntegration.test_qasm3_output

* Update test/python/primitives/test_primitive.py

Co-authored-by: Elena Peña Tapia <57907331+ElePT@users.noreply.github.com>

* test/python/providers/test_backendconfiguration.py:30

* test.python.primitives.test_backend_sampler

* restore the assertWarns, waiting for #12818

* use legacy_cmaps instead of explict coupling maps

* use more legacy_map

* KYOTO_CMAP

* more legacy_cmap

* #12832

* test.python.transpiler.test_vf2_post_layout

* comma

* #12660 (comment)

* do not deprecate BackendV2Converter yet

* test.python.providers.test_faulty_backend

* test.python.compiler.test_transpiler.TestTranspile

* cleaning up warnings

* no deprecation in test/python/compiler/test_transpiler.py

* Apply suggestions from code review

Co-authored-by: Elena Peña Tapia <57907331+ElePT@users.noreply.github.com>

* reno lint

* adding models in reno

* black

* test.python.transpiler.test_preset_passmanagers

* seeding GenericBackendV2

* less Fake5QV1

* test.python.transpiler.test_sabre_layout

* test.python.transpiler.test_pulse_gate_pass

* test.python.pulse.test_builder

* test.python.primitives.test_backend_sampler_v2

* test.python.primitives.test_backend_sampler_v2

* test.python.primitives.test_backend_estimator_v2

* test.python.compiler.test_transpiler

* Apply suggestions from code review

Co-authored-by: Elena Peña Tapia <57907331+ElePT@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Elena Peña Tapia <57907331+ElePT@users.noreply.github.com>

* test.python.primitives.test_backend_estimator_v2.TestBackendEstimatorV2

* test.python.primitives.test_backend_estimator_v2

* Fix expected_regex in transpile tests

* Fix missing assertions in:

* test.python.circuit.test_scheduled_circuit

* test.python.compiler.test_sequencer

* test.python.circuit.test_parameters

* test.python.primitives.test_backend_sampler_v2

* test.python.primitives.test_backend_sampler

* Fix line-too-long lint complaints

---------

Co-authored-by: Elena Peña Tapia <57907331+ElePT@users.noreply.github.com>
Co-authored-by: Elena Peña Tapia <epenatap@gmail.com>
(cherry picked from commit a6ec8b9)

# Conflicts:
#	qiskit/transpiler/target.py
#	test/python/pulse/test_builder.py
@mergify mergify bot requested review from a team, nonhermitian and eggerdj as code owners July 31, 2024 11:34
@mergify mergify bot added the conflicts used by mergify when there are conflicts in a port label Jul 31, 2024
@mergify mergify bot requested a review from wshanks as a code owner July 31, 2024 11:34
Copy link
Contributor Author

mergify bot commented Jul 31, 2024

Cherry-pick of a6ec8b9 has failed:

On branch mergify/bp/stable/1.2/pr-12629
Your branch is up to date with 'origin/stable/1.2'.

You are currently cherry-picking commit a6ec8b9ad.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	modified:   qiskit/circuit/add_control.py
	modified:   qiskit/compiler/transpiler.py
	modified:   qiskit/providers/backend.py
	modified:   qiskit/providers/backend_compat.py
	modified:   qiskit/providers/basic_provider/basic_simulator.py
	modified:   qiskit/providers/fake_provider/fake_qasm_backend.py
	modified:   qiskit/providers/models/__init__.py
	modified:   qiskit/providers/models/backendconfiguration.py
	modified:   qiskit/providers/models/backendproperties.py
	modified:   qiskit/transpiler/preset_passmanagers/__init__.py
	modified:   qiskit/transpiler/preset_passmanagers/generate_preset_pass_manager.py
	modified:   qiskit/utils/deprecation.py
	new file:   releasenotes/notes/backendv1-d0d0642ed38fed3c.yaml
	modified:   test/python/circuit/test_parameters.py
	modified:   test/python/circuit/test_scheduled_circuit.py
	modified:   test/python/compiler/test_sequencer.py
	modified:   test/python/compiler/test_transpiler.py
	modified:   test/python/primitives/test_backend_estimator_v2.py
	modified:   test/python/primitives/test_backend_sampler.py
	modified:   test/python/primitives/test_backend_sampler_v2.py
	modified:   test/python/providers/test_fake_backends.py
	modified:   test/python/providers/test_faulty_backend.py
	modified:   test/python/transpiler/test_calibrationbuilder.py
	modified:   test/python/transpiler/test_gates_in_basis_pass.py
	modified:   test/python/transpiler/test_passmanager_run.py
	modified:   test/python/transpiler/test_preset_passmanagers.py
	modified:   test/python/transpiler/test_pulse_gate_pass.py
	modified:   test/python/transpiler/test_sabre_layout.py
	modified:   test/python/transpiler/test_sabre_swap.py
	modified:   test/python/transpiler/test_unitary_synthesis.py
	modified:   test/python/transpiler/test_vf2_post_layout.py
	modified:   test/python/visualization/test_circuit_latex.py
	modified:   test/utils/base.py

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   qiskit/transpiler/target.py
	both modified:   test/python/pulse/test_builder.py

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

@mergify mergify bot requested a review from jyu00 as a code owner July 31, 2024 11:34
@qiskit-bot
Copy link
Collaborator

Thank you for opening a new pull request.

Before your PR can be merged it will first need to pass continuous integration tests and be reviewed. Sometimes the review process can be slow, so please be patient.

While you're waiting, please feel free to review other open PRs. While only a subset of people are authorized to approve pull requests for merging, everyone is encouraged to review open pull requests. Doing reviews helps reduce the burden on the core team and helps make the project's code better for everyone.

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

  • @enavarro51
  • @Qiskit/terra-core
  • @ajavadia
  • @levbishop
  • @nkanazawa1989
  • @t-imamichi

@github-actions github-actions bot added priority: high Changelog: Deprecation Include in "Deprecated" section of changelog labels Jul 31, 2024
@github-actions github-actions bot added this to the 1.2.0 milestone Jul 31, 2024
@1ucian0 1ucian0 removed the conflicts used by mergify when there are conflicts in a port label Jul 31, 2024
@1ucian0 1ucian0 enabled auto-merge July 31, 2024 13:12
@coveralls
Copy link

Pull Request Test Coverage Report for Build 10180597556

Details

  • 45 of 45 (100.0%) changed or added relevant lines in 12 files are covered.
  • 13 unchanged lines in 3 files lost coverage.
  • Overall coverage increased (+0.02%) to 89.857%

Files with Coverage Reduction New Missed Lines %
crates/qasm2/src/lex.rs 2 92.73%
qiskit/transpiler/passes/layout/vf2_post_layout.py 5 86.46%
crates/qasm2/src/parse.rs 6 97.61%
Totals Coverage Status
Change from base Build 10168948981: 0.02%
Covered Lines: 66453
Relevant Lines: 73954

💛 - Coveralls

@1ucian0 1ucian0 added this pull request to the merge queue Jul 31, 2024
Merged via the queue into stable/1.2 with commit bb08208 Jul 31, 2024
17 checks passed
@mergify mergify bot deleted the mergify/bp/stable/1.2/pr-12629 branch July 31, 2024 14:46
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 priority: high
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants