Skip to main content

Quantum random numbers

Project description

Quantum random numbers in Python

This package brings the ANU quantum random numbers to Python.

The default pseudo-random generator in Python is replaced by calls to the ANU API that serves real quantum random numbers.

pip install quantum-random

Just import qrandom and use it like you'd use the standard Python random module. For example,

>>> import qrandom

>>> qrandom.random()
0.15357449726583722

>>> qrandom.sample(range(10), 2)
[6, 4]

>>> qrandom.gauss(0.0, 1.0)
-0.8370871276247828

Supports Python 3.6+.

To run the tests locally, you will need poetry and Python 3.6-3.9.

poetry install
poetry shell
tox

This notebook shows the distribution in [0.0, 1.0) obtained by calling qrandom.random() 10,000 times and checks for uniformity using a Kolmogorov-Smirnov test.

Project details


Download files

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

Source Distribution

quantum-random-0.1.0.tar.gz (3.9 kB view hashes)

Uploaded Source

Built Distribution

quantum_random-0.1.0-py3-none-any.whl (3.8 kB view hashes)

Uploaded Python 3

Supported by

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