AccountProvider
class AccountProvider(credentials, access_token)
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
The backends
attribute can be used to autocomplete the names of backends available to this provider. To autocomplete, press tab
after provider.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
backends
AccountProvider.backends(name=None, **kwargs)
Return all backends accessible via this provider, subject to optional filtering.
Return type
List
[IBMQBackend
]
get_backend
AccountProvider.get_backend(name=None, **kwargs)
Return a single backend matching the specified filtering.
Parameters
- name (str) – name of the backend.
- **kwargs – dict used for filtering.
Returns
a backend matching the filtering.
Return type
Raises
QiskitBackendNotFoundError – if no backend could be found or more than one backend matches the filtering criteria.