diff --git a/docs/run/configure-error-mitigation.mdx b/docs/run/configure-error-mitigation.mdx index 3d6bb0f6c14..59b954f7ac7 100644 --- a/docs/run/configure-error-mitigation.mdx +++ b/docs/run/configure-error-mitigation.mdx @@ -55,18 +55,18 @@ service = QiskitRuntimeService(channel="ibm_cloud", channel_strategy="q-ctrl") - In V2, Estimator supports the following resilience levels. Sampler does not support resilience levels. + In V2, Estimator supports the following resilience levels. Sampler does not support resilience levels. | Resilience Level | Definition | Technique | |------------------|-------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------| | 0 | No mitigation | None | | 1 [Default] | Minimal mitigation costs: Mitigate error associated with readout errors | Twirled Readout Error eXtinction (TREX) measurement twirling | -| 2 | Medium mitigation costs. Typically reduces bias in estimators, but is not guaranteed to be zero-bias. | Level 1 + Zero Noise Extrapolation (ZNE) and gate twirling +| 2 | Medium mitigation costs. Typically reduces bias in estimators, but is not guaranteed to be zero-bias. | Level 1 + Zero Noise Extrapolation (ZNE) and gate twirling - Resilience levels in V1 primitives: + Resilience levels in V1 primitives: | Resilience Level | Definition | Estimator | Sampler | |------------------|-------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------|----------------------------------------| @@ -91,7 +91,7 @@ applied at each resilience level. If using an IBM Cloud® Qiskit Runtime service instance with Q-CTRL performance management enabled, there is no need to specify runtime optimization or resilience levels, as the strategy includes an automatic preset. - + Setting `optimization_level` or `resilience_level` equal to 0 will result in an execution error. Levels 1, 2, and 3 are permitted but will not impact performance. Setting other options will likewise not impact performance, and it may result in a @@ -389,7 +389,7 @@ With the V2 primitives, you can turn on and off individual error mitigation and - ```python + ```python from qiskit_ibm_runtime import QiskitRuntimeService from qiskit_ibm_runtime import EstimatorV2 as Estimator @@ -409,7 +409,7 @@ print(f">>> measurement error mitigation is turned on: {estimator.options.resili -```python +```python from qiskit_ibm_runtime import SamplerV2 as Sampler, Options # Estimator and Sampler now have different options @@ -464,7 +464,7 @@ options.resilience_level = 2 options.resilience.noise_factors = (1, 2, 3, 4) options.resilience.noise_amplifier = 'CxAmplifier' options.resilience.extrapolator = 'QuadraticExtrapolator' -backend = service.backend("ibmq_qasm_simulator") +backend = service.least_busy(operational=True, simulator=False) estimator = Estimator(options=options, backend=backend) job = estimator.run(circuits=[psi1], observables=[H1], parameter_values=[theta1]) diff --git a/docs/run/configure-runtime-compilation.mdx b/docs/run/configure-runtime-compilation.mdx index 73104930203..f10a4567292 100644 --- a/docs/run/configure-runtime-compilation.mdx +++ b/docs/run/configure-runtime-compilation.mdx @@ -59,7 +59,7 @@ The `optimization_level` setting specifies how much optimization to perform on t If using an IBM Cloud® Qiskit Runtime service instance with Q-CTRL performance management enabled, there is no need to specify runtime optimization or resilience levels, as the strategy includes an automatic preset. - + Q-CTRL defaults to `optimization_level=3` and `resilience_level=1`. Setting `optimization_level` or `resilience_level` equal to 0 will result in an execution error. Levels 1, 2, and 3 are permitted but will not impact performance. @@ -95,7 +95,7 @@ estimator.options.optimization_level = 1 job = estimator.run([(psi, H, theta)]) psi1_H1 = job.result()[0] - ``` + ``` @@ -106,7 +106,7 @@ from qiskit.circuit.library import RealAmplitudes from qiskit.quantum_info import SparsePauliOp service = QiskitRuntimeService() -backend = service.backend("ibmq_qasm_simulator") +backend = service.least_busy(operational=True, simulator=False) options = Options(optimization_level=1) psi = RealAmplitudes(num_qubits=2, reps=2) @@ -136,7 +136,7 @@ psi1_H1 = job.result() - In the V2 primitives, you can explicitly enable and disable individual error mitigation/suppression methods, such as dynamical decoupling. + In the V2 primitives, you can explicitly enable and disable individual error mitigation/suppression methods, such as dynamical decoupling. Dynamical decoupling is not supported when the input circuits are dynamic. @@ -156,11 +156,11 @@ sampler.options.dynamical_decoupling.enable = True sampler.options.dynamical_decoupling.sequence_type = "XpXm" print(f">>> dynamical decoupling sequence to use: {sampler.options.dynamical_decoupling.sequence_type}") -``` +``` - Because all input must be ISA, options.transpilation.xxx will be ignored. + Because all input must be ISA, options.transpilation.xxx will be ignored. diff --git a/docs/run/get-backend-information.ipynb b/docs/run/get-backend-information.ipynb index c1b3c246583..33b8091f318 100644 --- a/docs/run/get-backend-information.ipynb +++ b/docs/run/get-backend-information.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "214e51c9-4818-408b-9421-3e513e77a713", + "id": "38a02b47-8d5e-4a51-9448-3e24a9656cf9", "metadata": {}, "source": [ "# Get backend information with Qiskit\n", @@ -12,7 +12,7 @@ }, { "cell_type": "markdown", - "id": "2126b05d-1cc8-4230-bfe3-25461a0f1b5b", + "id": "1af5ab76-c979-4908-b292-18aeb86fbdd3", "metadata": {}, "source": [ "## List backends\n", @@ -23,21 +23,16 @@ { "cell_type": "code", "execution_count": 1, - "id": "2074e1b8-d294-4c5b-82ba-cd9d7a190598", + "id": "859739b7-df70-43ed-8074-ac40874103e1", "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "[,\n", + "[,\n", + " ,\n", " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ,\n", - " ]" + " ]" ] }, "execution_count": 1, @@ -55,7 +50,7 @@ }, { "cell_type": "markdown", - "id": "ad27cfef-1684-4c77-80ab-aef61d204acd", + "id": "a529ca05-2e7f-4cfb-8593-7fcf16605df9", "metadata": {}, "source": [ "The [`QiskitRuntimeService.backend()`](../api/qiskit-ibm-runtime/qiskit_ibm_runtime.QiskitRuntimeService#backend) method (note that this is singular: *backend*) takes the name of the backend as the input parameter and returns an [`IBMBackend`](../api/qiskit-ibm-runtime/qiskit_ibm_runtime.IBMBackend) instance representing that particular backend:" @@ -64,7 +59,7 @@ { "cell_type": "code", "execution_count": 2, - "id": "e8716516-ded8-45b5-9304-fc199fa3a877", + "id": "3fe0e47c-0909-452f-9fac-725013f7cc15", "metadata": {}, "outputs": [ { @@ -84,7 +79,7 @@ }, { "cell_type": "markdown", - "id": "b1f8f3f5-4014-454b-8783-09291e246f69", + "id": "42f5a826-9769-438f-9006-32e652ad5c92", "metadata": {}, "source": [ "## Filter backends\n", @@ -101,7 +96,7 @@ { "cell_type": "code", "execution_count": 3, - "id": "9db4aaa2-f23c-4141-b7aa-07f84a679292", + "id": "35a0fe0e-9f5d-4839-a550-00f7ffef20ea", "metadata": {}, "outputs": [ { @@ -124,7 +119,7 @@ }, { "cell_type": "markdown", - "id": "6de23dcc-c2ba-4338-b1e8-4086ed653240", + "id": "39ae720d-6073-47fe-9bfa-c755dfe9e22f", "metadata": {}, "source": [ "Use these keyword arguments to filter by any attribute in backend configuration ([JSON schema](https://github.com/Qiskit/ibm-quantum-schemas/blob/main/schemas/backend_configuration_schema.json)) or status ([JSON schema](https://github.com/Qiskit/ibm-quantum-schemas/blob/main/schemas/backend_status_schema.json)). A similar method is [`QiskitRuntimeService.least_busy()`](../api/qiskit-ibm-runtime/qiskit_ibm_runtime.QiskitRuntimeService#least_busy), which takes the same filters as `backends()` but returns the backend that matches the filters and has the least number of jobs pending in the queue:" @@ -132,17 +127,17 @@ }, { "cell_type": "code", - "execution_count": 4, - "id": "4c296c69-6f30-4cf1-97c5-42989e30db8b", + "execution_count": 2, + "id": "52dac71b-f57c-4482-bc5b-50172014cfd1", "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "" + "" ] }, - "execution_count": 4, + "execution_count": 2, "metadata": {}, "output_type": "execute_result" } @@ -153,7 +148,7 @@ }, { "cell_type": "markdown", - "id": "dc892148-094e-4a5b-8514-a96436dce1b1", + "id": "aa6be8fe-fef8-4652-99f8-ebe5948982d8", "metadata": {}, "source": [ "## Static backend information\n", @@ -166,7 +161,7 @@ { "cell_type": "code", "execution_count": 5, - "id": "0e7e3c43-4aa1-43d2-93b5-31e4abbb3dd5", + "id": "f894f518-98ed-40cd-97f4-1780c06be244", "metadata": {}, "outputs": [ { @@ -192,7 +187,7 @@ }, { "cell_type": "markdown", - "id": "ac81677d-12bd-4671-8452-3107edcfbd50", + "id": "7832d222-86c7-4412-8d33-edaac4e27524", "metadata": {}, "source": [ "For a full list of attributes, see the [`IBMBackend` API documentation](/api/qiskit-ibm-runtime/qiskit_ibm_runtime.IBMBackend)." @@ -200,7 +195,7 @@ }, { "cell_type": "markdown", - "id": "24b212d0-c5dc-4640-8a00-76255784ef72", + "id": "b5f675a5-f295-4d80-87f4-2b48af34d234", "metadata": {}, "source": [ "## Dynamic backend information\n", @@ -216,7 +211,7 @@ { "cell_type": "code", "execution_count": 6, - "id": "9c1fc8ca-fd06-409f-9a5a-ce99d8b936e4", + "id": "7aaf40eb-3073-42d8-9764-e42747368b95", "metadata": {}, "outputs": [ { @@ -236,7 +231,7 @@ }, { "cell_type": "markdown", - "id": "9ce06354-4fcb-444d-a2d6-abe6caf1d318", + "id": "e6d716f5-aeed-4aba-ae59-a9672965a6fe", "metadata": {}, "source": [ "### Instruction properties\n", @@ -247,7 +242,7 @@ { "cell_type": "code", "execution_count": 7, - "id": "c8b88454-dfef-4c35-b4e2-a03fe34eaa07", + "id": "0eb87c44-57b2-4b90-8458-8e2f813a657d", "metadata": {}, "outputs": [ { @@ -267,7 +262,7 @@ }, { "cell_type": "markdown", - "id": "931a81bc-8bd1-4aba-bfa5-e05984df713d", + "id": "69b65568-2931-4cbd-932b-8b6135a9820b", "metadata": {}, "source": [ "The following cell shows the properties for a measurement operation (including the readout error) on qubit 0." @@ -276,7 +271,7 @@ { "cell_type": "code", "execution_count": 8, - "id": "040f5267-f635-4871-89bb-14a38904033e", + "id": "178ec9a9-dc95-4876-9a68-1fab621aa37a", "metadata": {}, "outputs": [ { @@ -296,7 +291,7 @@ }, { "cell_type": "markdown", - "id": "3c28c0dc-6d24-4554-bbe8-8e6c51f563d9", + "id": "36a47004-69d0-4af6-83b3-0e5e1247b5bf", "metadata": {}, "source": [ "## Next steps\n", diff --git a/docs/start/setup-channel.mdx b/docs/start/setup-channel.mdx index ed34aec74c4..f6c53f24356 100644 --- a/docs/start/setup-channel.mdx +++ b/docs/start/setup-channel.mdx @@ -5,7 +5,7 @@ description: Installation and setup instructions for IBM Quantum Platform or IBM # Set up an IBM Quantum channel -You can access IBM Quantum™ systems by using the IBM Quantum Platform or IBM Cloud® _channel_. _Channel_ is the term used to describe the method you use to access IBM Quantum services. +You can access IBM Quantum™ systems by using the IBM Quantum Platform or IBM Cloud® _channel_. _Channel_ is the term used to describe the method you use to access IBM Quantum services. ## Select an IBM Quantum channel @@ -15,9 +15,9 @@ You have the option to access IBM Quantum hardware through either [IBM Quantum P IBM Quantum Platform has Open (free access) and Premium (enterprise subscription) plans. See [IBM Quantum access plans](https://www.ibm.com/quantum/access-plans) for details. -Before setting up with IBM Quantum Platform, make sure you have the [Qiskit SDK and Qiskit Runtime installed](install#local). +Before setting up with IBM Quantum Platform, make sure you have the [Qiskit SDK and Qiskit Runtime installed](install#local). -Available plans: +Available plans: * **Open Plan** - Run your quantum circuits on the world's best quantum systems for free (up to 10 minutes quantum time per month). @@ -43,7 +43,7 @@ Available plans: 1. Before setting up with IBM Quantum Platform, ensure you are working in an active Python environment with the [Qiskit SDK and Qiskit Runtime installed](install#local). -1. If you do not already have a user account, get one at the [IBM Quantum login page.](https://quantum.ibm.com/login) Your user account is associated with one or more [instances](../run/instances) (in the form hub / group / project) that give access to IBM Quantum services. Additionally, a unique token is assigned to each account, allowing for IBM Quantum access from Qiskit. The instructions in this section use our default instance. For instructions to choose a specific instance, see [Connect to an instance](../run/instances#connect-instance). +1. If you do not already have a user account, get one at the [IBM Quantum login page.](https://quantum.ibm.com/login) Your user account is associated with one or more [instances](../run/instances) (in the form hub / group / project) that give access to IBM Quantum services. Additionally, a unique token is assigned to each account, allowing for IBM Quantum access from Qiskit. The instructions in this section use our default instance. For instructions to choose a specific instance, see [Connect to an instance](../run/instances#connect-instance). The Instances section in your [IBM Quantum account page](https://quantum.ibm.com/account) lists the instances that you can access. @@ -59,7 +59,7 @@ Available plans: service = QiskitRuntimeService(channel="ibm_quantum", token="") ``` - + Or, optionally use the `save_account()` method to save your credentials for easy access later on, before initializing the service. ```python @@ -72,10 +72,10 @@ Available plans: service = QiskitRuntimeService() ``` - * If you save your credentials to disk, you can use `QiskitRuntimeService()` in the future to initialize your account. The `channel` parameter distinguishes between different account types. If you are saving multiple accounts per channel, consider using the `name` parameter to differentiate them. - * If you are saving multiple accounts per channel, consider using the `name` parameter to differentiate them. - * Credentials are saved to `$HOME/.qiskit/qiskit-ibm.json`. Do not manually edit this file. - * If you don't save your credentials, you must specify them every time you start a new session. + * If you save your credentials to disk, you can use `QiskitRuntimeService()` in the future to initialize your account. The `channel` parameter distinguishes between different account types. If you are saving multiple accounts per channel, consider using the `name` parameter to differentiate them. + * If you are saving multiple accounts per channel, consider using the `name` parameter to differentiate them. + * Credentials are saved to `$HOME/.qiskit/qiskit-ibm.json`. Do not manually edit this file. + * If you don't save your credentials, you must specify them every time you start a new session. * The `channel` parameter allows you to distinguish between different account types. When initializing the account, IBM Cloud is the default account used if have saved credentials for an IBM Quantum Platform and an IBM Cloud account. @@ -83,7 +83,7 @@ Available plans: - IBM Cloud is the default account used if you don't specify a different channel or account name. + IBM Cloud is the default account used if you don't specify a different channel or account name. 1. Test your setup. Run a simple circuit using Sampler to ensure that your environment is set up properly: @@ -98,7 +98,7 @@ example_circuit.measure_all() # You'll need to specify the credentials when initializing QiskitRuntimeService, if they were not previously saved. service = QiskitRuntimeService() -backend = service.backend("ibmq_qasm_simulator") +backend = service.least_busy(operational=True, simulator=False) sampler = Sampler(backend) job = sampler.run([example_circuit]) @@ -143,7 +143,7 @@ print(result) ```python from qiskit_ibm_runtime import QiskitRuntimeService - # Save account to disk. + # Save account to disk. QiskitRuntimeService.save_account(channel="ibm_cloud", token="", instance="", name="") # Load saved credentials @@ -151,33 +151,21 @@ print(result) ``` * If you save your credentials to disk, you can use `QiskitRuntimeService()` in the future to initialize your account. The `channel` parameter distinguishes between different account types. When initializing the account, IBM Cloud is the default account used if you have saved credentials for both an IBM Quantum Platform and an IBM Cloud account. - * If you are saving multiple accounts per channel, consider using the `name` parameter to differentiate them. - * Credentials are saved to `$HOME/.qiskit/qiskit-ibm.json`. Do not manually edit this file. - * If you don't save your credentials, you must specify them every time you start a new session. + * If you are saving multiple accounts per channel, consider using the `name` parameter to differentiate them. + * Credentials are saved to `$HOME/.qiskit/qiskit-ibm.json`. Do not manually edit this file. + * If you don't save your credentials, you must specify them every time you start a new session. Account credentials are saved in plain text, so only do so if you are using a trusted device. - 1. Test your setup. Run a simple circuit using Sampler to ensure that your environment is set up properly: + 1. Test your setup. Ensure that you can connect to the service: ```python - from qiskit import QuantumCircuit - from qiskit_ibm_runtime import QiskitRuntimeService, SamplerV2 as Sampler - - # Create empty circuit - example_circuit = QuantumCircuit(2) - example_circuit.measure_all() + from qiskit_ibm_runtime import QiskitRuntimeService - # You'll need to specify the credentials when initializing QiskitRuntimeService, if they were not previously saved. service = QiskitRuntimeService() - backend = service.backend("ibmq_qasm_simulator") - sampler = Sampler(backend) - job = sampler.run([example_circuit]) - print(f"job id: {job.job_id()}") - result = job.result() - print(result) - ``` + ``` ## Next steps