IBM Quantum

Uses IBM Quantum QPUs for circuit evaluation.

Available as IBMClient.

Note

Requires an IBM Quantum API key, obtainable from your IBM Cloud Platform account.

Solver specification:

Client class

amplify.IBMClient

Execution parameters

Depends on the algorithm

Execution result

Depends on the algorithm

Execution time

Depends on the algorithm

Quantum computer type

Gate-based, superconducting qubits

API method

REST API (IBM Quantum)

The variable types and polynomial degree accepted for the input problem depend on the chosen algorithm.

  • When QAOA is specified as the client argument

    Binary

    Ising

    Integer

    Real

    Objective function

    -

    Nth degree*

    -

    -

    Equality constraint

    -

    **

    -

    -

    Inequality constraint

    -

    -

    -

    -

    *: Problems of arbitrary degree are supported. However, depending on the qubit connectivity of the quantum computer, the required number of qubits may increase.

    **: When Constrained QAOA is selected via QAOA type, N-HOT constraints are supported.

  • When RQAOA is specified as the client argument

    Binary

    Ising

    Integer

    Real

    Objective function

    -

    Nth degree*

    -

    -

    Equality constraint

    -

    -

    -

    -

    Inequality constraint

    -

    -

    -

    -

    *: Problems of arbitrary degree are supported. However, depending on the qubit connectivity of the quantum computer, the required number of qubits may increase.

Client class:

The client class has the following attributes and methods.

Attribute

Data type

Details

token

str | None

IBM Cloud API key. Used for authentication with QiskitRuntimeService.

url

str | None

The connection URL for QiskitRuntimeService.

device

str | None

The IBM Quantum device name for circuit execution. Default: the device selected automatically by least_busy().

channel

str | None

The QiskitRuntimeService channel. "ibm_quantum_platform", "ibm_cloud", "local", etc.

proxy

str | None

Proxy server for connecting to QiskitRuntimeService.

verify

bool | None

Whether to verify the server’s TLS certificate.

qiskit_pass_manager

qiskit.transpiler.PassManager | EllipsisType | None

The Qiskit qiskit.transpiler.PassManager used for circuit transpilation. The default (...) auto-generates one via generate_preset_pass_manager. None to skip transpilation.

Backend-specific metadata:

Detailed sampling information is available via QAOA’s sampling_meta. Uses QiskitJobMeta.

meta = client_result.history[0].sampling_meta
meta.job_id              # Job ID
meta.circuit             # The executed Qiskit circuit object
meta.transpiled_circuit  # The circuit after transpilation (None if not transpiled)
meta.metadata            # Raw metadata from the job result
meta.metrics             # Metrics data such as execution time from the job result
Configuration example:
from amplify import QAOA, IBMClient

# Create the client
client = IBMClient(QAOA)

# Set the API token
client.token = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

# Specify the execution device
client.device = "ibm_fez"

# Set QAOA parameters
client.parameters.reps = 1
client.parameters.shots = 100
Execution example:
from amplify import Model, VariableGenerator, solve

# Create decision variables and the objective function
g = VariableGenerator()
q = g.array("Binary", 2)
f = q[0] * q[1] + q[0] - q[1] + 1

# Create a model
model = Model(f)

# Run the solver
result = solve(model, client)

Obtain the backend version:

>>> client.version()