Skip to main content

A Quantum Development Library

Project description

Minimum System Requirements

A system with a configuration better than the minimum requirements is advised. Lower configurations may affect the number of qubits that can be supported and may perform poorly.

  • Operating systems supported:

    • Windows 11 Pro

    • Debian GNU/Linux 12 (bookworm)

    • OpenSUSE Tumbleweed - Version 20240415

    • Oracle Linux 9.3

    • Ubuntu 22.04.4 LTS

    • macOS Sequoia

  • 64-bit Intel i9 x86 CPU (14 cores 20 logical processors recommended) on Windows or Linux platforms

  • x86_64 or ARM_64 (that is, Intel or Apple Silicon CPUs) on Apple PCs

  • 32 GB Installed physical memory

  • 18 GB Available physical memory

  • 64-bit Python version 3.11 on Windows

  • Python 3.6, 3.10, 3.11, and 3.12 on various Linux versions

  • Python 3.12 on macOS

Installation - Windows 11

The Quantum Rings SDK can be installed directly using pip. Many users find Anaconda (https://www.anaconda.com/) a good way to install the Quantum Rings SDK and use the Python environment efficiently. From Anaconda, select a Python 3.11 channel and launch CMD.exe Prompt to go to the command prompt and execute the following command.

pip install QuantumRingsLib

If you do not have a Python 3.11 channel, select Environments from the left panel, + Create button from the menu bar at the bottom and select Python 3.11 from the Create New Environment dialog.

Quantum Rings SDK requires a 64-bit version of Python 3.11.

After installation of the SDK, launch Python 3.11 environment by selecting the installed channel, before running your code.

Installation - macOS Sequoia

Install Python 3.12 by downloading it from the Python Organization (https://www.python.org/downloads/macos/). From the terminal, create a Python 3.12 virtual environment by executing the following command. Activate the environment.

python3.12 -m venv myenv
source myenv/bin/activate

Then execute the following command to install the SDK.

pip install QuantumRingsLib

You may also refer to https://docs.python.org/3/using/mac.html for further help. If you have a Python version that came with a previous version of macOS and if you uninstalled it, you may have broken symlinks. Refer to section 5.5.1 on this webpage for hints, how to fix the symlinks.

Installation - Linux

Checking whether your Linux platform is supported

There are several variants of the Linux OS, with varying levels of inbuilt libraries. At present, we are supporting manylinux_2_34_x86_64 platforms based on 64 bit x86 processors. Older platforms and other CPUs are not supported at the moment. If you have a specific requirement, please contact our technical support.

To check whether your platform is supported, execute the following command from Python command line:

import platform
platform.platform()

Watch for the glibc signature at the end. glibc2.34 and above are only supported.

Installing Python 3.11 and creating the virtual environment

Update all packages in your system using the following commands. Note that, this may cause incompatibilities in some installations due to variances in packages and their mutual dependencies. Besides, this step might break existing software packages and make your system unusable. You may refer to your operating system’s manual or seek help from your system adminstrator. Alternatively, you can also use the Software Updater GUI tool, if that was packaged along with your system distribution.

sudo apt update        # Fetches the list of available updates
sudo apt upgrade       # Installs some updates; does not remove packages

Note that apt command is not available in some Linux variants. You may have to use dnf on Oracle Linux distributions and zypper on Open SUSE distributions.

Check whether your system has Python 3.11 installed by executing python from the terminal. If not, you can install Python 3.11 using the following command.

sudo apt install python3.11

Create a virtual Python 3.11 environment and activate the environment using the following steps.

virtualenv --python=/usr/bin/python3.11 myenv
source myenv/bin/activate

You may have to install virtualenv package if it is not already installed. When not required, you can deactivate the environment using deactivate command.

Note that, virtualenv package is not available on Oracle Linux and Open SUSE Linux. You can use the following command equivalently on these distributions:

python3.11 -m venv myenv
source myenv/bin/activate

Installing Jupyter notebook

Now, launch the virtual environment, and execute the following command:

sudo su
source myenv/bin/activate
pip install notebook

Ensuring that jupyter notebook launches the correct python version

Check whether your virtual environment launches the correct python version (3.11) my executing the command python –version. On some installations you may have to execute the following commands to ensure that the Jupyter notebook launches the correct python version.

python -m pip install ipykernel
python -m ipykernel install --user

Now, you can launch the Jupyter notebook using the command jupyter-notebook or jupyter notebook. If you are logged in as root, then you may have to append –allow-root. Once the notebook server starts, you can click the local-host link to launch the notebook on the browser.

Installing Curl

On some installations, we found that curl was not installed. You can check whether curl is installed on your system by executing the command curl from the terminal. If curl is not installed, you may use the following command:

sudo apt install curl

Installing gcc

On some installations, we got libgomp.so not found error and it required installation of gcc, as follows:

zypper install gcc

Finally, installing the QuantumRingsLibrary

Now, you can install the QuantumRingsLibrary as follows:

pip install QuantumRingsLib

Usage

Obtain your account name and token from the Quantum Rings team. You can then use them to create the backend for execution. You can follow the reference code below for further information:

import QuantumRingsLib
from QuantumRingsLib import QuantumRegister, AncillaRegister, ClassicalRegister, QuantumCircuit
from QuantumRingsLib import QuantumRingsProvider
from QuantumRingsLib import job_monitor
from QuantumRingsLib import JobStatus
from matplotlib import pyplot as plt
import numpy as np

provider = QuantumRingsProvider(token =<YOUR_TOKEN_HERE>, name=<YOUR_ACCOUNT_NAME_HERE>)
backend = provider.get_backend("scarlet_quantum_rings")
shots = 100

provider.active_account()

Executing the Code

You can execute the code in the backend as illustrated below and setup a job monitor to watch for completion. The code is executed in a background thread so you can use your system normally.

Using job_monitor function

job = backend.run(qc, shots)
job_monitor(job)
result = job.result()
counts = result.get_counts()
print (counts)

Using wait_for_final_state function

def jobCallback(job_id, state, job):
    #print("Job Status: ", state)
    pass

# Execute the circuit
job = backend.run(qc, shots)
job.wait_for_final_state(0, 5, jobCallback)
counts = job.result().get_counts()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

QuantumRingsLib-0.9.11-cp311-cp311-win_amd64.whl (1.4 MB view details)

Uploaded CPython 3.11Windows x86-64

QuantumRingsLib-0.9.11-cp311-cp311-manylinux_2_34_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.34+ x86-64

QuantumRingsLib-0.9.11-cp311-cp311-manylinux_2_27_x86_64.whl (1.9 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.27+ x86-64

File details

Details for the file QuantumRingsLib-0.9.11-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for QuantumRingsLib-0.9.11-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 68445d8e332e7464b687a05e842adf5417e4be23e712aebf92a85a582ccefe54
MD5 3607542ab6dc649825b8197e2c41c07d
BLAKE2b-256 c5fffc2c1113b63f67648b0ac7e02b69f96581d1cc8f99ccc999450386e66834

See more details on using hashes here.

File details

Details for the file QuantumRingsLib-0.9.11-cp311-cp311-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for QuantumRingsLib-0.9.11-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 5951b78c06fbb86b3b7018293b8ccf2b5d520ebc26e3aab30eccbebe5c9a727f
MD5 2f6260fa972fd8650c193ace112bf5dd
BLAKE2b-256 e4f5d6395f4a66a746f21fe10eb5cfaed04d9113031cbe5b4f322d3594996c7f

See more details on using hashes here.

File details

Details for the file QuantumRingsLib-0.9.11-cp311-cp311-manylinux_2_27_x86_64.whl.

File metadata

File hashes

Hashes for QuantumRingsLib-0.9.11-cp311-cp311-manylinux_2_27_x86_64.whl
Algorithm Hash digest
SHA256 d4174a4fbb531f472b93f4f4252f25eca0f0fb15f8e3dea73f5c9556d6613de2
MD5 ef84e262e441f84ecc326d3b9e7de44f
BLAKE2b-256 7f7e850a0206d3e652fafc7958909d42d347fcdd144c2b3a0d3e0a2212722959

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page