# Lecture 002 - Mystery Instruction

Amplitudes: probability with minus sign (the true probability govern the physics of Quantum Mechanics), or complex numbers.

## Probabilistic Computing

Probabilistic Computing: classical deterministic computing with one "coin flip" instruction.

coin() \to \begin{cases} 0 & \text{w.p. 0.5}\\ 1 & \text{w.p. 0.5}\\ \end{cases}

Question: if Probabilistic Computing more powerful than deterministic computing?

• Yes, for ill-defined task: if our task is print random bits, or do cryptography key generation.

• No: randomiss is a hack to get rid of effects of bad input cases and trust the Law of Big Number.

• It allows us to trade error probability with efficiency

### Primality Testing Example

Primality Testing for n-bit string.

Different Algorithm and Efficiency

• Naive Algorithm: $y$

• G.Miller: there exists a deterministic algorithm uses $n^4$ steps (assuming Riemann Hypothesis is true)

• Solovay–Strassen: there exists a probabilistic algorithm use $n^3$ steps

• Miller-Rabin primality test: $n^2$ steps

• AKS primality test: Polynomial $n^{12}, n^6$ deterministic, proven, algorithm

### Conclusion

Conclusion: for every computational task solvable in polynomial time with probabilistic algorithm, it is solvable in polynomial time in deterministic algorithm (assuming some "P != NP" not proven hypothesis to be true)

Instructor's Opinion: - Seems: randomness give power from a layer of P to another - Very Likely: randomness does not speed up NP to P

Quantum computing is similar to adding randomness in classical computing:

• Cool

• 1 new instruction

• new math

• everyone can build

• simulate random/quantum

• But quantum can give exponential speed up to at least one problem: Prime Factor

• Quantum computer cannot solve most problem (NP-complete)

Quantum computer is simulate quantum behavior. Other physical behavior cannot simulate quantum behavior efficiently. This make sense because simulating all behavior of particles using electrons is very slow.

## How to Run Quantum Code

We can simulate the behavior of photons up to 10 particles, not more because $n$ photons have $2^n$ possible states. This is because modern computer uses "whether we have current" to represent bits, but we use spin of photons in quantum computers.

We could have built a QC using electrons or bigger matter, but it is physically hard to do so.

You can play a simulated version of quantum computer here: Scratch or Scratch, or Scratch. Pressing 's' toggles sounds, pressing 't' toggles talkativeness, pressing 'v' toggles visuals.

If you add variables in the quantum world, things will interfere, unlike addding constants.

Further readings: The NIST Process for Post-Quantum Cryptography

Table of Content