Selecting the backend
Starting version 0.11.0, Quantum Rings SDK supports the following backends:
# |
CPU Only mode |
GPU Supported |
CUDA-Q Platform |
|---|---|---|---|
Installation Procedure |
|||
Backends Supported |
scarlet_quantum_rings |
scarlet_quantum_rings
amber_quantum_rings
serin_quantum_rings
|
scarlet_quantum_rings
amber_quantum_rings
serin_quantum_rings
|
If you are using the core SDK
You can select the backend by passing its name to the get_backend method.
import QuantumRingsLib
from QuantumRingsLib import QuantumRingsProvider
# Acquire the Quantum Rings Provider and your preferred backend
provider = QuantumRingsProvider(token =<YOUR_TOKEN_HERE>, name=<YOUR_ACCOUNT_NAME_HERE>)
backend = provider.get_backend("scarlet_quantum_rings")
Alternatively, if you store it in the local configuration file as described in the section Saving the Quantum Rings account locally, you can skip the argument to the get_backend method.
import QuantumRingsLib
from QuantumRingsLib import QuantumRingsProvider
# Acquire the Quantum Rings Provider and your preferred backend
provider = QuantumRingsProvider(token =<YOUR_TOKEN_HERE>, name=<YOUR_ACCOUNT_NAME_HERE>)
# backend name is loaded from the configuration file.
backend = provider.get_backend()
If you are a using the toolkit for Qiskit
OPTION 1. Using QrRuntimeService
from quantumrings.toolkit.qiskit import QrRuntimeService
# Acquire the Quantum Rings runtime service
service = QrRuntimeService( token = <YOUR_TOKEN_HERE>, name = <YOUR_ACCOUNT_NAME_HERE> )
# Select the backend and set the precision
backend = service.backend(name = "amber_quantum_rings", precision = "double", gpu = 0, num_qubits = 12)
OPTION 2. Using QrBackendV2
from quantumrings.toolkit.qiskit import QrBackendV2
# Select the backend and set the precision
backend = QrBackendV2(
token = <YOUR_TOKEN_HERE>,
name = <YOUR_ACCOUNT_NAME_HERE>,
backend = "amber_quantum_rings",
precision = "double",
gpu = 0,
num_qubits = 12
)
OPTION 3. While using the Sampler or Estimator classes
This is explained in section Additional Parameters in Sampler and Estimator Classes.
Which backend to use?
It actually depends upon the circuit complexity. If you are using fewer qubits and fewer gate operations, the CPU only mode works best.
You could be using scarlet_quantum_rings backend. For complex circuits involving qubits > 30, and several circuit layers, you can
select amber_quantum_rings. If you have a low end GPU, such as the laptop GPUs, you can select serin_quantum_rings, which works
in a hybrid mode, offloading large calculations to the GPU.