File Exchange

image thumbnail

Quantum random number generator

version 2.5.1 (3.41 KB) by gorka zubia
This code returns a "n" amount of random numbers, which are obtained in real time from the ANU Quantum Random Numbers Server.

6 Downloads

Updated 26 Apr 2020

From GitHub

View Version History

View license on GitHub

-----------------------------------------------------------------------------------------------------------------------------
Introduction
-----------------------------------------------------------------------------------------------------------------------------
The aim of this function is to provide real random numbers for sensitive applications, which cannot accept the pseudorandomness of Matlab's "randperm(N, K)"
-----------------------------------------------------------------------------------------------------------------------------

-----------------------------------------------------------------------------------------------------------------------------
Description
-----------------------------------------------------------------------------------------------------------------------------
This function returns a row vector with "n" REAL RANDOM NUMBERS with values between [1-"n"] and NO REPETITION.
These random numbers are generated in real time (Internet connection is needed) from the Australian National University's Quantum Random Numbers Server.
The returned numbers can be "uint8" (0 to 255) or "uint16" (0 to 65,535) type of integers
-----------------------------------------------------------------------------------------------------------------------------

-----------------------------------------------------------------------------------------------------------------------------
Elapsed time
-----------------------------------------------------------------------------------------------------------------------------
The function needs a random time to retrieve the asked array of numbers. As an illustration, using a computer with 6 cores, these are the obtained results for different scenarios:
########## Executed command ########## || ########## Elapsed time (s) ##########
>> quantumRandomGenerator( 1, 'uint8') 0.73
>> quantumRandomGenerator( 50, 'uint8') 0.73
>> quantumRandomGenerator( 100, 'uint8') 0.73
>> quantumRandomGenerator( 150, 'uint8') 0.73
>> quantumRandomGenerator( 200, 'uint8') 0.73
>> quantumRandomGenerator( 200, 'uint16') 35.95
>> quantumRandomGenerator( 852, 'uint16') 57.03
>> quantumRandomGenerator(4216, 'uint16') 53.22
-----------------------------------------------------------------------------------------------------------------------------

Cite As

gorka zubia (2021). Quantum random number generator (https://github.com/gzubia/quantum-random-number-generator/releases/tag/2.5.1), GitHub. Retrieved .

Comments and Ratings (2)

Foss Guru

Chris Nelson

MATLAB Release Compatibility
Created with R2019b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!