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.
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.Similar to how you can have hello world in both ruby and python, but arrive at them with different syntax and compilers.
The troll answer of simulating a qbit using a qbit excluded.
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