qiskit_serverless.core.IBMServerlessClient¶
- class IBMServerlessClient(token=None, name=None)[source]¶
A client for connecting to the IBM serverless host.
Credentials can be saved to disk by calling the save_account() method:
from qiskit_serverless import IBMServerlessClient IBMServerlessClient.save_account(token=<INSERT_IBM_QUANTUM_TOKEN>)
Once the credentials are saved, you can simply instantiate the client with no constructor args, as shown below.
from qiskit_serverless import IBMServerlessClient client = IBMServerlessClient()
Instead of saving credentials to disk, you can also set the environment variable ENV_GATEWAY_PROVIDER_TOKEN and then instantiate the client as below:
from qiskit_serverless import IBMServerlessClient client = IBMServerlessClient()
You can also enable an account just for the current session by instantiating the provider with the API token:
from qiskit_serverless import IBMServerlessClient client = IBMServerlessClient(token=<INSERT_IBM_QUANTUM_TOKEN>)
Initialize a client with access to an IBMQ-provided remote cluster.
If a
token
is used to initialize an instance, thename
argument will be ignored.If only a
name
is provided, the token for the named account will be retrieved from the user’s local IBM Quantum account config file.If neither argument is provided, the token will be searched for in the environment variables and also in the local IBM Quantum account config file using the default account name.
- Parameters:
token (
Optional
[str
]) – IBM quantum tokenname (
Optional
[str
]) – Name of the account to load
- __init__(token=None, name=None)[source]¶
Initialize a client with access to an IBMQ-provided remote cluster.
If a
token
is used to initialize an instance, thename
argument will be ignored.If only a
name
is provided, the token for the named account will be retrieved from the user’s local IBM Quantum account config file.If neither argument is provided, the token will be searched for in the environment variables and also in the local IBM Quantum account config file using the default account name.
- Parameters:
token (
Optional
[str
]) – IBM quantum tokenname (
Optional
[str
]) – Name of the account to load
Methods
__init__
([token, name])Initialize a client with access to an IBMQ-provided remote cluster.
file_delete
(file, function)Deletes a file available to the user for the specific Qiskit Function.
file_download
(file, function[, target_name, ...])Download a file available to the user for the specific Qiskit Function.
file_upload
(file, function)Uploads a file in the specific user's Qiskit Function folder.
files
(function)Returns the list of files available for the user in the Qiskit Function folder.
filtered_logs
(job_id, **kwargs)Returns logs of the job.
from_dict
(dictionary)Converts dict to object.
function
(**kwargs)The wrapper
functions
(**kwargs)The wrapper
get
(title[, provider])Returns program based on parameters.
get_job_by_id
(job_id)Returns job by job id.
get_jobs
(**kwargs)Return list of jobs.
job
(**kwargs)The wrapper
jobs
(**kwargs)The wrapper
list
(**kwargs)Returns list of available programs.
logs
(**kwargs)The wrapper
provider_file_delete
(file, function)Deletes a file available to the provider for the specific Qiskit Function.
provider_file_download
(file, function[, ...])Download a file available to the provider for the specific Qiskit Function.
provider_file_upload
(file, function)Uploads a file in the specific provider's Qiskit Function folder.
provider_files
(function)Returns the list of files available for the provider in the Qiskit Function folder.
result
(**kwargs)The wrapper
run
(program[, arguments, config, provider])Run a function and return its job.
save_account
([token, name, overwrite])Save the account to disk for future use.
status
(**kwargs)The wrapper
stop
(**kwargs)The wrapper
to_dict
()Converts class to dict.
upload
(program)Uploads program.
widget
()Widget for information about provider and jobs.