OQTOPUS Cloud

Uses cloud quantum computers and simulators available via OQTOPUS Cloud for circuit evaluation.

Available as OqtopusClient.

Note

Only OQTOPUS Cloud instances reachable with quri-parts-oqtopus==1.0.3 are supported.

An OQTOPUS Cloud API token and endpoint URL are required.

Hint

OqtopusClient was added in Amplify Quantum v1.3. If you are using an older package version, run the following command to upgrade to the latest version.

$ pip install -U 'amplify[quantum]'
Solver specification:

Client class

amplify.OqtopusClient

Execution parameters

Depends on the algorithm

Execution result

Depends on the algorithm

Execution time

Depends on the algorithm

Quantum computer type

Gate-based

API method

REST API (OQTOPUS Cloud)

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:

In addition to the common client interface, it has the following attributes.

Attribute

Data type

Details

token

str | None

The OQTOPUS API token.

url

str | None

The endpoint URL of the OQTOPUS service.

proxy

str | None

The proxy server URL used when connecting.

provider

quri_parts_oqtopus.backend.OqtopusConfig | None

Use a quri_parts_oqtopus.backend.OqtopusConfig to set authentication information instead of the token / url / proxy attributes. The provider attribute takes precedence over the others.

device

str | None

The OQTOPUS device name on which the circuit will be executed. If None, a device is chosen automatically from those available that satisfy the circuit’s qubit count.

qiskit_pass_manager

qiskit.transpiler.PassManager | EllipsisType | None

The Qiskit qiskit.transpiler.PassManager used to transpile the circuit. With the default (...), one is generated automatically by generate_preset_pass_manager. Set this to None to skip transpilation.

name

str | None

The name attached to the job submitted to OQTOPUS.

description

str | None

The description attached to the job submitted to OQTOPUS.

transpiler_info

dict | None

Transpiler information forwarded to OQTOPUS.

simulator_info

dict | None

Simulator information forwarded to OQTOPUS.

mitigation_info

dict | None

Error mitigation settings forwarded to OQTOPUS.

job_type

str | None

The job type forwarded to OQTOPUS.

Backend-specific metadata:

Detailed sampling information is available via QAOA’s sampling_meta.

meta = client_result.history[0].sampling_meta
meta.circuit             # The executed Qiskit circuit object (before transpilation)
meta.transpiled_circuit  # The circuit after transpilation (None if not transpiled)
Configuration example:
from amplify import QAOA, OqtopusClient

# Create the client
client = OqtopusClient(QAOA)

# Set the endpoint URL and API token
client.url = "<URL>"
client.token = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

# Set QAOA parameters
client.parameters.reps = 1
client.parameters.shots = 100

A quri_parts_oqtopus.backend.OqtopusConfig can also be passed directly. In this case, authentication is performed using only the value of provider.

from quri_parts_oqtopus.backend import OqtopusConfig

client = OqtopusClient(QAOA)
client.provider = OqtopusConfig.from_file()
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 (quri-parts-oqtopus version):

>>> client.version()