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
Depends on the algorithm
Depends on the algorithm
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
The OQTOPUS API token.
The endpoint URL of the OQTOPUS service.
The proxy server URL used when connecting.
quri_parts_oqtopus.backend.OqtopusConfig|NoneUse a
quri_parts_oqtopus.backend.OqtopusConfigto set authentication information instead of thetoken/url/proxyattributes. Theproviderattribute takes precedence over the others.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.The Qiskit
qiskit.transpiler.PassManagerused to transpile the circuit. With the default (...), one is generated automatically by generate_preset_pass_manager. Set this toNoneto skip transpilation.The name attached to the job submitted to OQTOPUS.
The description attached to the job submitted to OQTOPUS.
Transpiler information forwarded to OQTOPUS.
Simulator information forwarded to OQTOPUS.
Error mitigation settings forwarded to OQTOPUS.
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.OqtopusConfigcan also be passed directly. In this case, authentication is performed using only the value ofprovider.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()