Flipping a Coin With a Quantum Computer

Anyone with an AWS account can flip a coin using quantum mechanics

An ion trap quantum computer.

Step 1: Set Up Your Account

The first thing you need to do is create an AWS account if you don’t have one already. Go to https://aws.amazon.com and follow the instructions.

Step 2: Write Some Code

Click the notebook URL shown on the notebook instance list. The URL will look something like: amazon-braket-[name].notebook.[region].sagemaker.aws

Counter({'0': 505, '1': 495})

Step 3: Choose a Quantum Computer

The three hardware offerings from Amazon Braket, taken from https://aws.amazon.com/braket/.
  1. Gate-based ion traps from IonQ
  2. Quantum annealing from D-Wave
Counter({'0': 593, '1': 407})

Step 4: Put It All Together

A complete coin flip example could look something like this:

Comparing with a classical coin flip

Here’s my review of the experience using a quantum computer to flip a coin vs. just flipping a physical coin.

  • 🚫 costs money each flip
  • 🚫 only available during business hours
  • ✅ cool and quantum
  • ✅ you need a coin, but you get to keep it afterward
  • ✅ available any time
  • 🚫 boring and classical

I develop software and develop people. stevenheidel.com

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