Live data from Hacker News

Show HN: Play with real quantum physics in your browser

quantum.orgsoft.org

61–70 of 78 posts

Re: Show HN: Play with real quantum physics in your browser

#61
post #11
post #8

Is this truly live or did they batch random numbers ahead of time?

Technical Details section of help explains "we buffer batches of coin flips in advance to ensure a responsive experience. Your coin flips are always drawn directly from a quantum circuit, though no necessarily in real-time."

Am I wrong, or would that mean this “quantum flip” can be biased by race conditions, round robin, CDNs, things like that?

Re: Show HN: Play with real quantum physics in your browser

#62
post #18
post #15

Tangent, but interesting: how do you get fair samples from a biased coin? 1. You take a string of biased samples like 001011100101 2. you split it in pairs 00 10 11 10 01 01 3. you keep only pairs with a zero and a one in them 10 10 01 01 4. You assign 0 and 1 to them, e.g. 1 1 0 0, this is a fair sampling from an unbiased coin Why does it work? Because even if p(0) ≠ p(1), p(01) = p(10).

Damn, that is cool

It's a nice trick, but it requires a lot of extra coin flips. Imagine you have a coin with p(1)=0.501, and you want 1000 random bits. With the proposed method, this will take about 4000 coin flips. Surely, since the coin is quite close to being fair, it should be possible to do it with far fewer flips ...

Re: Show HN: Play with real quantum physics in your browser

#63
post #15

Tangent, but interesting: how do you get fair samples from a biased coin? 1. You take a string of biased samples like 001011100101 2. you split it in pairs 00 10 11 10 01 01 3. you keep only pairs with a zero and a one in them 10 10 01 01 4. You assign 0 and 1 to them, e.g. 1 1 0 0, this is a fair sampling from an unbiased coin Why does it work? Because even if p(0) ≠ p(1), p(01) = p(10).

Remember you also have to determine the coin is biased and the results are in a biased order.

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

https://www.eecs.harvard.edu/~michaelm/coinflipext.pdf

Re: Show HN: Play with real quantum physics in your browser

#64
post #56
post #52

Earlier quoted context omitted.

Instead of discounting some of the results, can we alternate the value of the coin each toss? So on the first flip, heads is 0 and tails is 1, then on the next flip, heads is 1 and tails is 0.

That'll obtain the right average but won't have the same pairwise relations as an independent, unbiased coin. 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…

A general direction you could go is to use blocks greater than 2. For example, you flip the coin exactly 64 times, and discard the result unless there is exactly 1 tails and 63 heads. This happens about 22% of the time, so it's on average 290 flips to get a single sample. When you do get that sample, you convert the single tails' position within that 64 block into binary, and get a 6 bit number uniformly distributed 0-63, i.e. you get 6 bits of entropy. So on average 6/290=0.02 bits of entropy per flip, twice as good as using blocks of 2, though only a quarter as good as the theoretical upper bound.

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.

Re: Show HN: Play with real quantum physics in your browser

#65

A few years ago I heard a story on NPR about someone who built a site that also used the IBM quantum backend. They had you input a question about what you should do with your life (I think the example was "Should I grow a beard?"). Then the quantum backend would give you a yes or no answer. The idea here is that if you believe the many worlds interpretation then that quantum decision splits the universe in two, and i…

That is a fun idea. With enough quantum computing power, we might be able to spawn enough universes fast enough to crash The Simulation. Maybe even escape containment and access the quantum hypervisor!

Re: Show HN: Play with real quantum physics in your browser

#66
post #15

Tangent, but interesting: how do you get fair samples from a biased coin? 1. You take a string of biased samples like 001011100101 2. you split it in pairs 00 10 11 10 01 01 3. you keep only pairs with a zero and a one in them 10 10 01 01 4. You assign 0 and 1 to them, e.g. 1 1 0 0, this is a fair sampling from an unbiased coin Why does it work? Because even if p(0) ≠ p(1), p(01) = p(10).

[deleted]

Re: Show HN: Play with real quantum physics in your browser

#67
post #32

Thank you for sharing! As a small remark, classical and quantum coins are equally susceptible to bias. So the initial intro is a bit misleading.

People using quantum computers for random uncorrelated 50/50 bitstrings makes me unreasonably angry (disclaimer: employer in profile, this is my personal opinion). At best, it's just a test of how well we've got the calibration dialed in, how isolated the qubits are, etc. Fine as a test "does the machine do what its manufacturer claims," but otherwise a tragic waste of resources. Hardware RNGs can beat any quantum computer on bandwidth and reliability for a few pennies, versus a multimillion dollar behemoth.

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.

Re: Show HN: Play with real quantum physics in your browser

#68
As someone that has basically zero background in quantum, is there some kind of "aha" thing I'm supposed to observe here?

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.

Re: Show HN: Play with real quantum physics in your browser

#69
post #11
post #8

Is this truly live or did they batch random numbers ahead of time?

Technical Details section of help explains "we buffer batches of coin flips in advance to ensure a responsive experience. Your coin flips are always drawn directly from a quantum circuit, though no necessarily in real-time."

yea its not truly random. not sure how predictable the batching or caching is

Re: Show HN: Play with real quantum physics in your browser

#70

A few years ago I heard a story on NPR about someone who built a site that also used the IBM quantum backend. They had you input a question about what you should do with your life (I think the example was "Should I grow a beard?"). Then the quantum backend would give you a yes or no answer. The idea here is that if you believe the many worlds interpretation then that quantum decision splits the universe in two, and i…

That is a fun idea. With enough quantum computing power, we might be able to spawn enough universes fast enough to crash The Simulation. Maybe even escape containment and access the quantum hypervisor!

Only to discover there is another layer
Post reply on HN