Japanese
言語
English
Bengali
French
German
Japanese
Korean
Portuguese
Spanish
Tamil

警告

The package qiskit-ibmq-provider is being deprecated and its repo is going to be archived soon. Please transition to the new packages. More information in https://ibm.biz/provider_migration_guide

AccountProvider

class AccountProvider(credentials, factory)[ソース]

ベースクラス: ProviderV1

Provider for a single IBM Quantum Experience account.

The account provider class provides access to the IBM Quantum Experience services available to this account.

You can access a provider by enabling an account with the IBMQ.enable_account() method, which returns the default provider you have access to:

from qiskit import IBMQ
provider = IBMQ.enable_account(<INSERT_IBM_QUANTUM_EXPERIENCE_TOKEN>)

To select a different provider, use the IBMQ.get_provider() method and specify the hub, group, or project name of the desired provider.

Each provider may offer different services. The main service, IBMQBackendService, is available to all providers and gives access to IBM Quantum Experience devices and simulators.

You can obtain an instance of a service using the service() method or as an attribute of this AccountProvider instance. For example:

backend_service = provider.service('backend')
backend_service = provider.service.backend

Since IBMQBackendService is the main service, some of the backend-related methods are available through this class for convenience.

The backends() method returns all the backends available to this account:

backends = provider.backends()

The get_backend() method returns a backend that matches the filters passed as argument. An example of retrieving a backend that matches a specified name:

simulator_backend = provider.get_backend('ibmq_qasm_simulator')

It is also possible to use the backend attribute to reference a backend. As an example, to retrieve the same backend from the example above:

simulator_backend = provider.backend.ibmq_qasm_simulator

注釈

The backend attribute can be used to autocomplete the names of backends available to this provider. To autocomplete, press tab after provider.backend.. This feature may not be available if an error occurs during backend discovery. Also note that this feature is only available in interactive sessions, such as in Jupyter Notebook and the Python interpreter.

AccountProvider constructor.

パラメータ
  • credentials (Credentials) – IBM Quantum Experience credentials.

  • factory (IBMQFactory) – IBM Quantum account.

Methods

backends

Return all backends accessible via this provider, subject to optional filtering.

get_backend

Return a single backend matching the specified filtering.

has_service

Check if this provider has access to the service.

run_circuits

Execute the input circuit(s) on a backend using the runtime service.

service

Return the specified service.

services

Return all available services.

Attributes

backend

Return the backend service.

戻り値の型

IBMQBackendService

戻り値

The backend service instance.

experiment

Return the experiment service.

戻り値の型

IBMExperimentService

戻り値

The experiment service instance.

例外

IBMQNotAuthorizedError – If the account is not authorized to use the experiment service.

runtime

Return the runtime service.

戻り値の型

IBMRuntimeService

戻り値

The runtime service instance.

例外

IBMQNotAuthorizedError – If the account is not authorized to use the service.

version = 1