About cookies on this site Our websites require some cookies to function properly (required). In addition, other cookies may be used with your consent to analyze site usage, improve the user experience and for advertising. For more information, please review your options. By visiting our website, you agree to our processing of information as described in IBM’sprivacy statement. To provide a smooth navigation, your cookie preferences will be shared across the IBM web domains listed here.
AI Clifford methods
Get available backends
Gets the list of backends the user can work with
Code samples
GET
/clifford/backendscurl -X GET \
https://cloud-transpiler.quantum.ibm.com/clifford/backends \
-H 'Authorization: Bearer YOUR-TOKEN' \
-H 'Accept: application/json'
import requests
response = requests.request(
"GET",
"https://cloud-transpiler.quantum.ibm.com/clifford/backends",
headers={
"Accept": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN_HERE"
},
)
print(response.json())
Responses
[
"example"
]
{
"type": "array",
"items": {
"type": "string"
},
"title": "Response Backends Clifford Backends Get"
}
Synthesize Clifford circuit
Returns a task ID; use the '/clifford/synthesize/{taskId}' endpoint to get the result.
Query Parameters
Name, Type | Description |
---|---|
backend string | The name of the backend. Refer to /guides/get-qpu-information. |
topology string | |
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. |
keep_layout boolean | Default value: true |
Body Parameters (application/json)
Name, Type | Description |
---|---|
clifford_dict Required | Dict that represents a Clifford operator Example: {"destabilizer":["+IIXXX","+IIXXI","+IXXXI","+IXIXI","+XIIII"],"stabilizer":["+IIIIZ","+IZIZZ","+IZZZI","+IIZZI","+ZIIII"]} |
coupling_map integer[][] | null | A list of pairs that represents physical links between qubits. Must be specified if the query parameter Example: [[0,1],[1,2],[2,3],[3,4]] |
HTTP Response Status Codes
Status code | Description |
---|---|
200 | Successful Response |
422 | Validation Error |
Code samples
POST
/clifford/synthesizecurl -X POST \
https://cloud-transpiler.quantum.ibm.com/clifford/synthesize \
-H 'Authorization: Bearer YOUR-TOKEN' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-d '{"clifford_dict":{"destabilizer":["+IIXXX","+IIXXI","+IXXXI","+IXIXI","+XIIII"],"stabilizer":["+IIIIZ","+IZIZZ","+IZZZI","+IIZZI","+ZIIII"]}}'
import requests
response = requests.request(
"POST",
"https://cloud-transpiler.quantum.ibm.com/clifford/synthesize",
headers={
"Accept": "application/json",
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN_HERE"
},
data="{\"clifford_dict\":{\"destabilizer\":[\"+IIXXX\",\"+IIXXI\",\"+IXXXI\",\"+IXIXI\",\"+XIIII\"],\"stabilizer\":[\"+IIIIZ\",\"+IZIZZ\",\"+IZZZI\",\"+IIZZI\",\"+ZIIII\"]}}"
)
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 a task synthesis result. The Task ID needed for this endpoint is returned by /clifford/synthesize
Code samples
GET
/clifford/synthesize/{task_id}curl -X GET \
https://cloud-transpiler.quantum.ibm.com/clifford/synthesize/{task_id} \
-H 'Authorization: Bearer YOUR-TOKEN' \
-H 'Accept: application/json'
import requests
response = requests.request(
"GET",
"https://cloud-transpiler.quantum.ibm.com/clifford/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
GET
/clifford/topologiescurl -X GET \
https://cloud-transpiler.quantum.ibm.com/clifford/topologies \
-H 'Authorization: Bearer YOUR-TOKEN' \
-H 'Accept: application/json'
import requests
response = requests.request(
"GET",
"https://cloud-transpiler.quantum.ibm.com/clifford/topologies",
headers={
"Accept": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN_HERE"
},
)
print(response.json())
Responses
[
"example"
]
{
"type": "array",
"items": {
"type": "string"
},
"title": "Response Topologies Clifford Topologies Get"
}
Transpile a Clifford circuit
Returns a task ID; use the '/clifford/transpile/{taskId}' endpoint to get the result.
Query Parameters
Name, Type | Description |
---|---|
backend string | The name of the backend. Refer to /guides/get-qpu-information. Example: "ibm_kyoto" |
Body Parameters (application/json)
Name, Type | Description |
---|---|
clifford_dict Required | Dict that represents a Clifford operator Example: {"destabilizer":["+IIXXX","+IIXXI","+IXXXI","+IXIXI","+XIIII"],"stabilizer":["+IIIIZ","+IZIZZ","+IZZZI","+IIZZI","+ZIIII"]} Example: [{"destabilizer":["+IIXXX","+IIXXI","+IXXXI","+IXIXI","+XIIII"],"stabilizer":["+IIIIZ","+IZIZZ","+IZZZI","+IIZZI","+ZIIII"]},{"destabilizer":["+IIXXX","+IIXXI","+IXXXI","+IXIXI","+XIIII"],"stabilizer":["+IIIIZ","+IZIZZ","+IZZZI","+IIZZI","+ZIIII"]}] |
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 Example: [[1,2],[2,1]] |
HTTP Response Status Codes
Status code | Description |
---|---|
200 | Successful Response |
422 | Validation Error |
Code samples
POST
/clifford/transpilecurl -X POST \
https://cloud-transpiler.quantum.ibm.com/clifford/transpile \
-H 'Authorization: Bearer YOUR-TOKEN' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-d '{"clifford_dict":{"destabilizer":["+IIXXX","+IIXXI","+IXXXI","+IXIXI","+XIIII"],"stabilizer":["+IIIIZ","+IZIZZ","+IZZZI","+IIZZI","+ZIIII"]},"qargs":[0,1,2,3,4]}'
import requests
response = requests.request(
"POST",
"https://cloud-transpiler.quantum.ibm.com/clifford/transpile",
headers={
"Accept": "application/json",
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN_HERE"
},
data="{\"clifford_dict\":{\"destabilizer\":[\"+IIXXX\",\"+IIXXI\",\"+IXXXI\",\"+IXIXI\",\"+XIIII\"],\"stabilizer\":[\"+IIIIZ\",\"+IZIZZ\",\"+IZZZI\",\"+IIZZI\",\"+ZIIII\"]},\"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 a task transpilation result. The Task ID needed for this endpoint is returned by /clifford/transpile
Code samples
GET
/clifford/transpile/{task_id}curl -X GET \
https://cloud-transpiler.quantum.ibm.com/clifford/transpile/{task_id} \
-H 'Authorization: Bearer YOUR-TOKEN' \
-H 'Accept: application/json'
import requests
response = requests.request(
"GET",
"https://cloud-transpiler.quantum.ibm.com/clifford/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"
}
Was this page helpful?
Report a bug or request content on GitHub.