Quantum random number generator

版本 2.5.1 (3.5 KB) 作者: Gorka Zubia Garea
This code returns a "n" amount of random numbers, which are obtained in real time from the ANU Quantum Random Numbers Server.
208.0 次下载
更新时间 2020/4/26

-----------------------------------------------------------------------------------------------------------------------------
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
-----------------------------------------------------------------------------------------------------------------------------

引用格式

Gorka Zubia Garea (2024). Quantum random number generator (https://github.com/gzubia/quantum-random-number-generator/releases/tag/2.5.1), GitHub. 检索来源 .

MATLAB 版本兼容性
创建方式 R2019b
兼容任何版本
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 Quantum Mechanics 的更多信息

Community Treasure Hunt

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

Start Hunting!
版本 已发布 发行说明
2.5.1

See release notes for this release on GitHub: https://github.com/gzubia/quantum-random-number-generator/releases/tag/2.5.1

2.5.0

Timeout has been set to 'Inf' in order to avoid "time out" errors (line '59').

2.0.0

SOLVED: in line 70 the 'unique' function from Matlab returned the data ordered, destroying the randomness. To solve that, the flag 'stable' has been added

ok_rnd = unique(rnd(rnd<=n),'stable'); % Comprobation that any of the random number

1.0.0

要查看或报告此来自 GitHub 的附加功能中的问题,请访问其 GitHub 仓库
要查看或报告此来自 GitHub 的附加功能中的问题,请访问其 GitHub 仓库