Home Reference Source
import IBMHTTPClient from 'projectq/src/backends/ibm/ibmhttpclient.js'
public class | source

IBMHTTPClient

Static Method Summary

Static Public Methods
public static

async authenticate(email: string, password: string): undefined[]

public static

async getResult(device: *, execution_id: *, access_token: *, num_retries: number, interval: number): *

public static

async isOnline(device: *): *

public static

async retrieve(device: string, user: string, password: string, jobid: string): *

Retrieves a previously run job by its ID.

public static

async run(qasm: *, device: *, user_id: *, access_token: *, shots: *): *

public static

async send(info: string, device: string, user: string, password: string, shots: number, verbose: boolean): *

Sends QASM through the IBM API and runs the quantum circuit.

public static

async sleep(interval: *): *

Static Public Methods

public static async authenticate(email: string, password: string): undefined[] source

Params:

NameTypeAttributeDescription
email string
  • optional
  • default:
password string
  • optional
  • default:

Return:

undefined[]

public static async getResult(device: *, execution_id: *, access_token: *, num_retries: number, interval: number): * source

Params:

NameTypeAttributeDescription
device *
execution_id *
access_token *
num_retries number
  • optional
  • default: 3000
interval number
  • optional
  • default: 1

Return:

*

public static async isOnline(device: *): * source

Params:

NameTypeAttributeDescription
device *

Return:

*

public static async retrieve(device: string, user: string, password: string, jobid: string): * source

Retrieves a previously run job by its ID.

Params:

NameTypeAttributeDescription
device string

Device on which the code was run / is running.

user string

IBM quantum experience user (e-mail)

password string

IBM quantum experience password

jobid string

Id of the job to retrieve

Return:

*

public static async run(qasm: *, device: *, user_id: *, access_token: *, shots: *): * source

Params:

NameTypeAttributeDescription
qasm *
device *
user_id *
access_token *
shots *

Return:

*

public static async send(info: string, device: string, user: string, password: string, shots: number, verbose: boolean): * source

Sends QASM through the IBM API and runs the quantum circuit.

Params:

NameTypeAttributeDescription
info string

Contains QASM representation of the circuit to run.

device string

Either 'simulator', 'ibmqx4', or 'ibmqx5'.

user string

IBM quantum experience user.

password string

IBM quantum experience user password.

shots number

Number of runs of the same circuit to collect statistics.

verbose boolean

If true, additional information is printed, such as measurement statistics. Otherwise, the backend simply registers one measurement result (same behavior as the projectq Simulator).

Return:

*

public static async sleep(interval: *): * source

Params:

NameTypeAttributeDescription
interval *

Return:

*