This repo stores some of the code I wrote while reading through a great quantum computing textbook by Thomas Wong. I ran some of it on quantum computers via the IBM Quantum Platform.
-
Bit-Flip Code
-
Phase-Flip Code
- Rotations about the z-axis (phase flip error -- change in relative phase): link
-
Shor Code
- Transmitting the state of 1 qubit using 2 classical bits: link
- Quantum search / brute force
- Quirk (4 input qubits with answer
w = 1011
): link
- Quirk (4 input qubits with answer
- Quantum gates are unitary, so their eigenvalues are of the form
e^(ix)
, wherex
is real and is the phase of the eigenvalue - Upper part input and output is n-bit eigenvector of matrix U --- eigenstate |v>
- Lower part output is m-bit binary decimal
j
that givesx = 2pi * j
- So we estimate the phase --> eigenvalue with m bits of precision
- Quirk: link
- Find the (nontrivial) value of
x
such thata^x mod m = a^0 mod m = 1 mod m
- Quirk: (3^x mod 7) link