AI Pauli Network methods
Get available backends
Gets the list of backends the user can work with
Code samples
curl -X GET \
https://cloud-transpiler.quantum.ibm.com/pauli_network/backends \
-H 'Authorization: Bearer YOUR-TOKEN' \
-H 'Accept: application/json'
import requests
response = requests.request(
"GET",
"https://cloud-transpiler.quantum.ibm.com/pauli_network/backends",
headers={
"Accept": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN_HERE"
},
)
print(response.json())
Responses
[
"example"
]
{
"type": "array",
"items": {
"type": "string"
},
"title": "Response Backends Pauli Network Backends Get"
}
Synthesize Pauli Network
Returns a task ID; use the '/pauli_network/synthesize/{taskId}' endpoint to get the result.
Query Parameters
Name, Type | Description |
---|---|
model string | |
backend string | The name of the backend. Refer to https://docs.quantum.ibm.com/run/get-backend-information. Example: "ibm_kyoto" |
topology string | |
qubits integer | |
check_result boolean | If true, the reinforcement learning (RL) model checks the result before returning a response. Default value: false |
n_steps integer | The number of attempts (steps) that the RL model should perform to find the best synthesized circuit. More steps could give a better result (not guaranteed) but it will take more time. |
Body Parameters (application/json)
Name, Type | Description |
---|---|
qasm string | null | The OpenQASM circuit to route. 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];" Example: "OPENQASM 3;\ninclude \"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];" |
qpy string | null | The QPY circuit to route. QPY circuits must be encoded in Base64. Example: "UUlTS0lUDAECBAAAAAAAAAABZXEAEWYACAAAAAIAAAACAAAAAAAAAAIAAAACAAAAAAAAAAUAAAAAY2lyY3VpdC0xNzgtNTAxNTcAAAAAAAAAAHt9cQEAAAACAAEBcQAAAAAAAAAAAAAAAAAAAAFjAQAAAAIABAFtZWFzAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAUAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAASEdhdGVxAAAAAAAGAAAAAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAABAAAAAUNYR2F0ZXEAAAAAcQAAAAEABwAAAAAAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABCYXJyaWVycQAAAABxAAAAAQAHAAAAAAAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAE1lYXN1cmVxAAAAAGMAAAAAAAcAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAATWVhc3VyZXEAAAABYwAAAAEAAAD///////////////8AAAAAAAAAAA==" |
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: [[0,1],[1,2],[2,3],[3,4]] |
HTTP Response Status Codes
Status code | Description |
---|---|
200 | Successful Response |
422 | Validation Error |
Code samples
curl -X POST \
https://cloud-transpiler.quantum.ibm.com/pauli_network/synthesize \
-H 'Authorization: Bearer YOUR-TOKEN' \
-H 'Accept: application/json'
import requests
response = requests.request(
"POST",
"https://cloud-transpiler.quantum.ibm.com/pauli_network/synthesize",
headers={
"Accept": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN_HERE"
},
)
print(response.json())
Responses
{
"task_id": "example"
}
{
"properties": {
"task_id": {
"type": "string",
"title": "Task Id"
}
},
"type": "object",
"required": [
"task_id"
],
"title": "TaskIdResponse"
}
Get synthesis result
Gets the result of a synthesis task. The Task ID needed for this endpoint is returned by the '/pauli_network/synthesize' POST endpoint.
Code samples
curl -X GET \
https://cloud-transpiler.quantum.ibm.com/pauli_network/synthesize/{task_id} \
-H 'Authorization: Bearer YOUR-TOKEN' \
-H 'Accept: application/json'
import requests
response = requests.request(
"GET",
"https://cloud-transpiler.quantum.ibm.com/pauli_network/synthesize/{task_id}",
headers={
"Accept": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN_HERE"
},
)
print(response.json())
Responses
{
"state": "example",
"result": null
}
{
"properties": {
"state": {
"type": "string",
"title": "State"
},
"result": {
"anyOf": [
{
"properties": {
"qasm": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Qasm"
},
"qpy": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Qpy"
},
"success": {
"type": "boolean",
"title": "Success"
},
"layout": {
"anyOf": [
{
"properties": {
"initial": {
"items": {
"type": "integer"
},
"type": "array",
"title": "Initial"
},
"final": {
"items": {
"type": "integer"
},
"type": "array",
"title": "Final"
}
},
"type": "object",
"required": [
"initial",
"final"
],
"title": "LayoutResult",
"description": "Enum for layout result"
},
{
"type": "null"
}
]
},
"error": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Error"
}
},
"type": "object",
"required": [
"success"
],
"title": "UnCompressedRlResult"
},
{
"items": {
"properties": {
"qasm": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Qasm"
},
"qpy": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Qpy"
},
"success": {
"type": "boolean",
"title": "Success"
},
"layout": {
"anyOf": [
{
"properties": {
"initial": {
"items": {
"type": "integer"
},
"type": "array",
"title": "Initial"
},
"final": {
"items": {
"type": "integer"
},
"type": "array",
"title": "Final"
}
},
"type": "object",
"required": [
"initial",
"final"
],
"title": "LayoutResult",
"description": "Enum for layout result"
},
{
"type": "null"
}
]
},
"error": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Error"
}
},
"type": "object",
"required": [
"success"
],
"title": "UnCompressedRlResult"
},
"type": "array"
},
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Result"
}
},
"type": "object",
"required": [
"state"
],
"title": "TaskResultResponse"
}
Get available topologies
Gets the list of available topologies for synthesis + transpiling the user can work with
Code samples
curl -X GET \
https://cloud-transpiler.quantum.ibm.com/pauli_network/topologies \
-H 'Authorization: Bearer YOUR-TOKEN' \
-H 'Accept: application/json'
import requests
response = requests.request(
"GET",
"https://cloud-transpiler.quantum.ibm.com/pauli_network/topologies",
headers={
"Accept": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN_HERE"
},
)
print(response.json())
Responses
[
"example"
]
{
"type": "array",
"items": {
"type": "string"
},
"title": "Response Topologies Pauli Network Topologies Get"
}
Transpile a Pauli Network
Returns a task ID; use the '/pauli_network/transpile/{taskId}' endpoint to get the result.
Body Parameters (application/json)
Name, Type | Description |
---|---|
qasm string[] | string | null | The OpenQASM circuit to route. 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];" Example: "OPENQASM 3;\ninclude \"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];" |
qpy string | null | The QPY circuit to route. QPY circuits must be encoded in Base64. Example: "UUlTS0lUDAECBAAAAAAAAAABZXEAEWYACAAAAAIAAAACAAAAAAAAAAIAAAACAAAAAAAAAAUAAAAAY2lyY3VpdC0xNzgtNTAxNTcAAAAAAAAAAHt9cQEAAAACAAEBcQAAAAAAAAAAAAAAAAAAAAFjAQAAAAIABAFtZWFzAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAUAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAASEdhdGVxAAAAAAAGAAAAAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAABAAAAAUNYR2F0ZXEAAAAAcQAAAAEABwAAAAAAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABCYXJyaWVycQAAAABxAAAAAQAHAAAAAAAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAE1lYXN1cmVxAAAAAGMAAAAAAAcAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAATWVhc3VyZXEAAAABYwAAAAEAAAD///////////////8AAAAAAAAAAA==" |
qargs Required integer[][] | integer[] | Example: [0,1,2,3,4] Example: [[0,1,2,3,4]] Example: [[0,1,2,3,4],[0,1,2,3,4]] |
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 code | Description |
---|---|
200 | Successful Response |
422 | Validation Error |
Code samples
curl -X POST \
https://cloud-transpiler.quantum.ibm.com/pauli_network/transpile \
-H 'Authorization: Bearer YOUR-TOKEN' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-d '{"qargs":[0,1,2,3,4]}'
import requests
response = requests.request(
"POST",
"https://cloud-transpiler.quantum.ibm.com/pauli_network/transpile",
headers={
"Accept": "application/json",
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN_HERE"
},
data="{\"qargs\":[0,1,2,3,4]}"
)
print(response.json())
Responses
{
"task_id": "example"
}
{
"properties": {
"task_id": {
"type": "string",
"title": "Task Id"
}
},
"type": "object",
"required": [
"task_id"
],
"title": "TaskIdResponse"
}
Get transpilation result
Gets the result of a transpilation task. The Task ID needed for this endpoint is returned by the '/pauli_network/transpile' POST endpoint.
Code samples
curl -X GET \
https://cloud-transpiler.quantum.ibm.com/pauli_network/transpile/{task_id} \
-H 'Authorization: Bearer YOUR-TOKEN' \
-H 'Accept: application/json'
import requests
response = requests.request(
"GET",
"https://cloud-transpiler.quantum.ibm.com/pauli_network/transpile/{task_id}",
headers={
"Accept": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN_HERE"
},
)
print(response.json())
Responses
{
"state": "example",
"result": null
}
{
"properties": {
"state": {
"type": "string",
"title": "State"
},
"result": {
"anyOf": [
{
"properties": {
"qasm": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Qasm"
},
"qpy": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Qpy"
},
"success": {
"type": "boolean",
"title": "Success"
},
"layout": {
"anyOf": [
{
"properties": {
"initial": {
"items": {
"type": "integer"
},
"type": "array",
"title": "Initial"
},
"final": {
"items": {
"type": "integer"
},
"type": "array",
"title": "Final"
}
},
"type": "object",
"required": [
"initial",
"final"
],
"title": "LayoutResult",
"description": "Enum for layout result"
},
{
"type": "null"
}
]
},
"error": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Error"
}
},
"type": "object",
"required": [
"success"
],
"title": "UnCompressedRlResult"
},
{
"items": {
"properties": {
"qasm": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Qasm"
},
"qpy": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Qpy"
},
"success": {
"type": "boolean",
"title": "Success"
},
"layout": {
"anyOf": [
{
"properties": {
"initial": {
"items": {
"type": "integer"
},
"type": "array",
"title": "Initial"
},
"final": {
"items": {
"type": "integer"
},
"type": "array",
"title": "Final"
}
},
"type": "object",
"required": [
"initial",
"final"
],
"title": "LayoutResult",
"description": "Enum for layout result"
},
{
"type": "null"
}
]
},
"error": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Error"
}
},
"type": "object",
"required": [
"success"
],
"title": "UnCompressedRlResult"
},
"type": "array"
},
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Result"
}
},
"type": "object",
"required": [
"state"
],
"title": "TaskResultResponse"
}