To retrieve a subset of solver fields, create a list of the subset of solver
fields by specifying the filter parameter via the following syntax:
filter={all|none}[,{+|-}field]... [,{+|-}field]
where:
allInitializes the list with all solver fields. This is the default.
noneInitializes the list with no solver fields.
{+|-}fieldAdds (
+) or removes (-) a solver field to or from the list. The fields are evaluated left to right; for example, if a field is both added and removed, the last action prevails. To specify the solver properties in a solver’spropertiesdict, use dot notation as follows:properties.property[.property]... [.property]
For example:
properties.problem_timing_data.typical_programming_time
If a field does not exist or a field does not contain a value, nothing is
returned for that field. The maximum size of the SAPI URL in the request is
8 KB; thus, the specified filter parameter must not extend the URL beyond
this maximum.
The serialized file may look like this:
b'DIMODBQM\x02\x00\xb2\x00\x00\x00{"dtype": "float64", "itype": "int32",
"ntype": "int32", "shape": [2, 1], "type": "BinaryQuadraticModel", "variables": true,
"vartype": "BINARY"}\n \x00\x00\x00\x00\x00\x00
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00
\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\xf0\xbf
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xf0\xbfVARS8\x00\x00
\x00["x", "y"]
Key |
Value |
|---|---|
answer |
Content of the answer depends on the solver and parameters used. |
id |
Unique identifier of the problem. Can be used to retrieve problem information, solutions, and messages. |
label |
Optional user-defined string (label) for a problem. |
status |
One of the problem states as defined in
SAPI Problem Lifecycle.
For example, |
submitted_on |
Time when problem was submitted. |
solved_on |
If this problem is in terminal state ( |
solver |
Unique identifier (name) of the solver. For resource representation
{"name": solver_name, "version": {"graph_id": graph_id}}
where the fields are as follows:
For resource representation |
type |
One of the supported values for the
|
Field |
Description |
|---|---|
avg_load |
Average current load for the solver. |
description |
Description of the solver. |
id |
Unique Identifier (name) of the solver, including its version. Only available in resource representation |
identity |
Represents the following JSON object. Only available for
resource representation {
"name": solver_name,
"version": {
"graph_id": graph_id
}
}
where the values are as follows:
|
properties |
Solver properties
that reside in the |
status |
Status of the solver; for example, a status of
|
The following table describes the answer field for a QPU solver.
Key |
Value |
|---|---|
format |
String: |
num_variables |
Total number of variables (active or otherwise) that the solver has. JSON integer. |
solutions |
Base-64–encoded string of bit-packed solutions (with
0 = -1 for Ising problems). Bits are in little-endian
order. Each solution is padded to end on a byte boundary
and contains values for active qubits only. Ordered by the
values of |
energies |
Base-64–encoded string of energies, each a little-endian 8-byte floating-point number (doubles). Ordered from low to high. |
active_variables |
Base-64–encoded string of the indices of the problem’s active variables. The indices are 4-byte little-endian integers. |
num_occurrences |
Base-64–encoded string of the number of occurrences of
each solution when answer_mode is
|
timing |
Solver-specific JSON object reporting the time that the solver took to handle the problem. |
For quantum-classical hybrid solvers, the answer field differs. For
example, format might be bq and fields might include the type of
variables (e.g., INTEGER), version, etc.
You can customize polling by adding the optional timeout parameter to
specify the blocking time, in seconds, for this request. Supported values are
integers between 1 to 30.