This is Constantine Quantum Technologies
's solution to ORCA Computing's challenge Random number generation using boson sampling
.
To install the package, run:
$ pip install cqt_rng
To start generating random numbers, you need to pick an entropy source and a post-processor. There are 3 simulated quantum entropy sources:
BosonSampler
UniversalQCSampler
ShiSFSampler
And 2 real quantum entropy sources:
BorealisSampler
IBMQSampler
We also implemented three postprocessors:
VonNeumannPP
CQTPP
NoPostProcess
Once you have chosen you entropy source and post-processor, you just need 2 lines of code (without counting the imports 😅) to generate random numbers:
from cqt_rng import RNG
from cqt_rng.post_processors import VonNeumannPP
from cqt_rng.entropy_sources import BosonSampler
rng = RNG(BosonSampler(), VonNeumannPP())
rng.generate(length = 1024)
You can also use your custom entropy sources by implementing them as subclasses of the abstract class EntropySource
, and also implement your own postprocessors as subclasses of the abstract class PostProcessor
.
For more example, please refer to the documentation.
An in-depth explanation of why we need RNG, the theory behind it, and what the package does can be found in the challenge/demo.ipynb
notebook (which you can launch directly on google colab by clicking the button below).