Q-CTRL Optimization Solver API reference
Qiskit Functions — pre-built tools created by partner organizations — abstract away parts of the software development workflow to simplify and accelerate utility-scale algorithm discovery and application development. Click to view the guide for this Qiskit Function.
Optimization Solver Qiskit Function guide
Inputs
problem
Type: str or SparsePauliOp
Default value: None
One of the representations listed under "Accepted problem formats".
- Required: Yes
- Example:
Poly(2.0*n[0]*n[1] + 2.0*n[0]*n[2] - 3.13520241298341*n[0] + 2.0*n[1]*n[2] - 3.14469748506794*n[1] - 3.18897660121566*n[2] + 6.0, n[0], n[1], n[2], domain='RR')
problem_type
Type: str
Default value: None
Name of the problem class; only used for graph and spin chain problem definitions, which are limited to "maxcut" or "spin_chain"; not required for arbitrary objective function problem definitions.
- Required: No
- Example:
"maxcut"
backend_name
Type: str
Default value: Least busy backend
Name of the backend to use.
- Required: No
- Example:
"ibm_fez"
Options
Type: dict
Default value: None
Input options, including the following: (Optional) session_id: str; default behavior creates a new Session. Options are specified as a nested dictionary. See the full list of options and their default values.
- Required: No
- Example:
{"session_id": "cw2q70c79ws0008z6g4g"}
Options list
session_id
Type: str
Default value: None
An existing Qiskit Runtime session ID.
- Default:
None - Example:
"cw4r3je6f0t010870y3g"
job_tags
Type: list[str]
Default value: None
A list of job tags.
- Default:
None - Example:
["job_tag1", "job_tag2"]
Outputs
result
Type: dict[str, Any]
Solution and metadata listed under Result dictionary contents.
Example: {'solution_bitstring_cost': 3.0, final_bitstring_distribution: {000001: 100, 000011: 2}, iteration_count: 3, 'solution_bitstring': 000001, 'variables_to_bitstring_index_map': {n[1]': 5, 'n[2]': 4, 'n[3]': 3, 'n[4]': 2, 'n[5]': 1}, 'best_parameters': [0.19628831763697097, -1.047052334523102], 'warnings': []}
Result dictionary contents
solution_bitstring_cost
Type: float
The best minimum cost across all iterations.
final_bitstring_distribution
Type: CountsDict
The bitstring counts dictionary associated with the minimum cost.
solution_bitstring
Type: str
Bitstring with the best cost in the final distribution.
iteration_count
Type: int
The total number of QAOA iterations performed by the Solver.
variables_to_bitstring_index_map
Type: float
The mapping from the variables to the equivalent bit in the bitstring.
best_parameters
Type: list[float]
The optimized beta and gamma parameters across all iterations.
warnings
Type: list[str]
Default value: None
The warnings produced while compiling or running QAOA.