Re:What makes quantum computing so hard to explain?
by simonblack on Tuesday June 08, 2021 @05:20PM
(#27441013)
I would be very happy if somebody showed me the equivalent to the 'Hello World' program in quantum computing. Or even something like '1 + 1 = 2' as a quantum program.
[ Parent
| on HN ]
Re:What makes quantum computing so hard to explain?
by reikonomusha on Wednesday June 09, 2021 @12:16AM
(#27444160)
I consider simulating a coin flip (aka creating a so-called “even superposition”) to be the hello world of quantum computing. In a quantum programming language called Quil, this looks like
DECLARE result BIT
H 0
MEASURE 0 result
This will put a 0 or a 1 in result with equal probability. ‘H 0’ is performing a Hadamard operation on qubit 0. The MEASURE allows us to extract a classical bit value out of a qubit.Others might say the “Bell pair” is the hello world, and that looks like this:
H 0
CNOT 0 1
This is a bit harder to explain, because it requires understanding both superposition and entanglement.
Re:What makes quantum computing so hard to explain?
by krastanov on Wednesday June 09, 2021 @10:06PM
(#27455938)
I am just being annoyingly pedantic, but I do not think a Clifford circuit (both of your examples fall in this category) is a good quantum hello world, because they are trivial to simulate efficiently on a classical computer. But I do not have better suggestions.
Re:What makes quantum computing so hard to explain?
by chunky1994 on Wednesday June 09, 2021 @10:20PM
(#27456009)
I don't think a "hello world" type of program/circuitry(?) needs to be unique to a quantum computer. It just needs to be expressible with a quantum circuit.
Similar to how you can have hello world in both ruby and python, but arrive at them with different syntax and compilers.
Re:What makes quantum computing so hard to explain?
by Bjartr on Thursday June 10, 2021 @08:30AM
(#27459861)
And displaying "Hello World" can be done trivially with a pencil and paper. That doesn't make doing so in a classical programming language devoid of value.
Re:What makes quantum computing so hard to explain?
by krastanov on Thursday June 10, 2021 @12:58PM
(#27462875)
Sure, but there is value in a "Hello World" being focused on what is special about the hardware/language. Look at Haskell and OCaml tutorials for instance: they all explicitly say stuff like "let us start with the 'Hello World' of functional languages, namely, implementing the Fibonacci (or factorial) function recursively".
Re:What makes quantum computing so hard to explain?
by josefx on Thursday June 10, 2021 @06:24AM
(#27459045)
Isn't that the case for literally anything you could run on the current state of the art quantum computers?
The troll answer of simulating a qbit using a qbit excluded.
Re:What makes quantum computing so hard to explain?
by derbOac on Tuesday June 08, 2021 @11:59PM
(#27444079)
I think part of the problem (although not all of it) is that quantum computers are at a phase that's analogous to writing a "Hello World" program in very rudimentary assembly. Even ignoring the quantum part, there's still a big gap.
Re:What makes quantum computing so hard to explain?
by ivan_ah on Thursday June 10, 2021 @08:28AM
(#27459843)
I guess the closest thing to a quantum hello world would be a simple quantum circuit—each line represents a qubit register, and various types of gates operate on the qubits.
To see quantum circuits that do something useful, check out the "Example Circuits" links that show up in the Quirk simulator: https://algassert.com/quirk
via https://algassert.com/2016/05/22/quirk.html via https://news.ycombinator.com/item?id=11752421
Re:What makes quantum computing so hard to explain?
by mannerheim on Thursday June 10, 2021 @01:48AM
(#27457182)
Quantum teleportation is a somewhat simple but non-trivial procedure: https://qiskit.org/textbook/ch-algorithms/teleportation.html
Re:What makes quantum computing so hard to explain?
by rpmuller on Tuesday June 08, 2021 @06:22PM
(#27441815)
A controlled-NOT gate (CNOT) can be thought of as addition mod 2: https://en.wikipedia.org/wiki/Controlled_NOT_gate
Re:What makes quantum computing so hard to explain?
by analog31 on Wednesday June 09, 2021 @10:14PM
(#27455985)
I think a simple simulator would go a long way, using random numbers in a language like Python. It doesn't have to be fast or efficient, just be able to proceed through some basic operations while we watch it evolve.