Skip to main contentIBM Quantum Documentation

Transpiler methods

Qiskit & AI transpiler methods


Benchmark AI-powered passes

Returns a task ID; use the '/benchmark/{taskId}' endpoint to get the result.

Query Parameters

Name, TypeDescription
model
string

backend
string

The name of the backend to use for the benchmark. Refer to https://docs.quantum.ibm.com/run/get-backend-information.

Example: "ibm_kyoto"

HTTP Response Status Codes

Status codeDescription
200Successful Response
422Validation Error

Code samples

POST
/benchmark
curl -X POST \
  https://cloud-transpiler.quantum.ibm.com/benchmark \
  -H 'Authorization: Bearer YOUR-TOKEN' \
  -H 'Accept: application/json'

Responses

{
  "task_id": "example"
}

Get benchmark result

Path Parameters

Name, TypeDescription
task_id
Required
string

The ID of the benchmark task. This ID is returned by the '/benchmark' POST endpoint.

HTTP Response Status Codes

Status codeDescription
200Successful Response
422Validation Error

Code samples

GET
/benchmark/{task_id}
curl -X GET \
  https://cloud-transpiler.quantum.ibm.com/benchmark/{task_id} \
  -H 'Authorization: Bearer YOUR-TOKEN' \
  -H 'Accept: application/json'

Responses

{
  "state": "example",
  "result": null
}

Transpile circuits

Transpile abstract circuits into an instruction set architecture (ISA) circuit, either using Qiskit SDK or AI-powered transpilation. Returns a task ID; use the '/transpile/{taskId}' endpoint to get the result.

Query Parameters

Name, TypeDescription
backend
string

The name of the backend to transpile the circuit to. Refer to https://docs.quantum.ibm.com/run/get-backend-information. If not specified, you must specify `backend_coupling_map` in the request body.

Example: "ibm_kyoto"
optimization_level
integer

How much to optimize the circuit. Refer to https://docs.quantum.ibm.com/transpile/set-optimization

Default value: 3
use_ai
boolean

DEPRECATED: Use 'ai' parameter instead

ai
string

Whether to use Qiskit SDK transpile, the AI-powered features, or let the service to apply automatically the best procedure possible

Possible values: truefalseauto
Default value: auto
ai_layout_mode
string

Possible values: keepoptimizeimprove
Default value: optimize

Body Parameters (application/json)

Name, TypeDescription
qasm_circuits
Required
string[] | string

The OpenQASM circuit(s) to transpile. Both OpenQASM 2 and OpenQASM 3 are supported.

Example: ["OPENQASM 3; include \"stdgates.inc\"; bit[2] meas; qubit[2] q; h q[0]; cx q[0], q[1]; barrier q[0], q[1]; meas[0] = measure q[0]; meas[1] = measure q[1];","OPENQASM 2.0;\ninclude \"qelib1.inc\";\ngate dcx q0,q1 { cx q0,q1; cx q1,q0; }\nqreg q[3];\ncz q[0],q[2];\nsdg q[1];\ndcx q[2],q[1];\nu3(3.890139082217223,3.447697582994976,1.1583481971959322) q[0];\ncrx(2.3585459177723522) q[1],q[0];\ny q[2];"]
qiskit_transpile_options
object | null

Dictionary with inputs to configure the transpile endpoint. Accepts the same inputs as Qiskit transpile() method https://docs.quantum.ibm.com/api/qiskit/compiler#transpile, except for 'circuits' and 'backend'

Example: {"basis_gates":["u1","u2","u3","cx"],"seed_transpiler":0}
backend_coupling_map
integer[][] | null

A list of pairs that represents physical links between qubits.Must be specified if the query parameter `backend` is not set.

Example: [[1,2],[2,1]]

HTTP Response Status Codes

Status codeDescription
200Successful Response
422Validation Error

Code samples

POST
/transpile
curl -X POST \
  https://cloud-transpiler.quantum.ibm.com/transpile \
  -H 'Authorization: Bearer YOUR-TOKEN' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{"qasm_circuits":["OPENQASM 3; include \"stdgates.inc\"; bit[2] meas; qubit[2] q; h q[0]; cx q[0], q[1]; barrier q[0], q[1]; meas[0] = measure q[0]; meas[1] = measure q[1];","OPENQASM 2.0;\ninclude \"qelib1.inc\";\ngate dcx q0,q1 { cx q0,q1; cx q1,q0; }\nqreg q[3];\ncz q[0],q[2];\nsdg q[1];\ndcx q[2],q[1];\nu3(3.890139082217223,3.447697582994976,1.1583481971959322) q[0];\ncrx(2.3585459177723522) q[1],q[0];\ny q[2];"]}'

Responses

{
  "task_id": "example"
}

Get transpilation result

Path Parameters

Name, TypeDescription
task_id
Required
string

The ID of the transpilation task. This ID is returned by the '/transpile' POST endpoint.

HTTP Response Status Codes

Status codeDescription
200Successful Response
422Validation Error

Code samples

GET
/transpile/{task_id}
curl -X GET \
  https://cloud-transpiler.quantum.ibm.com/transpile/{task_id} \
  -H 'Authorization: Bearer YOUR-TOKEN' \
  -H 'Accept: application/json'

Responses

{
  "state": "example",
  "result": null
}
Was this page helpful?
Report a bug or request content on GitHub.