I have, let's say, the following quantum circuit:
The QASM code of this quantum scheme has the following form:
OPENQASM 2.0;
include "qelib1.inc";
qreg q[5];
creg c[5];
reset q[0];
reset q[1];
reset q[2];
reset q[3];
reset q[4];
x q[0];
x q[1];
x q[2];
x q[3];
x q[4];
measure q[0] -> c[0];
measure q[1] -> c[1];
measure q[2] -> c[2];
measure q[3] -> c[3];
measure q[4] -> c[4];
I want to send the QASM code to IBM and get the result. In our case, I want to get [1, 1, 1, 1, 1]
.
I don't understand which endpoints I should send my requests to (probably POST requests) and what I should pass in the message body (in the JSON object).
I was able to execute a GET request to log in and get my access token (access ID). But I don't know what to do next.
There is no complete documentation for the API. Here is what is available now.
In what form I would like to see the answer (here I show how to log in and get an access token):
First step: get an access token.
HTTP request method: POST
Endpoint: https://api.quantum-computing.ibm.com/v2/users/loginWithToken
JSON request: {
"apiToken": "YOUR_API_TOKEN"
}
JSON response: {
"id": "YOUR_ACCESS_ID_TOKEN",
"ttl": "YOUR_ACCESS_ID_TOKEN_LIFETIME",
"created": "YOUR_ACCESS_ID_TOKEN_CREATIONDATE",
"userId": "YOUR_USER_ID"
}
Second step: I can't figure out which requests to send next to execute my QASM code and get the result [1, 1, 1, 1, 1]
.