How to program a quantum computer - Part 2

Battleships with quantum measurements

Image for post
Image for post
IBM Research https://www.flickr.com/photos/ibm_research_zurich/33072160062/

How to look at qubits

Mapping the world of a qubit

Image for post
Image for post

Measuring a qubit

A bit is just a bit, even when it’s quantum

The game mechanic

Dealing with short-lived qubits

Doing a +/- measurement

measure q[0] -> c[0];
h q[0];
gridScript.h(q[0])
h q[0];
measure q[0] -> c[0];
h q[0];
measure q[0] -> c[0];
x q[0];measure q[0] -> c[0];
h q[0];measure q[0] -> c[0];
h q[0];h q[0];
measure q[0] -> c[0];
h q[0];
x q[0];h q[0];
measure q[0] -> c[0];
h q[0];
h q[0];
measure q[0] -> c[0];
h q[0];

Dealing with errors

Putting it all together

Wrangler of qubits. Drinker of tea. Father.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store