Learning Notes
Home
Home
  • Guide
    • Shortkeys
    • Commands
  • Cpp
    • Basic
    • Scope, Duration, and Linkage
    • Pointers(1)
    • Pointers(2)
  • Rust Learning
    • 1.Number Types
    • 2.Ownership
    • 3.Struct
    • 4.Enum
    • 5.Package-management
    • 6.Vector
    • 7.Error handle
    • 8.Trait 泛型
    • 9.Life time
    • 10.Test
    • 11.Minigrep
    • 12.Closure 闭包
    • 13.Smart pointer 智能指针
    • 14.Fearless concurrency 无畏并发
  • Quantum Computing
    • Basic computing and quantum computing Theory
    • Teleportation
    • QKD and QFT
    • QFE and Shor's algorithm
    • QAOA
    • Quantum algorithms
    • Week 11
  • Statical Machine Learning
    • Bayesian Linear Regression
    • Linear regression and logistic regresion
    • Bais
    • SVM, Kernel Methods
    • Precepction and Artificial Neural Network
    • Cross validation, experts learning, MAB
    • Bayesian inference
    • GMM-EM
    • final
  • Software Project Management
    • Lecture
    • Revision
  • AI-planning
    • Classical planning
    • MDP and reinforcement learning
    • Game theory and final recap

QKD and QFT

Quamtum Key Distribution: BB84

In BB84, Alice begins with a bunch of random bits, and for each bit, she randomly chooses either the Z-basis {∣0⟩,∣1⟩}\{\ket{0},\ket{1}\}{∣0⟩,∣1⟩} or the X-basis {∣+⟩,∣−⟩}\{ \ket{+}, \ket{-} \}{∣+⟩,∣−⟩}

Bob receives the qubits, and he randomly measures each one in either the Z-basis or X-basis. If the basis he picked was the same as Alice's, then he will get the same result. If he picked the opposite basis, however he will get each possible result with 50% possibility.

Alice and Bob now publicly announce what basis they used for measurement. If they used the same basis, then they know their measurement outcome should agree and they have a shared secret bit. If they used different bases, they will discard these bits.

alt text

Prevent Eavesdropping

To ensure Eve did not measure the qubits along the way, Alice and Bob can reveal a fraction of their shared qubits.
Generating 306 bits using BB84, revealing 50 bits to ensure no evasdropper.

Probability Alice and Bob detect Eve=1−(34)n \text{Probability Alice and Bob detect Eve} = 1 - (\frac{3}{4})^n Probability Alice and Bob detect Eve=1−(43​)n

Thus if Alice and Bob share 50 bits of their shared secre key, the probability that they detect Eve is 1−(34)50=0.999999431- (\frac{3}{4})^50 = 0.999999431−(43​)50=0.99999943, which is very close to certainty.

alt text

Quantum Fourier Transform

∣ψ⟩|\psi\rangle∣ψ⟩: A normalized quantum state:

∣ψ⟩=(a0a1a2⋮aN−1)=a0∣0⟩+⋯+aN−1∣N−1⟩ \left| \psi \right\rangle = \begin{pmatrix} a_0 \\ a_1 \\ a_2 \\ \vdots \\ a_{N-1} \end{pmatrix} = a_0 \left| 0 \right\rangle + \cdots + a_{N-1} \left| N-1 \right\rangle ∣ψ⟩=​a0​a1​a2​⋮aN−1​​​=a0​∣0⟩+⋯+aN−1​∣N−1⟩

Applying the QFT yields another normalized quantum state:

∣ϕ⟩=(ϕ0ϕ1ϕ2⋮ϕN−1)=ϕ0∣0⟩+⋯+ϕN−1∣N−1⟩ \left| \phi \right\rangle = \begin{pmatrix} \phi_0 \\ \phi_1 \\ \phi_2 \\ \vdots \\ \phi_{N-1} \end{pmatrix} = \phi_0 |0\rangle + \dots + \phi_{N-1}|N-1\rangle ∣ϕ⟩=​ϕ0​ϕ1​ϕ2​⋮ϕN−1​​​=ϕ0​∣0⟩+⋯+ϕN−1​∣N−1⟩

We call ∣ϕ⟩|\phi\rangle∣ϕ⟩ the quantum Fourier fransform of ∣ψ⟩|\psi\rangle∣ψ⟩. The equat ion:

Generic QFT circuit

∣j⟩⟶1N∑k=0N−1e2πijkN∣k⟩ \left| j \right\rangle \longrightarrow \frac{1}{\sqrt{N}} \sum_{k=0}^{N-1} e^{\frac{2\pi i jk}{N}} \left| k \right\rangle ∣j⟩⟶N​1​k=0∑N−1​eN2πijk​∣k⟩

alt text Where RkR_kRk​:

Rk=[100e2πi2k] R_k = \begin{bmatrix} 1 & 0 \\ 0 & e^{2\pi \frac{i}{2^k}} \end{bmatrix} Rk​=[10​0e2π2ki​​]

To invert the QFT, we must run the circuit in reverse, with the inverse of each gate in place to achieve the transform

Inverse Quantum Fourier Transform
The inverse quantum Fourier transform (IQFT) undoes the QFT.

1N∑k=0N−1e2πijikN∣k⟩⟶∣j⟩ \frac{1}{\sqrt{N}} \sum_{k=0}^{N-1} e^{2\pi i j \frac{ik}{N}} \left| k \right\rangle \longrightarrow \left| j \right\rangle N​1​k=0∑N−1​e2πijNik​∣k⟩⟶∣j⟩

Since quantum gates are unitary, the inverses are their conjugate transpose. SWAP†=SWAP\text{SWAP}^\dagger = \text{SWAP}SWAP†=SWAP, H†=HH^\dagger = HH†=H and Rk†R_k^\daggerRk†​ is a rotation about the z-axis of the Bloch sphere by −π2k-\frac{\pi}{2^k}−2kπ​ radians.
The Rk†R_k^\daggerRk†​:

Rk†=[100e−2πi2k] R_k^\dagger = \begin{bmatrix} 1 & 0 \\ 0 & e^{-2\pi \frac{i}{2^k}} \end{bmatrix} Rk†​=[10​0e−2π2ki​​]

Last Updated:
Contributors: pingzhihe
Prev
Teleportation
Next
QFE and Shor's algorithm