Skip to content

DoraFactory/QRNG-Generation-API

Repository files navigation

QRNG Generation API Documentation

This API allows users to submit custom QRNG jobs to IBM quantum computers and get the data back in JSON form (either the raw output or randomness-extracted, classically distributed QRNG output).

QRNG

Quantum random number (QRNG) systems utilize quantum computers to generate quantum random number output by taking advatage of the inherent properties of quantum mechanics. Given the deterministic nature of "PRNG" (psuedo/classical random number generators), the "true" random numbers generated by quantum computers have the potential to be incredibly useful for various end use-cases such as cryptographically secure encryption or random number input for decentralized voting systems. For more information on QRNG and its relevance in the modern technology landscape, check out this article.

This API uses a simple circuit of 100 qubits (IBM quantum computers are all 127+ qubits) measured in a state of quantum "superposition" - theoretically equal probability of 1 and 0 - to generate binary QRNG output strings. You can pass in variables to the job submission endpoint in order to adjust your desired output length and number of output lines.

General Documentation

A valid API key is required to access the API. As of now, the API does not support key generation for public users. For access request, contact Dora Factory.

The API is accesible through HTTP requests with base URL path https://qrng-generation-server.dorafactory.org/ (note that all endpoints require further routing specification). You can send calls to the API from your browser, command line thorugh cURL, programatically, etc.

API keys must be passed in as an HTTP header with header name = 'API-Key' to access the endpoints.

Route Specific Documentation

/QRNG/SubmitJob

Submit a QRNG job to an IBM quantum computer. Returns job ID upon succesful submission

Parameters:

length - (optional) size of QRNG binary output strings in bits. Must be a multiple of 100. Default = 100

number - (optional) number of requested binary string output lines. Default = 1

QPU - (optional) label of requested IBM quantum computer to submit job to. Default = least busy current IBM quantum computer

Example request URL with all parameters:

https://qrng-generation-server.dorafactory.org/QRNG/SubmitJob?length=200&number=2&QPU=ibm_brisbane

/QRNG/JobStatus

Check the status (e.g. queued, completed, cancelled, running, etc) of a submitted quantum job. If queued, estimated start time and queue position will be outputted.

Parameters:

jobID - (required) ID of IBM job which was returned when you made a succesful call to the job submission endpoint

Example request URL

https://qrng-generation-server.dorafactory.org/QRNG/JobStatus?jobID=your_job_id

/QRNG/JobResults

Returns raw QRNG output in JSON form upon succesful completion of quantum job. If job has not yet been completed, returns appropriate error message. Only call this endpoint after checking the JobStatus endpoint for completion.

Parameters:

jobID - (required) ID of IBM job which was returned when you made a succesful call to the job submission endpoint

Example request URL

https://qrng-generation-server.dorafactory.org/QRNG/JobResults?jobID=your_job_id

/QRNG/JobResultsUniformRandomness

Returns randomness-extracted, classically distributed QRNG output in JSON form upon succesful completion of quantum job. If job has not yet been completed, returns appropriate error message. Only call this endpoint after checking the JobStatus endpoint for completion. This endpoint utilizes toeplitz hashing extraction to generate output from raw QRNG measurement data.

Parameters:

jobID - (required) ID of IBM job which was returned when you made a succesful call to the job submission endpoint

Example request URL

https://qrng-generation-server.dorafactory.org/QRNG/JobResultsUniformRandomness?jobID=your_job_id

Problems? Contact Dora Factory

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published