Skip to main content
POST
Variational

Authorizations

HAIQU_API_KEY
string
query
required

Body

application/json

Submit model for variational problem execution.

experiment_id
string
required
circuit_id
string
required
observable
Observable · tuple
required
device_id
string
required
shots
integer
default:1000
options
Options · object | null
initial_parameters
number[] | null
optimizer_options
NFTOptimizerOptions · object

Configuration options for the NFT (Nakanishi-Fujii-Todo) optimizer.

The NFT algorithm is a gradient-free optimizer designed for variational quantum algorithms. For detailed information about the algorithm, see the paper: https://arxiv.org/abs/1903.12166

Preconditions: NFT requires the following conditions on the parameterized quantum circuit:

Scaling: NFT updates one parameter at a time. Each full sweep through N parameters requires ≥2N function evaluations (depending on reset_interval).

Args: randomized_order: If True, shuffles the order of parameters to update each lap (full sweep through all parameters). Default: False. reset_interval: How often to reset the recycled loss value. Set to 0 to disable resets. Default: 32. maxfev: Maximum number of function evaluations (circuit executions). Optimization stops when this limit is reached. Default: 200. maxiter: Maximum number of iterations (parameter updates). Default: 100. eps: Small epsilon value to avoid division by zero in the analytic solution. Default: 1e-32.

Notes: Stopping criterion: Optimization stops when either maxfev or maxiter is reached, whichever comes first.

Example: >>> from haiqu.sdk.qml import NFTOptimizerOptions >>> optimizer = NFTOptimizerOptions(maxfev=500, maxiter=200)

use_mitigation
boolean
default:false
use_compression
boolean
default:false
compression_options
Compression Options · object | null
name
string | null
default:""
description
string | null
default:""

Response

Successful Response

Job returned for variational problem execution.

id
string
required
user_id
integer
required
experiment_id
string
required
status
enum<string>
required

Class for job status.

Available options:
Submitted,
Initializing,
Queued,
Validating,
Running,
Cancelled,
Done,
Error
job_type
enum<string>
required

Class for job types.

Available options:
User local job,
Analytics,
Device specific analytics,
Data Loading,
Hybrid,
Run,
State Compression,
Transpilation,
Variational,
Pretraining,
SKQD
device_id
string
required
creation_date
string<date-time>
required
circuit_id
string
required
observable
Observable · tuple
required
shots
integer
required
name
string | null
description
string | null
run_date
string<date-time> | null
finish_date
string<date-time> | null
logs
string | null
quality
number | null
info
Info · object | null
time
number | null
parameters
options
Options · object | null
optimizer_options
Optimizer Options · object | null
use_mitigation
boolean
default:false
optimal_parameters
number[] | null
min_loss
number | null
loss_history
number[] | null
weights_history
number[][] | null
compression_stats
Compression Stats · object | null