Quantum computing

With quantum computing over the horizon - there will soon be demand for quantum programmers. Eventually, quantum programming will be the norm... in about 40 years. But knowledge is power and the early bird gets the worm and those who snooze loose.

In a nutshell, quantum computing works like a normal computer... just more science fiction. A normal computer sees 1's and 0's (binary) which are known as bits. You're either a 0 (off state) or a 1 (on state). In quantum computing - we have qubits. You're either a 0 or a 1 or both, known as a quantum state. This derives from the Schrödinger's cat paradox. The future of computer science isn't just computing... it's also quantum phsysics... so better brush up on some physics if you want to stay ahead.

Quantum computing will change the world when it arrives. Cryptography and cybersecurity will evolve massively due to how powerful and fast a quantum processor will be. An RSA encryption with 4096-bit keys will be cracked in a matter of seconds if not milliseconds, so if you think you're safe using military-grade encryption to protect your data and privacy... better think again.

The way in which we use the internet will even change. Forget 5G internet... we'll be teleporting qubits using quantum teleportation. This is some Dr. Who stuff...

Microsoft were one of the first to dive straight into quantum programming with their new language Q# which is right now used for expressing quantum algorithms, which I've been learning on and off for the past year. However, other languages have already started to evolve, preparing for this change in the world. Below is a piece of Golang code which generates a qubit and teleports it, and calculates the probability of the qubit being a 1 (on state).


package main

import (
"github.com/itsubaki/q"
"fmt"
)

func main() {
qubit := q.New()

// generate qubits of |phi>|0>|0>
phi := qubit.New(1, 2)
q0 := qubit.Zero()
q1 := qubit.Zero()

// normalize |phi>. |phi> = a|0> + b|1>, |a|^2 = 0.2, |b|^2 = 0.8
qubit.H(q0).CNOT(q0, q1)
qubit.CNOT(phi, q0).H(phi)

// Send mz & mx to Savile
mz := qubit.Measure(phi)
mx := qubit.Measure(q0)

// Apply Z and X
qubit.ConditionZ(mz.IsOne(), q1)
qubit.ConditionX(mx.IsOne(), q1)

// Savile got |phi> state. Store in res variable
res := qubit.Estimate(q1).Probability()

// Print result to console
fmt.Println(res)
}



LewyBlog - Blog software created by Lewis Williams