Skip to content

Instantly share code, notes, and snippets.

@stuartleeks
Last active February 28, 2018 11:38
Show Gist options
  • Save stuartleeks/a4554ece4761f433bd276310d42f4653 to your computer and use it in GitHub Desktop.
Save stuartleeks/a4554ece4761f433bd276310d42f4653 to your computer and use it in GitHub Desktop.
Quantum notes

Quantum notes

These are my personal notes from reading up on Quantum Computing. There's a great series of posts here, including a more comprehensive cheat sheet that you should probably use instead!

Dirac notation and vectors

Using (a,b) to represent the column vector: (a)
                                            (b)

|0〉 = (1,0)
|1〉 = (0,1)

|00〉 = (1,0,0,0)
|01〉 = (0,1,0,0)
|10〉 = (0,0,1,0)
|11〉 = (0,0,0,1)

Also, |0〉|1〉 = |01〉

|+〉 = 1/√2 * (|0〉 + |1〉)
|-〉 = 1/√2 * (|0〉 - |1〉)

Gates

X

(The NOT gate)

X = (0 1)
    (1 0)
X|0〉 = |1〉
X|1〉 = |0〉
X|+〉 = |+〉
X|-〉 = -|-〉

Z

Z = (1  0)
    (0 -1)

Z|0〉 = |0〉
Z|1〉 = -|1〉

H

(Hadamard gate)

H = 1/√2 * (1  1) 
           (1 -1)

H|0〉 = |+〉
H|1〉 = |-〉
H|+〉 = |0〉
H|-〉 = |1〉

UCN

Controlled NOT (CNOT) Gate

Note: Using Ucn below as a substitute for UCN

Ucn = (1 0 0 0)
      (0 1 0 0)
      (0 0 0 1)
      (0 0 1 0)

Ucn|00〉 = |00〉
Ucn|01〉 = |01〉
Ucn|10〉 = |11
Ucn|11〉 = |10〉

Bell states

Aka EPR pairs

TODO!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment