curl --request POST \
--url 'https://api.example.com/circuits/lr_qaoa?HAIQU_API_KEY=' \
--header 'Content-Type: application/json' \
--data '
{
"experiment_id": "<string>",
"p": 2,
"name": "<string>",
"lp_problem": "<string>",
"polynomial_problem": {},
"initial_state_qpy": "<string>",
"alphas": [
123
],
"betas": [
123
],
"delta": 0.5
}
'import requests
url = "https://api.example.com/circuits/lr_qaoa?HAIQU_API_KEY="
payload = {
"experiment_id": "<string>",
"p": 2,
"name": "<string>",
"lp_problem": "<string>",
"polynomial_problem": {},
"initial_state_qpy": "<string>",
"alphas": [123],
"betas": [123],
"delta": 0.5
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
experiment_id: '<string>',
p: 2,
name: '<string>',
lp_problem: '<string>',
polynomial_problem: {},
initial_state_qpy: '<string>',
alphas: [123],
betas: [123],
delta: 0.5
})
};
fetch('https://api.example.com/circuits/lr_qaoa?HAIQU_API_KEY=', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/circuits/lr_qaoa?HAIQU_API_KEY=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'experiment_id' => '<string>',
'p' => 2,
'name' => '<string>',
'lp_problem' => '<string>',
'polynomial_problem' => [
],
'initial_state_qpy' => '<string>',
'alphas' => [
123
],
'betas' => [
123
],
'delta' => 0.5
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/circuits/lr_qaoa?HAIQU_API_KEY="
payload := strings.NewReader("{\n \"experiment_id\": \"<string>\",\n \"p\": 2,\n \"name\": \"<string>\",\n \"lp_problem\": \"<string>\",\n \"polynomial_problem\": {},\n \"initial_state_qpy\": \"<string>\",\n \"alphas\": [\n 123\n ],\n \"betas\": [\n 123\n ],\n \"delta\": 0.5\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/circuits/lr_qaoa?HAIQU_API_KEY=")
.header("Content-Type", "application/json")
.body("{\n \"experiment_id\": \"<string>\",\n \"p\": 2,\n \"name\": \"<string>\",\n \"lp_problem\": \"<string>\",\n \"polynomial_problem\": {},\n \"initial_state_qpy\": \"<string>\",\n \"alphas\": [\n 123\n ],\n \"betas\": [\n 123\n ],\n \"delta\": 0.5\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/circuits/lr_qaoa?HAIQU_API_KEY=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"experiment_id\": \"<string>\",\n \"p\": 2,\n \"name\": \"<string>\",\n \"lp_problem\": \"<string>\",\n \"polynomial_problem\": {},\n \"initial_state_qpy\": \"<string>\",\n \"alphas\": [\n 123\n ],\n \"betas\": [\n 123\n ],\n \"delta\": 0.5\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"hash": "<string>",
"name": "<string>",
"creation_date": "2023-11-07T05:31:56Z",
"user_id": 123,
"experiment_id": "<string>",
"status": "Submitted",
"generated": true,
"description": "",
"tags": "",
"parameters": {},
"analytics": {
"qubits": 2,
"depth": 123,
"depth_2q": 123,
"gates_1q": 123,
"gates_2q": 123,
"gates_total": 123,
"other_ops": 123,
"num_qubits_active": 123,
"num_parameters": 123,
"other_gates": 123,
"instructions_total": 123,
"operations_counts": {},
"gate_size_distribution": {},
"gate_diversity": {},
"gate_diversity_basis_gates": {},
"gate_count_distribution": {},
"program_communication": "N/A",
"critical_depth": "N/A",
"entanglement_ratio": "N/A",
"parallelism": "N/A",
"liveness_per_qubit": "N/A",
"liveness": "N/A",
"correlation_matrix": {},
"kl_divergence": "N/A",
"entanglement_capability": "N/A",
"expressibility": "N/A",
"quantum_fisher_information_matrix": "N/A",
"circuit_normalized": "<string>"
},
"transpilation_target": "<string>",
"transpilation_options": {},
"transpiled_circuit_ids": [
"<string>"
],
"compressed_circuit_ids": [
"<string>"
],
"job_ids": [
"<string>"
],
"qpy": "<string>",
"evolution": {
"metrics": [
"<unknown>"
],
"kl_divergence": [
"<unknown>"
],
"reality_check": [
"<unknown>"
]
},
"metrics": {}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Build Lr Qaoa Circuit
Build an LR-QAOA circuit for an unconstrained binary polynomial (synchronous).
Generates the LR-QAOA circuit immediately and returns it.
Args: user (User): User authenticated with api key. data (LRQAOACircuitSubmitModel): Circuit generation parameters. db (Session): The database session.
Returns: CircuitModel: The generated circuit.
curl --request POST \
--url 'https://api.example.com/circuits/lr_qaoa?HAIQU_API_KEY=' \
--header 'Content-Type: application/json' \
--data '
{
"experiment_id": "<string>",
"p": 2,
"name": "<string>",
"lp_problem": "<string>",
"polynomial_problem": {},
"initial_state_qpy": "<string>",
"alphas": [
123
],
"betas": [
123
],
"delta": 0.5
}
'import requests
url = "https://api.example.com/circuits/lr_qaoa?HAIQU_API_KEY="
payload = {
"experiment_id": "<string>",
"p": 2,
"name": "<string>",
"lp_problem": "<string>",
"polynomial_problem": {},
"initial_state_qpy": "<string>",
"alphas": [123],
"betas": [123],
"delta": 0.5
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
experiment_id: '<string>',
p: 2,
name: '<string>',
lp_problem: '<string>',
polynomial_problem: {},
initial_state_qpy: '<string>',
alphas: [123],
betas: [123],
delta: 0.5
})
};
fetch('https://api.example.com/circuits/lr_qaoa?HAIQU_API_KEY=', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/circuits/lr_qaoa?HAIQU_API_KEY=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'experiment_id' => '<string>',
'p' => 2,
'name' => '<string>',
'lp_problem' => '<string>',
'polynomial_problem' => [
],
'initial_state_qpy' => '<string>',
'alphas' => [
123
],
'betas' => [
123
],
'delta' => 0.5
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/circuits/lr_qaoa?HAIQU_API_KEY="
payload := strings.NewReader("{\n \"experiment_id\": \"<string>\",\n \"p\": 2,\n \"name\": \"<string>\",\n \"lp_problem\": \"<string>\",\n \"polynomial_problem\": {},\n \"initial_state_qpy\": \"<string>\",\n \"alphas\": [\n 123\n ],\n \"betas\": [\n 123\n ],\n \"delta\": 0.5\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/circuits/lr_qaoa?HAIQU_API_KEY=")
.header("Content-Type", "application/json")
.body("{\n \"experiment_id\": \"<string>\",\n \"p\": 2,\n \"name\": \"<string>\",\n \"lp_problem\": \"<string>\",\n \"polynomial_problem\": {},\n \"initial_state_qpy\": \"<string>\",\n \"alphas\": [\n 123\n ],\n \"betas\": [\n 123\n ],\n \"delta\": 0.5\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/circuits/lr_qaoa?HAIQU_API_KEY=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"experiment_id\": \"<string>\",\n \"p\": 2,\n \"name\": \"<string>\",\n \"lp_problem\": \"<string>\",\n \"polynomial_problem\": {},\n \"initial_state_qpy\": \"<string>\",\n \"alphas\": [\n 123\n ],\n \"betas\": [\n 123\n ],\n \"delta\": 0.5\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"hash": "<string>",
"name": "<string>",
"creation_date": "2023-11-07T05:31:56Z",
"user_id": 123,
"experiment_id": "<string>",
"status": "Submitted",
"generated": true,
"description": "",
"tags": "",
"parameters": {},
"analytics": {
"qubits": 2,
"depth": 123,
"depth_2q": 123,
"gates_1q": 123,
"gates_2q": 123,
"gates_total": 123,
"other_ops": 123,
"num_qubits_active": 123,
"num_parameters": 123,
"other_gates": 123,
"instructions_total": 123,
"operations_counts": {},
"gate_size_distribution": {},
"gate_diversity": {},
"gate_diversity_basis_gates": {},
"gate_count_distribution": {},
"program_communication": "N/A",
"critical_depth": "N/A",
"entanglement_ratio": "N/A",
"parallelism": "N/A",
"liveness_per_qubit": "N/A",
"liveness": "N/A",
"correlation_matrix": {},
"kl_divergence": "N/A",
"entanglement_capability": "N/A",
"expressibility": "N/A",
"quantum_fisher_information_matrix": "N/A",
"circuit_normalized": "<string>"
},
"transpilation_target": "<string>",
"transpilation_options": {},
"transpiled_circuit_ids": [
"<string>"
],
"compressed_circuit_ids": [
"<string>"
],
"job_ids": [
"<string>"
],
"qpy": "<string>",
"evolution": {
"metrics": [
"<unknown>"
],
"kl_divergence": [
"<unknown>"
],
"reality_check": [
"<unknown>"
]
},
"metrics": {}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Body
Submit model for LR-QAOA circuit generation.
Number of QAOA layers (must be >= 1)
x >= 1200Deprecated QUBO serialized as LP file content
1OptimizationProblem serialized as polynomial JSON
Cost operator parameters (length must match p)
Mixer operator parameters (length must match p)
Ramp parameter (typical values are between 0 and 1)
Response
Successful Response
Haiqu Circuit model for Analytics Workflows.
Haiqu circuit is a quantum circuit logged in the Haiqu cloud or generated by Haiqu tools
and enriched with analytics data. It wraps Qiskit QuantumCircuit (qpy property, in the form of QPY dump)
and provides additional methods for analytics and visualization.
Cloud-computed structure metrics live on analytics (for example analytics.depth,
analytics.depth_2q, analytics.gates_2q); use :meth:core_metrics or :meth:wait_for_analytics
if they are not yet populated.
Class for circuit analytics calculation job status.
Submitted, Running analytics computation, Core metrics computation is done, Advanced metrics computation is done, Parameterized QML metrics computation is done, Evolution computation is done, Done, Error Data model for circuit metrics.
Show child attributes
Show child attributes
Data model for circuit evolution.
Show child attributes
Show child attributes