156 points | by mattvr1 个月前
I was surprised to see this on the frontpage this morning and the scale is pushing the limits of our quantum randomness generator
It should be working again now as I'm pushing fixes. Thanks for your patience.
This is a cool demo and a great first effort, but does it really use IBM's quantum computer? From my experience, the queues are generally quite long and and it takes atleast 10-15 secs from submission to getting your results back. And getting a single bit back is hugely inefficient. My guess is that you are submitting a circuit with hadamard on all the qubits with 1000-10000 shots and storing the results and showing them to people one by one? This might be misleading as you are not actually connected to the ibm quantum computer and generating random numbers in real-time.
Plus, since the ibm quantum comptuers exhibit a lot of noise, you are not getting truly random numbers. A better introduction to generating random numbers and also certifying them is available: https://github.com/dorahacksglobal/quantum-randomness-genera...
You can play with this on qBraid.com and try out even more quantum computers. We actually used this as a hackathon challenge at South Carolina Hackathon. Keep on building and join us at future events!
This is explained very closely to what you've said in the "Technical details" help section. Occasionally you'll get a real-time result. I'll check out the links you sent next, thank you!
Do you think qBraid could support this with more real-time latency?
What you did was a cool experiment, but, given our current understanding of quantum computing hardware will not scale. Random number generation has to be incredibly cheap and I remember encountering a few startups in the past that used photonics to generate random numbers.
The idea here is that if you believe the many worlds interpretation then that quantum decision splits the universe in two, and in one universe you grow a beard, and in the other you don't.
I thought it was a fun idea.
[1] https://spectrum.ieee.org/behind-intels-new-randomnumber-gen...
The details for what a quantum coin flip is has the description "your friends will think you're a wizard."
Why? I certainly don't think I'm a wizard right now.
Edit: I think figure 3 in this study is what I'm looking for. They define the inconsistency I described as "spectral pivoting".
> This discrepancy is because the Mermin-Wagner-Hohenberg theorem holds in the thermodynamic limit, while these simulations are for finite lattices
I think thermodynamic limit here means, it needs to be way too hot?
As a small remark, classical and quantum coins are equally susceptible to bias. So the initial intro is a bit misleading.
That said... as a demo of a stack using quantum cloud compute, it's all in good fun and I shouldn't be a stick in the mud.
$ curl https://quantum.orgsoft.org/info
{"status":"ok","message":"Connected to IBM Eagle r3 (127 qubits)","display_name":"Eagle r3 (127 qubits)","alias":"ibm_kyiv","version":"1.20.22","num_qubits":127,"processor":"Eagle r3","url":"https://quantum.ibm.com/services/resources?system=ibm_kyiv"}
$ curl https://quantum.orgsoft.org/flip
1
From https://news.ycombinator.com/item?id=37379123 :
> [ Rx, Ry, Rz, P, CCNOT, CNOT, H, S, T ]
From https://news.ycombinator.com/item?id=39341752 :
>> How many ways are there to roll a {2, 8, or 6}-sided die with qubits and quantum embedding?
From https://news.ycombinator.com/item?id=42092621 :
> Exercise: Implement a QuantumQ circuit puzzle level with Cirq or QISkit in a Jupyter notebook
ray-pH/quantumQ > [Godot] "Web WASM build" issue #5: https://github.com/ray-pH/quantumQ/issues/5
> [Quantum Flytrap] Virtual Lab is a virtual optical table. With a drag and drop interface, you can show phenomena, recreate existing experiments, and prototype new ones.
> Within this environment it is possible to recreate interference, quantum cryptography protocols, to show entanglement, Bell test, quantum teleportation, and the many-worlds interpretation.
This isn't quite that but I guess it's a first step.
import numpy as np
from qiskit import QuantumCircuit
# 1. A quantum circuit for preparing the quantum state |000> + i |111> / √2
qc = QuantumCircuit(3)
# generate superposition
qc.h(0)
# add quantum phase
qc.p(np.pi / 2, 0)
# 0th-qubit-Controlled-NOT gate on 1st qubit
qc.cx(0, 1)
# 0th-qubit-Controlled-NOT gate on 2nd qubit
qc.cx(0, 2)
The explanation says the visualization shows the coin in all possible states. I'm trying to count quickly and it seems like about 8. Does all possible states mean there's an infinite number and 8 are shown for visualization purposes, or is there a finite predictable number of possible states.
In this example the coin is put into the state where an and b equal 1/sqrt(2) to give an equal probability of each outcome. So there is exactly one state associated with the coin. Now this state does lead to two possible outcomes but the underlying state (that can not be directly observed) is exactly one thing.
Maybe I am so disconnected from the rest of reality, I count as absolute, non destructive observer?
[0] https://cheapuniverses.com/
Earlier discussion: https://news.ycombinator.com/item?id=30499169
> Failed to get quantum result from server
cloudflare connection timed out
Why does it work? Because even if p(0) ≠ p(1), p(01) = p(10).
That's probably easiest to see if you imagine approaching an infinitely biased coin (100% heads, 0% tails). Your strategy alternates between 0 and 1 almost always. The listed strategy throws away most flips but gives actualy unbiased results when a pair does pass.
Another way to look at it is from an entropy perspective. An unbiased, independent coin flip has 1 bit of entropy. A biased coin with, e.g., 99% heads has 0.0807 bits of entropy. On average, you need at least 12.377 such flips to emulate an unbiased, independent flip. Any strategy without some sort of rejection/continuation/... (like your proposal) is doomed to fail.
I haven't checked if their proposal is actually optimal. Empirically, it's suggestive of having room for improvement. I'm seeing something like 101 flips on average instead of 12.377 for that 99% bias example.
I picked "block of 64 with only a single tails" since it was simple, and I'm sure a mathematician could figure out how to optimize it much more, but my general point is to agree that there's definitely ways to get closer to the theoretical upper bound you mentioned.
Wikipedia: https://en.wikipedia.org/wiki/Fair_coin#Fair_results_from_a_...
Original paper: https://mcnp.lanl.gov/pdf_files/InBook_Computing_1961_Neuman...
"An ideal unbiased coin might not correctly model a real coin, which could be biased slightly one way or another. After all, real life is rarely fair."
(this one has less wow, i guess)
1. You take a string of fair samples 0101011101010 2. you split it into chunks of 3 (8 possibilities, so each one is 0.125 chance) 3. 000, 001, 010 -> 1, and all the rest is 0, which will get 0.275 chance
Any better approaches?