AccountProvider¶
- class AccountProvider(credentials, access_token)[source]¶
Provider for a single IBM Quantum Experience account.
The account provider class provides access to the IBM Quantum Experience backends 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.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
backends
attribute to reference a backend. As an example, to retrieve the same backend from the example above:simulator_backend = provider.backends.ibmq_qasm_simulator
Note
The
backends
attribute can be used to autocomplete the names of backends available to this provider. To autocomplete, presstab
afterprovider.backends.
. 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.
- Parameters
credentials (
Credentials
) – IBM Quantum Experience credentials.access_token (
str
) – IBM Quantum Experience access token.
Methods
AccountProvider.backends
([name])Return all backends accessible via this provider, subject to optional filtering.
AccountProvider.get_backend
([name])Return a single backend matching the specified filtering.