https://github.com/pedrorrivero/qrand

A multiprotocol and multiplatform quantum random number generation framework

https://github.com/pedrorrivero/qrand

Science Score: 33.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
  • .zenodo.json file
  • DOI references
    Found 3 DOI reference(s) in README
  • Academic publication links
    Links to: arxiv.org, nature.com, zenodo.org
  • Committers with academic emails
    1 of 3 committers (33.3%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (11.9%) to scientific vocabulary

Keywords

numpy qrng-protocols quantum-computing random-number-generator
Last synced: 6 months ago · JSON representation

Repository

A multiprotocol and multiplatform quantum random number generation framework

Basic Info
Statistics
  • Stars: 27
  • Watchers: 4
  • Forks: 14
  • Open Issues: 17
  • Releases: 0
Topics
numpy qrng-protocols quantum-computing random-number-generator
Created over 5 years ago · Last pushed about 4 years ago
Metadata Files
Readme Changelog Contributing License Code of conduct

README.md

Unitary Fund YouTube PyPI Coverage Apache-2.0 License DOI

qrand

A multiprotocol and multiplatform quantum random number generation framework

Random numbers are everywhere.

Computer algorithms, data encryption, physical simulations, and even the arts use them all the time. There is one problem though: it turns out that they are actually very difficult to produce in large amounts. Classical computers can only implement mathematical tricks to emulate randomness, while measuring it out of physical processes turns out to be too slow. Luckily, the probabilistic nature of quantum computers makes these devices particularly useful for the task.

QRAND is a free and open-source framework for quantum random number generation. Thanks to its loosely coupled design, it offers seamlessly compatibility between different quantum computing platforms and QRNG protocols. Not only that, but it also enables the creation of custom cross-compatible protocols, and a wide range of output formats (e.g. bitstring, int, float, complex, hex, base64).

To boost its efficiency, QRAND makes use of a concurrent cache to reduce the number of internet connections needed for random number generation; and for quality checks, it incorporates a suite of classical entropy validation tests which can be easily plugged into any base protocol.

Additionally, QRAND introduces an interface layer for NumPy that enables the efficient production of quantum random numbers (QRN) adhering to a wide variety of probability distributions. This is ultimately accomplished by transforming uniform probability distributions produced in cloud-based real quantum hardware, through NumPy's random module.

```python3 from qrand import QuantumBitGenerator from qrand.platforms import QiskitPlatform from qrand.protocols import HadamardProtocol from numpy.random import Generator from qiskit import IBMQ

provider = IBMQ.load_account() platform = QiskitPlatform(provider) protocol = HadamardProtocol() bitgen = QuantumBitGenerator(platform, protocol) gen = Generator(bitgen)

print(f"Random Raw: {bitgen.randomraw()}") print(f"Random Bitstring: {bitgen.randombitstring()}") print(f"Random Unsigned Int: {bitgen.randomuint()}") print(f"Random Double: {bitgen.randomdouble()}")

print(f"Random Binomial: {gen.binomial(4, 1/4)}") print(f"Random Exponential: {gen.exponential()}") print(f"Random Logistic: {gen.logistic()}") print(f"Random Poisson: {gen.poisson()}") print(f"Random Std. Normal: {gen.standard_normal()}") print(f"Random Triangular: {gen.triangular(-1, 0, 1)}")

...

```

Supported quantum platforms

As of June 2021, QRAND supports Qiskit and Q#. However, support for Cirq is under active development.

Implemented QRNG protocols

As of June 2021, both the basic HadamardProtocol, and the more sophisticated EntanglementProtocol are available. We are also working on implementing a version of Google's Sycamore routine (patent permitting).

Authors and citation

QRAND is the work of many people who contribute to the project at different levels. If you use QRAND, please cite as per the included BibTeX file.

Contribution guidelines

If you'd like to contribute to QRAND, please take a look at the contribution guidelines. This project adheres to the following code of conduct. By participating, you are expected to uphold this code.

We use GitHub issues for tracking requests and bugs. Please use Unitary Fund's Discord for discussion and simple questions.

Acknowledgements

Parts of this software's source code have been inspired or borrowed from the qRNG project, which is licensed under the GNU GPLv3 license. Copyright notice and specific changes can be found as a docstring wherever this applies.

License

Apache License 2.0


(c) Copyright 2021 Pedro Rivero

Owner

  • Name: Pedro Rivero
  • Login: pedrorrivero
  • Kind: user
  • Location: New York, USA / Madrid, Spain
  • Company: IBM Research

Quantum Developer | Error mitigation

GitHub Events

Total
  • Watch event: 4
Last Year
  • Watch event: 4

Committers

Last synced: almost 3 years ago

All Time
  • Total Commits: 278
  • Total Committers: 3
  • Avg Commits per committer: 92.667
  • Development Distribution Score (DDS): 0.097
Top Committers
Name Email Commits
Pedro Rivero p****z@g****m 251
Avhijit Nair a****0@v****n 21
vishnu v****h@g****m 6
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 8 months ago

All Time
  • Total issues: 22
  • Total pull requests: 10
  • Average time to close issues: 16 days
  • Average time to close pull requests: 1 day
  • Total issue authors: 6
  • Total pull request authors: 4
  • Average comments per issue: 2.77
  • Average comments per pull request: 0.8
  • Merged pull requests: 6
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • pedrorrivero (15)
  • LaurentAjdnik (2)
  • 1ucian0 (2)
  • Avhijit-codeboy (1)
  • praveentn (1)
  • gatorwatt (1)
Pull Request Authors
  • charmerDark (6)
  • Avhijit-codeboy (2)
  • harry-stark (1)
  • LaurentAjdnik (1)
Top Labels
Issue Labels
enhancement (12) DC-3 (9) bug (5) unitaryhack (5) DC-2 (4) DC-4 (3) documentation (3) DC-1 (2) help wanted (1) DC-5 (1) good first issue (1)
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 32 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 1
  • Total versions: 15
  • Total maintainers: 1
pypi.org: qrand

A multiprotocol and multiplatform quantum random number generation framework

  • Versions: 15
  • Dependent Packages: 0
  • Dependent Repositories: 1
  • Downloads: 32 Last month
Rankings
Forks count: 9.6%
Dependent packages count: 10.1%
Stargazers count: 13.0%
Average: 16.5%
Dependent repos count: 21.6%
Downloads: 28.3%
Maintainers (1)
Last synced: 6 months ago

Dependencies

poetry.lock pypi
  • 103 dependencies
pyproject.toml pypi
  • black ^20.8b1 develop
  • cirq ^0.10.0 develop
  • commitizen ^2.17.7 develop
  • data-science-types ^0.2.20 develop
  • isort ^5.6.4 develop
  • mypy ^0.790 develop
  • pre-commit ^2.7.1 develop
  • pytest ^6.1.1 develop
  • pytest-cov ^2.10.1 develop
  • qiskit-aer ^0.8.2 develop
  • qiskit-ibmq-provider 0.12.3 develop
  • qiskit-terra ^0.17.2 develop
  • qsharp ^0.15.2103 develop
  • cirq ^0.10.0
  • numpy ^1.19.4
  • python ^3.9
  • qiskit-aer ^0.8.2
  • qiskit-ibmq-provider 0.12.3
  • qiskit-terra ^0.17.2
  • qsharp ^0.15.2103
  • randomgen ^1.19.3