From 30b2ef23eead2a93bec818d316768274e3d6c87b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elena=20Pe=C3=B1a=20Tapia?= Date: Mon, 3 Mar 2025 10:25:46 +0100 Subject: [PATCH 01/21] Initial content dump, reformatting table --- .../qiskit-backendv1-to-v2.mdx | 54 +++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 docs/migration-guides/qiskit-backendv1-to-v2.mdx diff --git a/docs/migration-guides/qiskit-backendv1-to-v2.mdx b/docs/migration-guides/qiskit-backendv1-to-v2.mdx new file mode 100644 index 00000000000..7acfa14654c --- /dev/null +++ b/docs/migration-guides/qiskit-backendv1-to-v2.mdx @@ -0,0 +1,54 @@ +--- +title: backendv1 migration guide +description: How to update your code to use `BackendV2` instead of `BackendV1`. +--- + +# Migrate from `BackendV1` to `BackendV2` + +The [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2) class re-defined +user access for most properties of a +backend to make them work with native Qiskit data structures and have flatter +access patterns. However this means when using a provider that upgrades +from [`BackendV1`](/api/qiskit/0.46/qiskit.providers.BackendV1) to +[`BackendV2`](/api/qiskit/qiskit.providers.BackendV2) existing access patterns will need +to be adjusted. It is expected for existing providers to deprecate the old +access where possible to provide a graceful migration, but eventually users +will need to adjust code. + +The biggest change to adapt to in [`CouplingMap`](/api/qiskit/qiskit.transpiler.CouplingMap) is +that most of the information accessible about a backend is contained in its +[`Target`](/api/qiskit/qiskit.transpiler.Target) object and the backend's attributes often query +its `BackendV2.target` attribute to return information, however in many cases the attributes only provide +a subset of information the target can contain. For example, `backend.coupling_map` +returns a [`CouplingMap`](/api/qiskit/qiskit.transpiler.CouplingMap) constructed from the +[`Target`](/api/qiskit/qiskit.transpiler.Target) accessible in the +`BackendV2.target` attribute, however the target may contain +instructions that operate on more than two qubits (which can't be represented in a +[`CouplingMap`](/api/qiskit/qiskit.transpiler.CouplingMap)) or has instructions that only operate on +a subset of qubits (or two qubit links for a two qubit instruction) which won't be +detailed in the full coupling map returned by +`BackendV2.coupling_map`. So depending on your use case +it might be necessary to look deeper than just the equivalent access with +[`BackendV2`](/api/qiskit/qiskit.providers.BackendV2). + +Below is a table of example access patterns in [`BackendV1`](/api/qiskit/0.46/qiskit.providers.BackendV1) and the new form +with [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2): + +|[`BackendV1`](/api/qiskit/0.46/qiskit.providers.BackendV1) | [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2) | Notes | +| --- | --- | --- | +|`backend.configuration().n_qubits` | `backend.num_qubits`| | +|`backend.configuration().coupling_map` | `backend.coupling_map` | The return from :obj:`~BackendV2` is a :class:`~qiskit.transpiler.CouplingMap` object. while in :obj:`~BackendV1` it is an edge list. Also this is just a view of the information contained in ``backend.target`` which may only be a subset of the information contained in :class:`~qiskit.transpiler.Target` object. | +|`backend.configuration().backend_name` | `backend.name` | | +|`backend.configuration().backend_version` | `backend.backend_version` | The :attr:`~qiskit.providers.BackendV2.version` attribute represents the version of the abstract :class:`~qiskit.providers.Backend` interface the object implements while :attr:`~qiskit.providers.BackendV2.backend_version` is metadata about the version of the backend itself. | +|`backend.configuration().basis_gates` | `backend.operation_names` | The :obj:`~BackendV2` return is a list of operation names contained in the ``backend.target`` attribute. The :class:`~qiskit.transpiler.Target` may contain more information that can be expressed by this list of names. For example, that some operations only work on a subset of qubits or that some names implement the same gate with different parameters.| +|`backend.configuration().dt`|`backend.dt`| | +|`backend.configuration().dtm`|`backend.dtm` | | +|`backend.configuration().max_experiments` |`backend.max_circuits` | | +|`backend.configuration().online_date` | `backend.online_date`| | +|`InstructionDurations.from_backend(backend)`|`backend.instruction_durations`| | +|`backend.defaults().instruction_schedule_map`|`backend.instruction_schedule_map`| | +|`backend.properties().t1(0)`|`backend.qubit_properties(0).t1`| | +|`backend.properties().t2(0)`|`backend.qubit_properties(0).t2`| | +|`backend.properties().frequency(0)`|`backend.qubit_properties(0).frequency`| | +|`backend.properties().readout_error(0)`|`backend.target["measure"][(0,)].error`| In :obj:`~BackendV2` the error rate for the :class:`~qiskit.circuit.library.Measure` operation on a given qubit is used to model the readout error. However a :obj:`~BackendV2` can implement multiple measurement types and list them separately in a :class:`~qiskit.transpiler.Target`.| +|`backend.properties().readout_length(0)`|`backend.target["measure"][(0,)].duration`| In :obj:`~BackendV2` the duration for the :class:`~qiskit.circuit.library.Measure` operation on a given qubit is used to model the readout length. However, a :obj:`~BackendV2` can implement multiple measurement types and list them separately in a :class:`~qiskit.transpiler.Target`.| \ No newline at end of file From 2eba19d66726b7f0a36f6e07852b37bdbdc712dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elena=20Pe=C3=B1a=20Tapia?= Date: Mon, 3 Mar 2025 13:42:21 +0100 Subject: [PATCH 02/21] Update missing API ref links --- docs/migration-guides/qiskit-backendv1-to-v2.mdx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/migration-guides/qiskit-backendv1-to-v2.mdx b/docs/migration-guides/qiskit-backendv1-to-v2.mdx index 7acfa14654c..ef0591f9c0e 100644 --- a/docs/migration-guides/qiskit-backendv1-to-v2.mdx +++ b/docs/migration-guides/qiskit-backendv1-to-v2.mdx @@ -37,10 +37,10 @@ with [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2): |[`BackendV1`](/api/qiskit/0.46/qiskit.providers.BackendV1) | [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2) | Notes | | --- | --- | --- | |`backend.configuration().n_qubits` | `backend.num_qubits`| | -|`backend.configuration().coupling_map` | `backend.coupling_map` | The return from :obj:`~BackendV2` is a :class:`~qiskit.transpiler.CouplingMap` object. while in :obj:`~BackendV1` it is an edge list. Also this is just a view of the information contained in ``backend.target`` which may only be a subset of the information contained in :class:`~qiskit.transpiler.Target` object. | +|`backend.configuration().coupling_map` | `backend.coupling_map` | The return from [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2) is a [`CouplingMap`](/api/qiskit/qiskit.transpiler.CouplingMap) object. while in [`BackendV1`](/api/qiskit/0.46/qiskit.providers.BackendV1) it is an edge list. Also this is just a view of the information contained in `backend.target` which may only be a subset of the information contained in the [`Target`](/api/qiskit/qiskit.transpiler.Target) object. | |`backend.configuration().backend_name` | `backend.name` | | -|`backend.configuration().backend_version` | `backend.backend_version` | The :attr:`~qiskit.providers.BackendV2.version` attribute represents the version of the abstract :class:`~qiskit.providers.Backend` interface the object implements while :attr:`~qiskit.providers.BackendV2.backend_version` is metadata about the version of the backend itself. | -|`backend.configuration().basis_gates` | `backend.operation_names` | The :obj:`~BackendV2` return is a list of operation names contained in the ``backend.target`` attribute. The :class:`~qiskit.transpiler.Target` may contain more information that can be expressed by this list of names. For example, that some operations only work on a subset of qubits or that some names implement the same gate with different parameters.| +|`backend.configuration().backend_version` | `backend.backend_version` | The `BackendV2.version` attribute represents the version of the abstract [`Backend`](/api/qiskit/qiskit.providers.Backend) interface the object implements while `BackendV2.backend_version` is metadata about the version of the backend itself. | +|`backend.configuration().basis_gates` | `backend.operation_names` | The [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2) return is a list of operation names contained in the ``backend.target`` attribute. The [`Target`](/api/qiskit/qiskit.transpiler.Target) may contain more information that can be expressed by this list of names. For example, that some operations only work on a subset of qubits or that some names implement the same gate with different parameters.| |`backend.configuration().dt`|`backend.dt`| | |`backend.configuration().dtm`|`backend.dtm` | | |`backend.configuration().max_experiments` |`backend.max_circuits` | | @@ -50,5 +50,5 @@ with [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2): |`backend.properties().t1(0)`|`backend.qubit_properties(0).t1`| | |`backend.properties().t2(0)`|`backend.qubit_properties(0).t2`| | |`backend.properties().frequency(0)`|`backend.qubit_properties(0).frequency`| | -|`backend.properties().readout_error(0)`|`backend.target["measure"][(0,)].error`| In :obj:`~BackendV2` the error rate for the :class:`~qiskit.circuit.library.Measure` operation on a given qubit is used to model the readout error. However a :obj:`~BackendV2` can implement multiple measurement types and list them separately in a :class:`~qiskit.transpiler.Target`.| -|`backend.properties().readout_length(0)`|`backend.target["measure"][(0,)].duration`| In :obj:`~BackendV2` the duration for the :class:`~qiskit.circuit.library.Measure` operation on a given qubit is used to model the readout length. However, a :obj:`~BackendV2` can implement multiple measurement types and list them separately in a :class:`~qiskit.transpiler.Target`.| \ No newline at end of file +|`backend.properties().readout_error(0)`|`backend.target["measure"][(0,)].error`| In [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2) the error rate for the [`Measure`](/api/qiskit/qiskit.circuit.library.Measure) operation on a given qubit is used to model the readout error. However a [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2) can implement multiple measurement types and list them separately in a [`Target`](/api/qiskit/qiskit.transpiler.Target).| +|`backend.properties().readout_length(0)`|`backend.target["measure"][(0,)].duration`| In [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2) the duration for the [`Measure`](/api/qiskit/qiskit.circuit.library.Measure) operation on a given qubit is used to model the readout length. However, a [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2) can implement multiple measurement types and list them separately in a [`Target`](/api/qiskit/qiskit.transpiler.Target).| \ No newline at end of file From f7ace6f2cd6579b147f09b38af443498b6dfc446 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elena=20Pe=C3=B1a=20Tapia?= Date: Mon, 3 Mar 2025 15:32:17 +0100 Subject: [PATCH 03/21] Configure qiskit_bot --- qiskit_bot.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/qiskit_bot.yaml b/qiskit_bot.yaml index 7c58a9aeeee..e12d3d2301c 100644 --- a/qiskit_bot.yaml +++ b/qiskit_bot.yaml @@ -284,6 +284,8 @@ notifications: - "@ElePT" "docs/migration-guides/qiskit-quantum-instance": - "@ElePT" + "docs/migration-guides/qiskit-backend-v1-to-v2": + - "@ElePT" "docs/migration-guides/qiskit-runtime": - "@beckykd" - "@jyu00" From 917ce0fc7903471ac08552bf4a0fa89ca8b50d4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elena=20Pe=C3=B1a=20Tapia?= Date: Mon, 3 Mar 2025 15:41:20 +0100 Subject: [PATCH 04/21] Configure qiskit_bot --- qiskit_bot.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qiskit_bot.yaml b/qiskit_bot.yaml index e12d3d2301c..71b5befa110 100644 --- a/qiskit_bot.yaml +++ b/qiskit_bot.yaml @@ -284,7 +284,7 @@ notifications: - "@ElePT" "docs/migration-guides/qiskit-quantum-instance": - "@ElePT" - "docs/migration-guides/qiskit-backend-v1-to-v2": + "docs/migration-guides/qiskit-backendv1-to-v2": - "@ElePT" "docs/migration-guides/qiskit-runtime": - "@beckykd" From 86ba9631c4930ffdfba14e2a7aec728e7ca9a485 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elena=20Pe=C3=B1a=20Tapia?= Date: Mon, 3 Mar 2025 15:48:14 +0100 Subject: [PATCH 05/21] Fix broken links --- docs/migration-guides/qiskit-backendv1-to-v2.mdx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/migration-guides/qiskit-backendv1-to-v2.mdx b/docs/migration-guides/qiskit-backendv1-to-v2.mdx index ef0591f9c0e..d80197d1cf7 100644 --- a/docs/migration-guides/qiskit-backendv1-to-v2.mdx +++ b/docs/migration-guides/qiskit-backendv1-to-v2.mdx @@ -9,7 +9,7 @@ The [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2) class re-defined user access for most properties of a backend to make them work with native Qiskit data structures and have flatter access patterns. However this means when using a provider that upgrades -from [`BackendV1`](/api/qiskit/0.46/qiskit.providers.BackendV1) to +from [`BackendV1`](/api/qiskit/qiskit.providers.BackendV1) to [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2) existing access patterns will need to be adjusted. It is expected for existing providers to deprecate the old access where possible to provide a graceful migration, but eventually users @@ -31,16 +31,16 @@ detailed in the full coupling map returned by it might be necessary to look deeper than just the equivalent access with [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2). -Below is a table of example access patterns in [`BackendV1`](/api/qiskit/0.46/qiskit.providers.BackendV1) and the new form +Below is a table of example access patterns in [`BackendV1`](/api/qiskit/qiskit.providers.BackendV1) and the new form with [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2): -|[`BackendV1`](/api/qiskit/0.46/qiskit.providers.BackendV1) | [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2) | Notes | +|[`BackendV1`](/api/qiskit/qiskit.providers.BackendV1) | [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2) | Notes | | --- | --- | --- | |`backend.configuration().n_qubits` | `backend.num_qubits`| | -|`backend.configuration().coupling_map` | `backend.coupling_map` | The return from [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2) is a [`CouplingMap`](/api/qiskit/qiskit.transpiler.CouplingMap) object. while in [`BackendV1`](/api/qiskit/0.46/qiskit.providers.BackendV1) it is an edge list. Also this is just a view of the information contained in `backend.target` which may only be a subset of the information contained in the [`Target`](/api/qiskit/qiskit.transpiler.Target) object. | +|`backend.configuration().coupling_map` | `backend.coupling_map` | The return from [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2) is a [`CouplingMap`](/api/qiskit/qiskit.transpiler.CouplingMap) object. while in [`BackendV1`](/api/qiskit/qiskit.providers.BackendV1) it is an edge list. Also this is just a view of the information contained in `backend.target` which may only be a subset of the information contained in the [`Target`](/api/qiskit/qiskit.transpiler.Target) object. | |`backend.configuration().backend_name` | `backend.name` | | |`backend.configuration().backend_version` | `backend.backend_version` | The `BackendV2.version` attribute represents the version of the abstract [`Backend`](/api/qiskit/qiskit.providers.Backend) interface the object implements while `BackendV2.backend_version` is metadata about the version of the backend itself. | -|`backend.configuration().basis_gates` | `backend.operation_names` | The [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2) return is a list of operation names contained in the ``backend.target`` attribute. The [`Target`](/api/qiskit/qiskit.transpiler.Target) may contain more information that can be expressed by this list of names. For example, that some operations only work on a subset of qubits or that some names implement the same gate with different parameters.| +|`backend.configuration().basis_gates` | `backend.operation_names` | The [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2) return is a list of operation names contained in the `backend.target` attribute. The [`Target`](/api/qiskit/qiskit.transpiler.Target) may contain more information that can be expressed by this list of names. For example, that some operations only work on a subset of qubits or that some names implement the same gate with different parameters.| |`backend.configuration().dt`|`backend.dt`| | |`backend.configuration().dtm`|`backend.dtm` | | |`backend.configuration().max_experiments` |`backend.max_circuits` | | @@ -50,5 +50,5 @@ with [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2): |`backend.properties().t1(0)`|`backend.qubit_properties(0).t1`| | |`backend.properties().t2(0)`|`backend.qubit_properties(0).t2`| | |`backend.properties().frequency(0)`|`backend.qubit_properties(0).frequency`| | -|`backend.properties().readout_error(0)`|`backend.target["measure"][(0,)].error`| In [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2) the error rate for the [`Measure`](/api/qiskit/qiskit.circuit.library.Measure) operation on a given qubit is used to model the readout error. However a [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2) can implement multiple measurement types and list them separately in a [`Target`](/api/qiskit/qiskit.transpiler.Target).| -|`backend.properties().readout_length(0)`|`backend.target["measure"][(0,)].duration`| In [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2) the duration for the [`Measure`](/api/qiskit/qiskit.circuit.library.Measure) operation on a given qubit is used to model the readout length. However, a [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2) can implement multiple measurement types and list them separately in a [`Target`](/api/qiskit/qiskit.transpiler.Target).| \ No newline at end of file +|`backend.properties().readout_error(0)`|`backend.target["measure"][(0,)].error`| In [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2) the error rate for the [`Measure`](/api/qiskit/circuit#measure) operation on a given qubit is used to model the readout error. However a [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2) can implement multiple measurement types and list them separately in a [`Target`](/api/qiskit/qiskit.transpiler.Target).| +|`backend.properties().readout_length(0)`|`backend.target["measure"][(0,)].duration`| In [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2) the duration for the [`Measure`](/api/qiskit/circuit#measure) operation on a given qubit is used to model the readout length. However, a [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2) can implement multiple measurement types and list them separately in a [`Target`](/api/qiskit/qiskit.transpiler.Target).| \ No newline at end of file From e95fa1af977063cf58d123a939d844203fe48b62 Mon Sep 17 00:00:00 2001 From: Rebecca Dimock Date: Mon, 3 Mar 2025 15:30:04 -0600 Subject: [PATCH 06/21] Add migration guide to TOC --- docs/migration-guides/_toc.json | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docs/migration-guides/_toc.json b/docs/migration-guides/_toc.json index a7514e8d546..d786879e9ad 100644 --- a/docs/migration-guides/_toc.json +++ b/docs/migration-guides/_toc.json @@ -6,6 +6,15 @@ "title": "Introduction", "url": "/migration-guides" }, + { + "title": "Migrate to Qiskit 2.0", + "children": [ + { + "title": "Migrate from BackendV1 to BackendV2", + "url": "/migration-guides/qiskit-backendv1-to-v2" + } + ] + }, { "title": "Migrate to the new version of IBM Quantum Platform", "isNew": true, From 266823696b33b0922005cf1f1c46dc111ea5c5f4 Mon Sep 17 00:00:00 2001 From: Rebecca Dimock Date: Mon, 3 Mar 2025 16:02:31 -0600 Subject: [PATCH 07/21] some initial edits --- .../qiskit-backendv1-to-v2.mdx | 37 +++++++++---------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/docs/migration-guides/qiskit-backendv1-to-v2.mdx b/docs/migration-guides/qiskit-backendv1-to-v2.mdx index d80197d1cf7..8ca0dc62590 100644 --- a/docs/migration-guides/qiskit-backendv1-to-v2.mdx +++ b/docs/migration-guides/qiskit-backendv1-to-v2.mdx @@ -1,31 +1,30 @@ --- -title: backendv1 migration guide +title: Migrate from BackendV1 to BackendV2 description: How to update your code to use `BackendV2` instead of `BackendV1`. --- -# Migrate from `BackendV1` to `BackendV2` +# Migrate from `BackendV1` to `BackendV2` -The [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2) class re-defined -user access for most properties of a -backend to make them work with native Qiskit data structures and have flatter -access patterns. However this means when using a provider that upgrades -from [`BackendV1`](/api/qiskit/qiskit.providers.BackendV1) to -[`BackendV2`](/api/qiskit/qiskit.providers.BackendV2) existing access patterns will need -to be adjusted. It is expected for existing providers to deprecate the old +The [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2) class redefined +user access for most backend properties to make them work with native Qiskit data structures and have flatter +access patterns. However, this means when using a provider that upgraded +from [`BackendV1`](/api/qiskit/qiskit.providers.BackendV1) to +[`BackendV2`](/api/qiskit/qiskit.providers.BackendV2), existing access patterns need +to be adjusted. It is expected that existing providers will deprecate the old access where possible to provide a graceful migration, but eventually users -will need to adjust code. +will need to adjust their code. -The biggest change to adapt to in [`CouplingMap`](/api/qiskit/qiskit.transpiler.CouplingMap) is +The biggest change in [`CouplingMap`](/api/qiskit/qiskit.transpiler.CouplingMap) is that most of the information accessible about a backend is contained in its -[`Target`](/api/qiskit/qiskit.transpiler.Target) object and the backend's attributes often query -its `BackendV2.target` attribute to return information, however in many cases the attributes only provide +[`Target`](/api/qiskit/qiskit.transpiler.Target) object, and the backend's attributes often query +its `BackendV2.target` attribute to return information. However, in many cases the attributes only provide a subset of information the target can contain. For example, `backend.coupling_map` returns a [`CouplingMap`](/api/qiskit/qiskit.transpiler.CouplingMap) constructed from the [`Target`](/api/qiskit/qiskit.transpiler.Target) accessible in the `BackendV2.target` attribute, however the target may contain instructions that operate on more than two qubits (which can't be represented in a [`CouplingMap`](/api/qiskit/qiskit.transpiler.CouplingMap)) or has instructions that only operate on -a subset of qubits (or two qubit links for a two qubit instruction) which won't be +a subset of qubits (or two qubit links, for a two qubit instruction) which won't be detailed in the full coupling map returned by `BackendV2.coupling_map`. So depending on your use case it might be necessary to look deeper than just the equivalent access with @@ -37,10 +36,10 @@ with [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2): |[`BackendV1`](/api/qiskit/qiskit.providers.BackendV1) | [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2) | Notes | | --- | --- | --- | |`backend.configuration().n_qubits` | `backend.num_qubits`| | -|`backend.configuration().coupling_map` | `backend.coupling_map` | The return from [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2) is a [`CouplingMap`](/api/qiskit/qiskit.transpiler.CouplingMap) object. while in [`BackendV1`](/api/qiskit/qiskit.providers.BackendV1) it is an edge list. Also this is just a view of the information contained in `backend.target` which may only be a subset of the information contained in the [`Target`](/api/qiskit/qiskit.transpiler.Target) object. | +|`backend.configuration().coupling_map` | `backend.coupling_map` | The return from [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2) is a [`CouplingMap`](/api/qiskit/qiskit.transpiler.CouplingMap) object. In [`BackendV1`](/api/qiskit/qiskit.providers.BackendV1) it is an edge list. Also, this is just a view of the information contained in `backend.target` which may only be a subset of the information contained in the [`Target`](/api/qiskit/qiskit.transpiler.Target) object. | |`backend.configuration().backend_name` | `backend.name` | | -|`backend.configuration().backend_version` | `backend.backend_version` | The `BackendV2.version` attribute represents the version of the abstract [`Backend`](/api/qiskit/qiskit.providers.Backend) interface the object implements while `BackendV2.backend_version` is metadata about the version of the backend itself. | -|`backend.configuration().basis_gates` | `backend.operation_names` | The [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2) return is a list of operation names contained in the `backend.target` attribute. The [`Target`](/api/qiskit/qiskit.transpiler.Target) may contain more information that can be expressed by this list of names. For example, that some operations only work on a subset of qubits or that some names implement the same gate with different parameters.| +|`backend.configuration().backend_version` | `backend.backend_version` | The `BackendV2.version` attribute represents the version of the abstract [`Backend`](/api/qiskit/qiskit.providers.Backend) interface that the object implements, while `BackendV2.backend_version` is metadata about the version of the backend itself. | +|`backend.configuration().basis_gates` | `backend.operation_names` | The [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2) returns a list of operation names contained in the `backend.target` attribute. The [`Target`](/api/qiskit/qiskit.transpiler.Target) might contain more information than can be expressed by this list of names. For example, some operations only work on a subset of qubits, and some names implement the same gate with different parameters.| |`backend.configuration().dt`|`backend.dt`| | |`backend.configuration().dtm`|`backend.dtm` | | |`backend.configuration().max_experiments` |`backend.max_circuits` | | @@ -50,5 +49,5 @@ with [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2): |`backend.properties().t1(0)`|`backend.qubit_properties(0).t1`| | |`backend.properties().t2(0)`|`backend.qubit_properties(0).t2`| | |`backend.properties().frequency(0)`|`backend.qubit_properties(0).frequency`| | -|`backend.properties().readout_error(0)`|`backend.target["measure"][(0,)].error`| In [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2) the error rate for the [`Measure`](/api/qiskit/circuit#measure) operation on a given qubit is used to model the readout error. However a [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2) can implement multiple measurement types and list them separately in a [`Target`](/api/qiskit/qiskit.transpiler.Target).| -|`backend.properties().readout_length(0)`|`backend.target["measure"][(0,)].duration`| In [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2) the duration for the [`Measure`](/api/qiskit/circuit#measure) operation on a given qubit is used to model the readout length. However, a [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2) can implement multiple measurement types and list them separately in a [`Target`](/api/qiskit/qiskit.transpiler.Target).| \ No newline at end of file +|`backend.properties().readout_error(0)`|`backend.target["measure"][(0,)].error`| In [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2), the error rate for the [`Measure`](/api/qiskit/circuit#measure) operation on a given qubit is used to model the readout error. However, a [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2) object can implement multiple measurement types and list them separately in a [`Target`](/api/qiskit/qiskit.transpiler.Target).| +|`backend.properties().readout_length(0)`|`backend.target["measure"][(0,)].duration`| In [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2), the duration for the [`Measure`](/api/qiskit/circuit#measure) operation on a given qubit is used to model the readout length. However, a [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2) object can implement multiple measurement types and list them separately in a [`Target`](/api/qiskit/qiskit.transpiler.Target).| \ No newline at end of file From c6108d63b290d6ae1086ed64b6ecd459e3093607 Mon Sep 17 00:00:00 2001 From: Rebecca Dimock Date: Mon, 10 Mar 2025 09:38:18 -0500 Subject: [PATCH 08/21] add intro and start organizing --- docs/migration-guides/qiskit-backendv1-to-v2.mdx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/migration-guides/qiskit-backendv1-to-v2.mdx b/docs/migration-guides/qiskit-backendv1-to-v2.mdx index 8ca0dc62590..714aa65db78 100644 --- a/docs/migration-guides/qiskit-backendv1-to-v2.mdx +++ b/docs/migration-guides/qiskit-backendv1-to-v2.mdx @@ -5,6 +5,10 @@ description: How to update your code to use `BackendV2` instead of `BackendV1`. # Migrate from `BackendV1` to `BackendV2` +The Qiskit [`BackendV1`](/api/qiskit/qiskit.providers.BackendV1) class has been deprecated and will be removed from service. This guide describes how to migrate to [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2). + +## Changes in `BackendV2` + The [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2) class redefined user access for most backend properties to make them work with native Qiskit data structures and have flatter access patterns. However, this means when using a provider that upgraded From 7ee80f3080896c3fe7bbec8a0a9b24c1b03caf53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elena=20Pe=C3=B1a=20Tapia?= Date: Mon, 10 Mar 2025 15:47:13 +0100 Subject: [PATCH 09/21] Updates --- .../qiskit-backendv1-to-v2.mdx | 26 +++++++++++++++---- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/docs/migration-guides/qiskit-backendv1-to-v2.mdx b/docs/migration-guides/qiskit-backendv1-to-v2.mdx index 8ca0dc62590..f9031ee7685 100644 --- a/docs/migration-guides/qiskit-backendv1-to-v2.mdx +++ b/docs/migration-guides/qiskit-backendv1-to-v2.mdx @@ -5,16 +5,32 @@ description: How to update your code to use `BackendV2` instead of `BackendV1`. # Migrate from `BackendV1` to `BackendV2` +The Qiskit [`Backend`](/api/qiskit/qiskit.providers.Backend) model was designed to enable the Qiskit SDK +to reason quantum computers at a level of abstraction that was relevant for the scope the SDK. +The first iteration of the model was introduced with the +[`BackendV1`](/api/qiskit/qiskit.providers.BackendV1) class. This class stored the backend information in a series +of data containers, namely the [`BackendConfiguration`](/api/qiskit/qiskit.providers.models.BackendConfiguration) and +[`BackendProperties`](/api/qiskit/qiskit.providers.models.BackendProperties) classes. + The [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2) class redefined user access for most backend properties to make them work with native Qiskit data structures and have flatter -access patterns. However, this means when using a provider that upgraded -from [`BackendV1`](/api/qiskit/qiskit.providers.BackendV1) to -[`BackendV2`](/api/qiskit/qiskit.providers.BackendV2), existing access patterns need -to be adjusted. It is expected that existing providers will deprecate the old +access patterns. The core of the [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2) model is the +[`Target`](/api/qiskit/qiskit.transpiler.Target) class, a representation +of the QPU that contains the transpilation constraints that Qiskit can use to optimize circuits for execution. + +The Qiskit SDK has been updated to work exclusively with [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2) inputs, +and most providers have upgraded from [`BackendV1`](/api/qiskit/qiskit.providers.BackendV1) to +[`BackendV2`](/api/qiskit/qiskit.providers.BackendV2). It is expected that existing providers will deprecate the old access where possible to provide a graceful migration, but eventually users will need to adjust their code. -The biggest change in [`CouplingMap`](/api/qiskit/qiskit.transpiler.CouplingMap) is +This migration guides show the small adjustments needed in existing access patterns for users of +providers that upgraded from [`BackendV1`](/api/qiskit/qiskit.providers.BackendV1) to +[`BackendV2`](/api/qiskit/qiskit.providers.BackendV2). + +Most attributes have a direct drop-in replacement, simplifying the migration efforts. +The only point of mismatch between interfaces is in the [`CouplingMap`](/api/qiskit/qiskit.transpiler.CouplingMap). +The principle behind [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2) is that most of the information accessible about a backend is contained in its [`Target`](/api/qiskit/qiskit.transpiler.Target) object, and the backend's attributes often query its `BackendV2.target` attribute to return information. However, in many cases the attributes only provide From dbabdc48c9bd7322f4b9b2c505fe3166f45b1664 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elena=20Pe=C3=B1a=20Tapia?= Date: Mon, 10 Mar 2025 15:50:47 +0100 Subject: [PATCH 10/21] Improve clunky sentence --- docs/migration-guides/qiskit-backendv1-to-v2.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/migration-guides/qiskit-backendv1-to-v2.mdx b/docs/migration-guides/qiskit-backendv1-to-v2.mdx index 837f7b556ef..2a50583bcc7 100644 --- a/docs/migration-guides/qiskit-backendv1-to-v2.mdx +++ b/docs/migration-guides/qiskit-backendv1-to-v2.mdx @@ -10,8 +10,8 @@ This guide describes how to migrate to [`BackendV2`](/api/qiskit/qiskit.provider ## Changes in `BackendV2` -The Qiskit [`Backend`](/api/qiskit/qiskit.providers.Backend) model was designed to enable the Qiskit SDK -to reason quantum computers at a level of abstraction that was relevant for the scope the SDK. +The Qiskit [`Backend`](/api/qiskit/qiskit.providers.Backend) model was designed to provide the Qiskit SDK with an abstraction +layer that enabled reasoning about quantum computers within the scope of the SDK. The first iteration of the model was introduced with the [`BackendV1`](/api/qiskit/qiskit.providers.BackendV1) class. This class stored the backend information in a series of data containers, namely the [`BackendConfiguration`](/api/qiskit/qiskit.providers.models.BackendConfiguration) and From 5f850cec5c5249076152d880c96ce2f5fdd23678 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elena=20Pe=C3=B1a=20Tapia?= Date: Wed, 12 Mar 2025 10:38:16 +0100 Subject: [PATCH 11/21] Point API ref links of deprecated classes to 1.4 --- .../qiskit-backendv1-to-v2.mdx | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/docs/migration-guides/qiskit-backendv1-to-v2.mdx b/docs/migration-guides/qiskit-backendv1-to-v2.mdx index 2a50583bcc7..6aff23b4d01 100644 --- a/docs/migration-guides/qiskit-backendv1-to-v2.mdx +++ b/docs/migration-guides/qiskit-backendv1-to-v2.mdx @@ -5,7 +5,7 @@ description: How to update your code to use `BackendV2` instead of `BackendV1`. # Migrate from `BackendV1` to `BackendV2` -The Qiskit [`BackendV1`](/api/qiskit/qiskit.providers.BackendV1) class has been deprecated and will be removed from service. +The Qiskit [`BackendV1`](/api/qiskit/1.4/qiskit.providers.BackendV1) class has been deprecated and will be removed from service. This guide describes how to migrate to [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2). ## Changes in `BackendV2` @@ -13,9 +13,9 @@ This guide describes how to migrate to [`BackendV2`](/api/qiskit/qiskit.provider The Qiskit [`Backend`](/api/qiskit/qiskit.providers.Backend) model was designed to provide the Qiskit SDK with an abstraction layer that enabled reasoning about quantum computers within the scope of the SDK. The first iteration of the model was introduced with the -[`BackendV1`](/api/qiskit/qiskit.providers.BackendV1) class. This class stored the backend information in a series -of data containers, namely the [`BackendConfiguration`](/api/qiskit/qiskit.providers.models.BackendConfiguration) and -[`BackendProperties`](/api/qiskit/qiskit.providers.models.BackendProperties) classes. +[`BackendV1`](/api/qiskit/1.4/qiskit.providers.BackendV1) class. This class stored the backend information in a series +of data containers, namely the [`BackendConfiguration`](/api/qiskit/1.4/qiskit.providers.models.BackendConfiguration) and +[`BackendProperties`](/api/qiskit/1.4/qiskit.providers.models.BackendProperties) classes. The [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2) class redefined user access for most backend properties to make them work with native Qiskit data structures and have flatter @@ -24,13 +24,13 @@ access patterns. The core of the [`BackendV2`](/api/qiskit/qiskit.providers.Back of the QPU that contains the transpilation constraints that Qiskit can use to optimize circuits for execution. The Qiskit SDK has been updated to work exclusively with [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2) inputs, -and most providers have upgraded from [`BackendV1`](/api/qiskit/qiskit.providers.BackendV1) to +and most providers have upgraded from [`BackendV1`](/api/qiskit/1.4/qiskit.providers.BackendV1) to [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2). It is expected that existing providers will deprecate the old access where possible to provide a graceful migration, but eventually users will need to adjust their code. This migration guides show the small adjustments needed in existing access patterns for users of -providers that upgraded from [`BackendV1`](/api/qiskit/qiskit.providers.BackendV1) to +providers that upgraded from [`BackendV1`](/api/qiskit/1.4/qiskit.providers.BackendV1) to [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2). Most attributes have a direct drop-in replacement, simplifying the migration efforts. @@ -51,13 +51,13 @@ detailed in the full coupling map returned by it might be necessary to look deeper than just the equivalent access with [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2). -Below is a table of example access patterns in [`BackendV1`](/api/qiskit/qiskit.providers.BackendV1) and the new form +Below is a table of example access patterns in [`BackendV1`](/api/qiskit/1.4/qiskit.providers.BackendV1) and the new form with [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2): -|[`BackendV1`](/api/qiskit/qiskit.providers.BackendV1) | [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2) | Notes | +|[`BackendV1`](/api/qiskit/1.4/qiskit.providers.BackendV1) | [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2) | Notes | | --- | --- | --- | |`backend.configuration().n_qubits` | `backend.num_qubits`| | -|`backend.configuration().coupling_map` | `backend.coupling_map` | The return from [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2) is a [`CouplingMap`](/api/qiskit/qiskit.transpiler.CouplingMap) object. In [`BackendV1`](/api/qiskit/qiskit.providers.BackendV1) it is an edge list. Also, this is just a view of the information contained in `backend.target` which may only be a subset of the information contained in the [`Target`](/api/qiskit/qiskit.transpiler.Target) object. | +|`backend.configuration().coupling_map` | `backend.coupling_map` | The return from [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2) is a [`CouplingMap`](/api/qiskit/qiskit.transpiler.CouplingMap) object. In [`BackendV1`](/api/qiskit/1.4/qiskit.providers.BackendV1) it is an edge list. Also, this is just a view of the information contained in `backend.target` which may only be a subset of the information contained in the [`Target`](/api/qiskit/qiskit.transpiler.Target) object. | |`backend.configuration().backend_name` | `backend.name` | | |`backend.configuration().backend_version` | `backend.backend_version` | The `BackendV2.version` attribute represents the version of the abstract [`Backend`](/api/qiskit/qiskit.providers.Backend) interface that the object implements, while `BackendV2.backend_version` is metadata about the version of the backend itself. | |`backend.configuration().basis_gates` | `backend.operation_names` | The [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2) returns a list of operation names contained in the `backend.target` attribute. The [`Target`](/api/qiskit/qiskit.transpiler.Target) might contain more information than can be expressed by this list of names. For example, some operations only work on a subset of qubits, and some names implement the same gate with different parameters.| From 193b429577afae3d367698fdb64fdf10ba63dcb5 Mon Sep 17 00:00:00 2001 From: Rebecca Dimock Date: Thu, 13 Mar 2025 15:39:26 -0500 Subject: [PATCH 12/21] fix some links --- .../qiskit-backendv1-to-v2.mdx | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/docs/migration-guides/qiskit-backendv1-to-v2.mdx b/docs/migration-guides/qiskit-backendv1-to-v2.mdx index 6aff23b4d01..2a50583bcc7 100644 --- a/docs/migration-guides/qiskit-backendv1-to-v2.mdx +++ b/docs/migration-guides/qiskit-backendv1-to-v2.mdx @@ -5,7 +5,7 @@ description: How to update your code to use `BackendV2` instead of `BackendV1`. # Migrate from `BackendV1` to `BackendV2` -The Qiskit [`BackendV1`](/api/qiskit/1.4/qiskit.providers.BackendV1) class has been deprecated and will be removed from service. +The Qiskit [`BackendV1`](/api/qiskit/qiskit.providers.BackendV1) class has been deprecated and will be removed from service. This guide describes how to migrate to [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2). ## Changes in `BackendV2` @@ -13,9 +13,9 @@ This guide describes how to migrate to [`BackendV2`](/api/qiskit/qiskit.provider The Qiskit [`Backend`](/api/qiskit/qiskit.providers.Backend) model was designed to provide the Qiskit SDK with an abstraction layer that enabled reasoning about quantum computers within the scope of the SDK. The first iteration of the model was introduced with the -[`BackendV1`](/api/qiskit/1.4/qiskit.providers.BackendV1) class. This class stored the backend information in a series -of data containers, namely the [`BackendConfiguration`](/api/qiskit/1.4/qiskit.providers.models.BackendConfiguration) and -[`BackendProperties`](/api/qiskit/1.4/qiskit.providers.models.BackendProperties) classes. +[`BackendV1`](/api/qiskit/qiskit.providers.BackendV1) class. This class stored the backend information in a series +of data containers, namely the [`BackendConfiguration`](/api/qiskit/qiskit.providers.models.BackendConfiguration) and +[`BackendProperties`](/api/qiskit/qiskit.providers.models.BackendProperties) classes. The [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2) class redefined user access for most backend properties to make them work with native Qiskit data structures and have flatter @@ -24,13 +24,13 @@ access patterns. The core of the [`BackendV2`](/api/qiskit/qiskit.providers.Back of the QPU that contains the transpilation constraints that Qiskit can use to optimize circuits for execution. The Qiskit SDK has been updated to work exclusively with [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2) inputs, -and most providers have upgraded from [`BackendV1`](/api/qiskit/1.4/qiskit.providers.BackendV1) to +and most providers have upgraded from [`BackendV1`](/api/qiskit/qiskit.providers.BackendV1) to [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2). It is expected that existing providers will deprecate the old access where possible to provide a graceful migration, but eventually users will need to adjust their code. This migration guides show the small adjustments needed in existing access patterns for users of -providers that upgraded from [`BackendV1`](/api/qiskit/1.4/qiskit.providers.BackendV1) to +providers that upgraded from [`BackendV1`](/api/qiskit/qiskit.providers.BackendV1) to [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2). Most attributes have a direct drop-in replacement, simplifying the migration efforts. @@ -51,13 +51,13 @@ detailed in the full coupling map returned by it might be necessary to look deeper than just the equivalent access with [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2). -Below is a table of example access patterns in [`BackendV1`](/api/qiskit/1.4/qiskit.providers.BackendV1) and the new form +Below is a table of example access patterns in [`BackendV1`](/api/qiskit/qiskit.providers.BackendV1) and the new form with [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2): -|[`BackendV1`](/api/qiskit/1.4/qiskit.providers.BackendV1) | [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2) | Notes | +|[`BackendV1`](/api/qiskit/qiskit.providers.BackendV1) | [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2) | Notes | | --- | --- | --- | |`backend.configuration().n_qubits` | `backend.num_qubits`| | -|`backend.configuration().coupling_map` | `backend.coupling_map` | The return from [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2) is a [`CouplingMap`](/api/qiskit/qiskit.transpiler.CouplingMap) object. In [`BackendV1`](/api/qiskit/1.4/qiskit.providers.BackendV1) it is an edge list. Also, this is just a view of the information contained in `backend.target` which may only be a subset of the information contained in the [`Target`](/api/qiskit/qiskit.transpiler.Target) object. | +|`backend.configuration().coupling_map` | `backend.coupling_map` | The return from [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2) is a [`CouplingMap`](/api/qiskit/qiskit.transpiler.CouplingMap) object. In [`BackendV1`](/api/qiskit/qiskit.providers.BackendV1) it is an edge list. Also, this is just a view of the information contained in `backend.target` which may only be a subset of the information contained in the [`Target`](/api/qiskit/qiskit.transpiler.Target) object. | |`backend.configuration().backend_name` | `backend.name` | | |`backend.configuration().backend_version` | `backend.backend_version` | The `BackendV2.version` attribute represents the version of the abstract [`Backend`](/api/qiskit/qiskit.providers.Backend) interface that the object implements, while `BackendV2.backend_version` is metadata about the version of the backend itself. | |`backend.configuration().basis_gates` | `backend.operation_names` | The [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2) returns a list of operation names contained in the `backend.target` attribute. The [`Target`](/api/qiskit/qiskit.transpiler.Target) might contain more information than can be expressed by this list of names. For example, some operations only work on a subset of qubits, and some names implement the same gate with different parameters.| From f0d44b30ba3afe8a17cfff57aee12cc4b1947e95 Mon Sep 17 00:00:00 2001 From: Rebecca Dimock Date: Thu, 13 Mar 2025 16:26:00 -0500 Subject: [PATCH 13/21] Try to make table more narrow --- .../qiskit-backendv1-to-v2.mdx | 77 +++++++++++-------- 1 file changed, 47 insertions(+), 30 deletions(-) diff --git a/docs/migration-guides/qiskit-backendv1-to-v2.mdx b/docs/migration-guides/qiskit-backendv1-to-v2.mdx index 2a50583bcc7..b578740a8fb 100644 --- a/docs/migration-guides/qiskit-backendv1-to-v2.mdx +++ b/docs/migration-guides/qiskit-backendv1-to-v2.mdx @@ -5,54 +5,52 @@ description: How to update your code to use `BackendV2` instead of `BackendV1`. # Migrate from `BackendV1` to `BackendV2` -The Qiskit [`BackendV1`](/api/qiskit/qiskit.providers.BackendV1) class has been deprecated and will be removed from service. -This guide describes how to migrate to [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2). +The Qiskit [`BackendV1`](/api/qiskit/qiskit.providers.BackendV1) class has been deprecated and will be removed from service. This migration guide describes the small adjustments you need to make if your are a user of a provider that upgraded from [`BackendV1`](/api/qiskit/qiskit.providers.BackendV1) to [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2). -## Changes in `BackendV2` -The Qiskit [`Backend`](/api/qiskit/qiskit.providers.Backend) model was designed to provide the Qiskit SDK with an abstraction -layer that enabled reasoning about quantum computers within the scope of the SDK. -The first iteration of the model was introduced with the +## High-level changes in `BackendV2` + +The Qiskit [`Backend`](/api/qiskit/qiskit.providers.Backend) model was designed to provide the Qiskit SDK with an abstraction +layer that enabled reasoning about quantum computers within the scope of the SDK. The first iteration of the model was introduced with the [`BackendV1`](/api/qiskit/qiskit.providers.BackendV1) class. This class stored the backend information in a series -of data containers, namely the [`BackendConfiguration`](/api/qiskit/qiskit.providers.models.BackendConfiguration) and -[`BackendProperties`](/api/qiskit/qiskit.providers.models.BackendProperties) classes. +of data containers, namely the [`BackendConfiguration`](/api/qiskit/qiskit.providers.models.BackendConfiguration) and +[`BackendProperties`](/api/qiskit/qiskit.providers.models.BackendProperties) classes. The [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2) class redefined user access for most backend properties to make them work with native Qiskit data structures and have flatter -access patterns. The core of the [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2) model is the -[`Target`](/api/qiskit/qiskit.transpiler.Target) class, a representation -of the QPU that contains the transpilation constraints that Qiskit can use to optimize circuits for execution. +access patterns. The core of the [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2) model is the +[`Target`](/api/qiskit/qiskit.transpiler.Target) class, a representation of the QPU that contains the transpilation constraints that Qiskit can use to optimize circuits for execution. The Qiskit SDK has been updated to work exclusively with [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2) inputs, -and most providers have upgraded from [`BackendV1`](/api/qiskit/qiskit.providers.BackendV1) to -[`BackendV2`](/api/qiskit/qiskit.providers.BackendV2). It is expected that existing providers will deprecate the old -access where possible to provide a graceful migration, but eventually users -will need to adjust their code. - -This migration guides show the small adjustments needed in existing access patterns for users of -providers that upgraded from [`BackendV1`](/api/qiskit/qiskit.providers.BackendV1) to -[`BackendV2`](/api/qiskit/qiskit.providers.BackendV2). +and most providers have upgraded from [`BackendV1`](/api/qiskit/qiskit.providers.BackendV1) to [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2). It is expected that existing providers will deprecate the old access where possible to provide a graceful migration, but eventually users will need to adjust their code. -Most attributes have a direct drop-in replacement, simplifying the migration efforts. -The only point of mismatch between interfaces is in the [`CouplingMap`](/api/qiskit/qiskit.transpiler.CouplingMap). The principle behind [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2) is -that most of the information accessible about a backend is contained in its +that most of the information about a backend is contained in its [`Target`](/api/qiskit/qiskit.transpiler.Target) object, and the backend's attributes often query its `BackendV2.target` attribute to return information. However, in many cases the attributes only provide -a subset of information the target can contain. For example, `backend.coupling_map` +a subset of information that the target can contain. For example, `backend.coupling_map` returns a [`CouplingMap`](/api/qiskit/qiskit.transpiler.CouplingMap) constructed from the [`Target`](/api/qiskit/qiskit.transpiler.Target) accessible in the -`BackendV2.target` attribute, however the target may contain +`BackendV2.target` attribute. However, the target might contain instructions that operate on more than two qubits (which can't be represented in a -[`CouplingMap`](/api/qiskit/qiskit.transpiler.CouplingMap)) or has instructions that only operate on -a subset of qubits (or two qubit links, for a two qubit instruction) which won't be +[`CouplingMap`](/api/qiskit/qiskit.transpiler.CouplingMap)) or it might have instructions that only operate on +a subset of qubits (or two qubit links, for a two qubit instruction), which won't be detailed in the full coupling map returned by -`BackendV2.coupling_map`. So depending on your use case +`BackendV2.coupling_map`. So depending on your use case, it might be necessary to look deeper than just the equivalent access with [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2). -Below is a table of example access patterns in [`BackendV1`](/api/qiskit/qiskit.providers.BackendV1) and the new form -with [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2): +## Specific changes in `BackendV2` + +Most attributes have a direct replacement, simplifying the migration efforts. The only point of mismatch between interfaces is in the [`CouplingMap`](/api/qiskit/qiskit.transpiler.CouplingMap). + + +Following is a table of example access patterns in [`BackendV1`](/api/qiskit/qiskit.providers.BackendV1) and the new form +with [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2). + + +Scroll to the right to see important notes. + |[`BackendV1`](/api/qiskit/qiskit.providers.BackendV1) | [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2) | Notes | | --- | --- | --- | @@ -71,4 +69,23 @@ with [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2): |`backend.properties().t2(0)`|`backend.qubit_properties(0).t2`| | |`backend.properties().frequency(0)`|`backend.qubit_properties(0).frequency`| | |`backend.properties().readout_error(0)`|`backend.target["measure"][(0,)].error`| In [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2), the error rate for the [`Measure`](/api/qiskit/circuit#measure) operation on a given qubit is used to model the readout error. However, a [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2) object can implement multiple measurement types and list them separately in a [`Target`](/api/qiskit/qiskit.transpiler.Target).| -|`backend.properties().readout_length(0)`|`backend.target["measure"][(0,)].duration`| In [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2), the duration for the [`Measure`](/api/qiskit/circuit#measure) operation on a given qubit is used to model the readout length. However, a [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2) object can implement multiple measurement types and list them separately in a [`Target`](/api/qiskit/qiskit.transpiler.Target).| \ No newline at end of file +|`backend.properties().readout_length(0)`|`backend.target["measure"][(0,)].duration`| In [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2), the duration for the [`Measure`](/api/qiskit/circuit#measure) operation on a given qubit is used to model the readout length. However, a [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2) object can implement multiple measurement types and list them separately in a [`Target`](/api/qiskit/qiskit.transpiler.Target).| + +|[`BackendV1`](/api/qiskit/qiskit.providers.BackendV1) method | [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2) method | Notes | +| --- | --- | --- | +|`configuration().n_qubits` | `num_qubits`| | +|`configuration().coupling_map` | `coupling_map` | The return from [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2) is a [`CouplingMap`](/api/qiskit/qiskit.transpiler.CouplingMap) object. In [`BackendV1`](/api/qiskit/qiskit.providers.BackendV1) it is an edge list. Also, this is just a view of the information contained in `backend.target` which may only be a subset of the information contained in the [`Target`](/api/qiskit/qiskit.transpiler.Target) object. | +|`configuration().backend_name` | `name` | | +|`configuration().backend_version` | `backend_version` | The `BackendV2.version` attribute represents the version of the abstract [`Backend`](/api/qiskit/qiskit.providers.Backend) interface that the object implements, while `BackendV2.backend_version` is metadata about the version of the backend itself. | +|`configuration().basis_gates` | `operation_names` | The [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2) returns a list of operation names contained in the `backend.target` attribute. The [`Target`](/api/qiskit/qiskit.transpiler.Target) might contain more information than can be expressed by this list of names. For example, some operations only work on a subset of qubits, and some names implement the same gate with different parameters.| +|`configuration().dt`|`dt`| | +|`configuration().dtm`|`dtm` | | +|`configuration().max_experiments` |`max_circuits` | | +|`configuration().online_date` | `online_date`| | +|`InstructionDurations.from_backend(backend)`|`backend.instruction_durations`| | +|`defaults().instruction_schedule_map`|`instruction_schedule_map`| | +|`properties().t1(0)`|`qubit_properties(0).t1`| | +|`properties().t2(0)`|`qubit_properties(0).t2`| | +|`properties().frequency(0)`|`qubit_properties(0).frequency`| | +|`properties().readout_error(0)`|`target["measure"][(0,)].error`| In [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2), the error rate for the [`Measure`](/api/qiskit/circuit#measure) operation on a given qubit is used to model the readout error. However, a [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2) object can implement multiple measurement types and list them separately in a [`Target`](/api/qiskit/qiskit.transpiler.Target).| +|`properties().readout_length(0)`|`target["measure"][(0,)].duration`| In [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2), the duration for the [`Measure`](/api/qiskit/circuit#measure) operation on a given qubit is used to model the readout length. However, a [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2) object can implement multiple measurement types and list them separately in a [`Target`](/api/qiskit/qiskit.transpiler.Target).| \ No newline at end of file From 7c243047eec5bc02383250404cf109b8de2171ab Mon Sep 17 00:00:00 2001 From: Rebecca Dimock Date: Thu, 13 Mar 2025 16:41:25 -0500 Subject: [PATCH 14/21] force a newline? --- docs/migration-guides/qiskit-backendv1-to-v2.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/migration-guides/qiskit-backendv1-to-v2.mdx b/docs/migration-guides/qiskit-backendv1-to-v2.mdx index b578740a8fb..a7dae65844b 100644 --- a/docs/migration-guides/qiskit-backendv1-to-v2.mdx +++ b/docs/migration-guides/qiskit-backendv1-to-v2.mdx @@ -82,7 +82,7 @@ Scroll to the right to see important notes. |`configuration().dtm`|`dtm` | | |`configuration().max_experiments` |`max_circuits` | | |`configuration().online_date` | `online_date`| | -|`InstructionDurations.from_backend(backend)`|`backend.instruction_durations`| | +|`InstructionDurations.` \n`from_backend(backend)`|`backend.instruction_durations`| | |`defaults().instruction_schedule_map`|`instruction_schedule_map`| | |`properties().t1(0)`|`qubit_properties(0).t1`| | |`properties().t2(0)`|`qubit_properties(0).t2`| | From ab7c2c2d4c70b06443e9f0a0da8872524c720e8b Mon Sep 17 00:00:00 2001 From: Rebecca Dimock Date: Thu, 13 Mar 2025 16:51:35 -0500 Subject: [PATCH 15/21] separate out the weird one --- docs/migration-guides/qiskit-backendv1-to-v2.mdx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/docs/migration-guides/qiskit-backendv1-to-v2.mdx b/docs/migration-guides/qiskit-backendv1-to-v2.mdx index a7dae65844b..edd08f32576 100644 --- a/docs/migration-guides/qiskit-backendv1-to-v2.mdx +++ b/docs/migration-guides/qiskit-backendv1-to-v2.mdx @@ -82,10 +82,15 @@ Scroll to the right to see important notes. |`configuration().dtm`|`dtm` | | |`configuration().max_experiments` |`max_circuits` | | |`configuration().online_date` | `online_date`| | -|`InstructionDurations.` \n`from_backend(backend)`|`backend.instruction_durations`| | |`defaults().instruction_schedule_map`|`instruction_schedule_map`| | |`properties().t1(0)`|`qubit_properties(0).t1`| | |`properties().t2(0)`|`qubit_properties(0).t2`| | |`properties().frequency(0)`|`qubit_properties(0).frequency`| | |`properties().readout_error(0)`|`target["measure"][(0,)].error`| In [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2), the error rate for the [`Measure`](/api/qiskit/circuit#measure) operation on a given qubit is used to model the readout error. However, a [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2) object can implement multiple measurement types and list them separately in a [`Target`](/api/qiskit/qiskit.transpiler.Target).| -|`properties().readout_length(0)`|`target["measure"][(0,)].duration`| In [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2), the duration for the [`Measure`](/api/qiskit/circuit#measure) operation on a given qubit is used to model the readout length. However, a [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2) object can implement multiple measurement types and list them separately in a [`Target`](/api/qiskit/qiskit.transpiler.Target).| \ No newline at end of file +|`properties().readout_length(0)`|`target["measure"][(0,)].duration`| In [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2), the duration for the [`Measure`](/api/qiskit/circuit#measure) operation on a given qubit is used to model the readout length. However, a [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2) object can implement multiple measurement types and list them separately in a [`Target`](/api/qiskit/qiskit.transpiler.Target).| + +Other + +|[`BackendV1`](/api/qiskit/qiskit.providers.BackendV1) | [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2) | +| --- | --- | +|`InstructionDurations.from_backend(backend)`|`backend.instruction_durations`| From ca19f41c0037e63c414ec3dca76a899584445b53 Mon Sep 17 00:00:00 2001 From: Rebecca Dimock Date: Fri, 14 Mar 2025 10:27:06 -0500 Subject: [PATCH 16/21] remove the skinny table --- .../qiskit-backendv1-to-v2.mdx | 24 ------------------- 1 file changed, 24 deletions(-) diff --git a/docs/migration-guides/qiskit-backendv1-to-v2.mdx b/docs/migration-guides/qiskit-backendv1-to-v2.mdx index edd08f32576..a7053e86854 100644 --- a/docs/migration-guides/qiskit-backendv1-to-v2.mdx +++ b/docs/migration-guides/qiskit-backendv1-to-v2.mdx @@ -70,27 +70,3 @@ Scroll to the right to see important notes. |`backend.properties().frequency(0)`|`backend.qubit_properties(0).frequency`| | |`backend.properties().readout_error(0)`|`backend.target["measure"][(0,)].error`| In [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2), the error rate for the [`Measure`](/api/qiskit/circuit#measure) operation on a given qubit is used to model the readout error. However, a [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2) object can implement multiple measurement types and list them separately in a [`Target`](/api/qiskit/qiskit.transpiler.Target).| |`backend.properties().readout_length(0)`|`backend.target["measure"][(0,)].duration`| In [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2), the duration for the [`Measure`](/api/qiskit/circuit#measure) operation on a given qubit is used to model the readout length. However, a [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2) object can implement multiple measurement types and list them separately in a [`Target`](/api/qiskit/qiskit.transpiler.Target).| - -|[`BackendV1`](/api/qiskit/qiskit.providers.BackendV1) method | [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2) method | Notes | -| --- | --- | --- | -|`configuration().n_qubits` | `num_qubits`| | -|`configuration().coupling_map` | `coupling_map` | The return from [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2) is a [`CouplingMap`](/api/qiskit/qiskit.transpiler.CouplingMap) object. In [`BackendV1`](/api/qiskit/qiskit.providers.BackendV1) it is an edge list. Also, this is just a view of the information contained in `backend.target` which may only be a subset of the information contained in the [`Target`](/api/qiskit/qiskit.transpiler.Target) object. | -|`configuration().backend_name` | `name` | | -|`configuration().backend_version` | `backend_version` | The `BackendV2.version` attribute represents the version of the abstract [`Backend`](/api/qiskit/qiskit.providers.Backend) interface that the object implements, while `BackendV2.backend_version` is metadata about the version of the backend itself. | -|`configuration().basis_gates` | `operation_names` | The [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2) returns a list of operation names contained in the `backend.target` attribute. The [`Target`](/api/qiskit/qiskit.transpiler.Target) might contain more information than can be expressed by this list of names. For example, some operations only work on a subset of qubits, and some names implement the same gate with different parameters.| -|`configuration().dt`|`dt`| | -|`configuration().dtm`|`dtm` | | -|`configuration().max_experiments` |`max_circuits` | | -|`configuration().online_date` | `online_date`| | -|`defaults().instruction_schedule_map`|`instruction_schedule_map`| | -|`properties().t1(0)`|`qubit_properties(0).t1`| | -|`properties().t2(0)`|`qubit_properties(0).t2`| | -|`properties().frequency(0)`|`qubit_properties(0).frequency`| | -|`properties().readout_error(0)`|`target["measure"][(0,)].error`| In [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2), the error rate for the [`Measure`](/api/qiskit/circuit#measure) operation on a given qubit is used to model the readout error. However, a [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2) object can implement multiple measurement types and list them separately in a [`Target`](/api/qiskit/qiskit.transpiler.Target).| -|`properties().readout_length(0)`|`target["measure"][(0,)].duration`| In [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2), the duration for the [`Measure`](/api/qiskit/circuit#measure) operation on a given qubit is used to model the readout length. However, a [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2) object can implement multiple measurement types and list them separately in a [`Target`](/api/qiskit/qiskit.transpiler.Target).| - -Other - -|[`BackendV1`](/api/qiskit/qiskit.providers.BackendV1) | [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2) | -| --- | --- | -|`InstructionDurations.from_backend(backend)`|`backend.instruction_durations`| From 27b3c56ca2249f387846729cc57d728aacc1940f Mon Sep 17 00:00:00 2001 From: Rebecca Dimock Date: Fri, 14 Mar 2025 10:46:35 -0500 Subject: [PATCH 17/21] put back in the 1.4 links --- docs/migration-guides/qiskit-backendv1-to-v2.mdx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/migration-guides/qiskit-backendv1-to-v2.mdx b/docs/migration-guides/qiskit-backendv1-to-v2.mdx index a7053e86854..3bd5b04e745 100644 --- a/docs/migration-guides/qiskit-backendv1-to-v2.mdx +++ b/docs/migration-guides/qiskit-backendv1-to-v2.mdx @@ -5,16 +5,16 @@ description: How to update your code to use `BackendV2` instead of `BackendV1`. # Migrate from `BackendV1` to `BackendV2` -The Qiskit [`BackendV1`](/api/qiskit/qiskit.providers.BackendV1) class has been deprecated and will be removed from service. This migration guide describes the small adjustments you need to make if your are a user of a provider that upgraded from [`BackendV1`](/api/qiskit/qiskit.providers.BackendV1) to [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2). +The Qiskit [`BackendV1`](/api/qiskit/1.4/qiskit.providers.BackendV1) class has been deprecated and will be removed from service. This migration guide describes the small adjustments you need to make if your are a user of a provider that upgraded from [`BackendV1`](/api/qiskit/1.4/qiskit.providers.BackendV1) to [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2). ## High-level changes in `BackendV2` The Qiskit [`Backend`](/api/qiskit/qiskit.providers.Backend) model was designed to provide the Qiskit SDK with an abstraction layer that enabled reasoning about quantum computers within the scope of the SDK. The first iteration of the model was introduced with the -[`BackendV1`](/api/qiskit/qiskit.providers.BackendV1) class. This class stored the backend information in a series -of data containers, namely the [`BackendConfiguration`](/api/qiskit/qiskit.providers.models.BackendConfiguration) and -[`BackendProperties`](/api/qiskit/qiskit.providers.models.BackendProperties) classes. +[`BackendV1`](/api/qiskit/1.4/qiskit.providers.BackendV1) class. This class stored the backend information in a series +of data containers, namely the [`BackendConfiguration`](/api/qiskit/1.4/qiskit.providers.models.BackendConfiguration) and +[`BackendProperties`](/api/qiskit/1.4/qiskit.providers.models.BackendProperties) classes. The [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2) class redefined user access for most backend properties to make them work with native Qiskit data structures and have flatter @@ -22,7 +22,7 @@ access patterns. The core of the [`BackendV2`](/api/qiskit/qiskit.providers.Back [`Target`](/api/qiskit/qiskit.transpiler.Target) class, a representation of the QPU that contains the transpilation constraints that Qiskit can use to optimize circuits for execution. The Qiskit SDK has been updated to work exclusively with [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2) inputs, -and most providers have upgraded from [`BackendV1`](/api/qiskit/qiskit.providers.BackendV1) to [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2). It is expected that existing providers will deprecate the old access where possible to provide a graceful migration, but eventually users will need to adjust their code. +and most providers have upgraded from [`BackendV1`](/api/qiskit/1.4/qiskit.providers.BackendV1) to [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2). It is expected that existing providers will deprecate the old access where possible to provide a graceful migration, but eventually users will need to adjust their code. The principle behind [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2) is that most of the information about a backend is contained in its @@ -45,17 +45,17 @@ it might be necessary to look deeper than just the equivalent access with Most attributes have a direct replacement, simplifying the migration efforts. The only point of mismatch between interfaces is in the [`CouplingMap`](/api/qiskit/qiskit.transpiler.CouplingMap). -Following is a table of example access patterns in [`BackendV1`](/api/qiskit/qiskit.providers.BackendV1) and the new form +Following is a table of example access patterns in [`BackendV1`](/api/qiskit/1.4/qiskit.providers.BackendV1) and the new form with [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2). Scroll to the right to see important notes. -|[`BackendV1`](/api/qiskit/qiskit.providers.BackendV1) | [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2) | Notes | +|[`BackendV1`](/api/qiskit/1.4/qiskit.providers.BackendV1) | [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2) | Notes | | --- | --- | --- | |`backend.configuration().n_qubits` | `backend.num_qubits`| | -|`backend.configuration().coupling_map` | `backend.coupling_map` | The return from [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2) is a [`CouplingMap`](/api/qiskit/qiskit.transpiler.CouplingMap) object. In [`BackendV1`](/api/qiskit/qiskit.providers.BackendV1) it is an edge list. Also, this is just a view of the information contained in `backend.target` which may only be a subset of the information contained in the [`Target`](/api/qiskit/qiskit.transpiler.Target) object. | +|`backend.configuration().coupling_map` | `backend.coupling_map` | The return from [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2) is a [`CouplingMap`](/api/qiskit/qiskit.transpiler.CouplingMap) object. In [`BackendV1`](/api/qiskit/1.4/qiskit.providers.BackendV1) it is an edge list. Also, this is just a view of the information contained in `backend.target` which may only be a subset of the information contained in the [`Target`](/api/qiskit/qiskit.transpiler.Target) object. | |`backend.configuration().backend_name` | `backend.name` | | |`backend.configuration().backend_version` | `backend.backend_version` | The `BackendV2.version` attribute represents the version of the abstract [`Backend`](/api/qiskit/qiskit.providers.Backend) interface that the object implements, while `BackendV2.backend_version` is metadata about the version of the backend itself. | |`backend.configuration().basis_gates` | `backend.operation_names` | The [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2) returns a list of operation names contained in the `backend.target` attribute. The [`Target`](/api/qiskit/qiskit.transpiler.Target) might contain more information than can be expressed by this list of names. For example, some operations only work on a subset of qubits, and some names implement the same gate with different parameters.| From 578980c976950ec3a8e329c1208fadfb709e6db0 Mon Sep 17 00:00:00 2001 From: Rebecca Dimock Date: Fri, 14 Mar 2025 12:40:44 -0500 Subject: [PATCH 18/21] Add new tag --- docs/migration-guides/_toc.json | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/migration-guides/_toc.json b/docs/migration-guides/_toc.json index d786879e9ad..4a390eb7aa3 100644 --- a/docs/migration-guides/_toc.json +++ b/docs/migration-guides/_toc.json @@ -11,6 +11,7 @@ "children": [ { "title": "Migrate from BackendV1 to BackendV2", + "isNew": true, "url": "/migration-guides/qiskit-backendv1-to-v2" } ] From ce29f504fc31651c4eb9113026d3f0385517f210 Mon Sep 17 00:00:00 2001 From: Rebecca Dimock Date: Fri, 14 Mar 2025 12:42:55 -0500 Subject: [PATCH 19/21] Add more new tags --- docs/migration-guides/_toc.json | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/docs/migration-guides/_toc.json b/docs/migration-guides/_toc.json index f1b0f64a414..0f04bbcfdc2 100644 --- a/docs/migration-guides/_toc.json +++ b/docs/migration-guides/_toc.json @@ -82,8 +82,14 @@ "title": "Migrate from qiskit-ibm-provider", "url": "/migration-guides/qiskit-runtime-from-ibm-provider" }, + { + "title": "Migrate provider interfaces from backend.run to primitives", + "isNew": true, + "url": "/migration-guides/external-providers-primitives-v2" + }, { "title": "Migrate to primitives for users of third-party providers with backend.run", + "isNew": true, "url": "/migration-guides/qiskit-backend-primitives" }, { @@ -100,10 +106,6 @@ } ] }, - { - "title": "Migrate provider interfaces from backend.run to primitives", - "url": "/migration-guides/external-providers-primitives-v2" - }, { "title": "Qiskit 0.44 changes", "children": [ From b9398648d3d7b7758f61d12643e85d3cc3906f8b Mon Sep 17 00:00:00 2001 From: Rebecca Dimock Date: Fri, 14 Mar 2025 13:10:26 -0500 Subject: [PATCH 20/21] Add note from jessie --- docs/migration-guides/qiskit-backendv1-to-v2.mdx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/migration-guides/qiskit-backendv1-to-v2.mdx b/docs/migration-guides/qiskit-backendv1-to-v2.mdx index 3bd5b04e745..cb5d97336db 100644 --- a/docs/migration-guides/qiskit-backendv1-to-v2.mdx +++ b/docs/migration-guides/qiskit-backendv1-to-v2.mdx @@ -5,7 +5,11 @@ description: How to update your code to use `BackendV2` instead of `BackendV1`. # Migrate from `BackendV1` to `BackendV2` -The Qiskit [`BackendV1`](/api/qiskit/1.4/qiskit.providers.BackendV1) class has been deprecated and will be removed from service. This migration guide describes the small adjustments you need to make if your are a user of a provider that upgraded from [`BackendV1`](/api/qiskit/1.4/qiskit.providers.BackendV1) to [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2). +The Qiskit [`BackendV1`](/api/qiskit/1.4/qiskit.providers.BackendV1) class has been deprecated and will be removed from service. This migration guide describes the small adjustments you need to make if you use a provider that upgraded from [`BackendV1`](/api/qiskit/1.4/qiskit.providers.BackendV1) to [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2). + + + If you exclusively use `qiskit_ibm_runtime` and `qiskit_aer`, no action is needed. The `qiskit_ibm_runtime` package has always used `BackendV2`, and `qiskit_aer` has used `BackendV2` 0.13. + ## High-level changes in `BackendV2` From 0e5791cf61b832915580e7b2dabb846ed73db546 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elena=20Pe=C3=B1a=20Tapia?= <57907331+ElePT@users.noreply.github.com> Date: Mon, 17 Mar 2025 10:49:33 +0100 Subject: [PATCH 21/21] Update qiskit-backendv1-to-v2.mdx Co-authored-by: Jessie Yu --- docs/migration-guides/qiskit-backendv1-to-v2.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/migration-guides/qiskit-backendv1-to-v2.mdx b/docs/migration-guides/qiskit-backendv1-to-v2.mdx index cb5d97336db..70eeaaf09af 100644 --- a/docs/migration-guides/qiskit-backendv1-to-v2.mdx +++ b/docs/migration-guides/qiskit-backendv1-to-v2.mdx @@ -8,7 +8,7 @@ description: How to update your code to use `BackendV2` instead of `BackendV1`. The Qiskit [`BackendV1`](/api/qiskit/1.4/qiskit.providers.BackendV1) class has been deprecated and will be removed from service. This migration guide describes the small adjustments you need to make if you use a provider that upgraded from [`BackendV1`](/api/qiskit/1.4/qiskit.providers.BackendV1) to [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2). - If you exclusively use `qiskit_ibm_runtime` and `qiskit_aer`, no action is needed. The `qiskit_ibm_runtime` package has always used `BackendV2`, and `qiskit_aer` has used `BackendV2` 0.13. + If you exclusively use `qiskit_ibm_runtime` and `qiskit_aer`, no action is needed. The `qiskit_ibm_runtime` package has always used `BackendV2`, and `qiskit_aer` has used `BackendV2` since version 0.13.