qiskit_serverless.core.IBMServerlessClient

class IBMServerlessClient(token=None, name=None, instance=None, channel='ibm_quantum')[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, the name 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 token

  • name (Optional[str]) – Name of the account to load

  • instance (Optional[str]) – IBM Cloud CRN

  • channel (str) – identifies the method to use to authenticate the user

__init__(token=None, name=None, instance=None, channel='ibm_quantum')[source]

Initialize a client with access to an IBMQ-provided remote cluster.

If a token is used to initialize an instance, the name 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 token

  • name (Optional[str]) – Name of the account to load

  • instance (Optional[str]) – IBM Cloud CRN

  • channel (str) – identifies the method to use to authenticate the user

Methods

__init__([token, name, instance, channel])

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(title[, provider])

Returns program based on parameters.

functions(**kwargs)

Returns list of available functions.

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(job_id)

Returns job by job id.

jobs(**kwargs)

Return list of jobs.

list(**kwargs)

Returns list of available programs.

logs(job_id)

Return logs.

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.

provider_jobs(function, **kwargs)

List of jobs created in this provider and function.

result(job_id)

Return results.

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(job_id)

Check status.

stop(job_id[, service])

Stops job/program.

to_dict()

Converts class to dict.

upload(program)

Uploads program.

widget()

Widget for information about provider and jobs.