Created
November 30, 2018 14:10
-
-
Save gnh1201/e0b7359c31f284e18ba6634ca1de2d75 to your computer and use it in GitHub Desktop.
Quantum computing simple mockup in javascript
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Quantum computing simple mockup in javascript | |
// Go Namhyeon <[email protected]> | |
// https://github.com/gnh1201 | |
function make_qubit() { | |
var a = ((Math.random() / Math.random()) > Math.random()); // qubit first bit | |
var b = ((Math.random() / Math.random()) > Math.random()); // qubit second bit | |
var c = ((Math.random() / Math.random()) > Math.random()); // qubit third bit | |
var qubit = [a, b, c]; | |
return qubit; | |
} | |
for(var i = 0; i < 1000; i++) { | |
var qubit = make_qubit(); | |
console.log("first: " + qubit[0] + ", second: " + qubit[1] + ", third: " + qubit[2]); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment