The instructor's own section-divider doodle reads "realm" above "Quantum Bits" — a nod to qubits as their own strange little realm of physics, distinct from classical bits.
Quantum Bit as Probability Distribution
In quantum computing, we enable parallelism by:
Converting a bitstring into a sequence of binary distributions
Manipulating these distributions with complex matrix operations
Sharing data structures via quantum entanglement and lazy evaluation
Quantum state for a binary distribution: u=[αβ]⊤
where α,β are complex coefficients ("probability amplitudes"), and P(0∣u)=∣α∣2P(1∣u)=∣β∣2
Discrete binary values 0 and 1 can be represented as pure quantum states:
∣0⟩=[10]⊤∣1⟩=[01]⊤ ∣0⟩=[10]∣1⟩=[01]
This notation is called "ket"; e.g. ∣0⟩ reads "ket-zero" and ∣1⟩ reads "ket-one".
Meaning:∣n⟩ is a one-hot column vector on the n-th position, where the index starts with 0, and n is a binary number.
Instructor's annotation
Worked example of the general one-hot pattern: ∣2⟩=001⋮←index 2 Also labels α,β as "probability amplitudes", and draws a wavy line under ∣0⟩,∣1⟩ marked "diff. phases" — a reminder that α and β aren't just magnitudes, each can carry its own phase. Underlines the word "Bra-ket" twice for emphasis (the naming convention covering both ⟨⋅∣ and ∣⋅⟩).
One-hot vector (only one element in the vector is one)
Analogy
Think of ∣0⟩ and ∣1⟩ as unit vectors pointing along two perpendicular axes — any quantum bit is just some blend (superposition) of "how much you're pointing along the 0-axis" and "how much along the 1-axis," where the squared length of each piece gives you the probability of measuring that outcome.
Dirac's Notation
The adjoint (conjugate transpose) of these vectors: ⟨0∣=∣0⟩∗=[10]⟨1∣=∣1⟩∗=[01]
This notation is called "bra".
Meaning:⟨n∣ is a one-hot row vector on the n-th position.
Dirac's notation: ∣n⟩ and ⟨n∣, where:
⟨0∣0⟩=∣0⟩∨∣0⟩=1⟨0∣1⟩=∣0⟩∨∣1⟩=0
How about ⟨1∣1⟩ and ⟨1∣0⟩?
Mixed state: a mixture of pure states:
∣ψ⟩=α∣0⟩+β∣1⟩=[αβ]⊤
where ∣α∣2+∣β∣2=1
Mixed state can also be seen as a superposition:
∣ψ⟩=r1cisθ1∣0⟩+r2,cisθ2∣1⟩
Adjoint of mixed state:
⟨ψ∣=∣ψ⟩∗=r1,cis(−θ1),⟨0∣+r2,cis(−θ2),⟨1∣
Instructor's annotation
Labels the adjoint operation "( conjugate transpose )" right above the definitions of ⟨0∣,⟨1∣. Worked-out matrix multiplication for the two inner products: ⟨0∣0⟩:[10][10]=1⋅1+0⋅0=1⟨0∣1⟩:[10][01]=1⋅0+0⋅1=0
Analogy
A "bra" is just a "ket" flipped on its side and conjugated — like a mirror image that's built specifically so that bra times ket gives you a plain number (how similar two states are) instead of another vector or a matrix.
Exercise 2.1: Quantum State
Normalize the following vectors and rewrite them as mixed states in Dirac's notation:
[10]⊤
[11]⊤
[cis4π1]⊤
[cis6πcis(−6π)]⊤
[i/4−i/6]⊤
[1i]⊤
[0−1+i]⊤
Answer the following questions:
Compute the adjoints of all quantum states in Ex. 1–7 and write them down in Dirac's notation.
Suppose ∣ψ⟩=r1,cis,θ1,∣0⟩+r2,cis,θ2,∣1⟩. Show that ⟨ψ∣=r1,cis(−θ1),⟨0∣+r2,cis(−θ2),⟨1∣.
Show that for any complex vector ∣ψ⟩=α∣0⟩+β∣1⟩, ⟨ψ∣ψ⟩=∣α∣2+∣β∣2. (Hint: u∨v=∑k=1Mukvˉk.)
Exercise 2.1 (cont'd): Quantum State
Compute the inner product ⟨ϕ∣ψ⟩ of the following state pairs:
ϕ=∣0⟩ and ψ=∣0⟩
ϕ=∣0⟩ and ψ=−∣0⟩
ϕ=∣1⟩ and ψ=∣0⟩
ϕ=∣0⟩ and ψ=i∣0⟩
ϕ=21(∣0⟩+∣1⟩) and ψ=∣0⟩
ϕ=21(∣0⟩+∣1⟩) and ψ=cis4π∣0⟩
ϕ=21(∣0⟩+∣1⟩) and ψ=−cis4π∣1⟩
ϕ=21(i∣0⟩−i∣1⟩) and ψ=−cis4π∣1⟩
ϕ=21(cis3π∣0⟩+cis32π∣1⟩) and ψ=21(cis(−3π)∣0⟩+cis3π∣1⟩)
Answer the following questions:
Compute ⟨ϕ∣ψ⟩, where ∣ϕ⟩=r1,cis,θ,∣0⟩+r2∣1⟩ and ∣ψ⟩=r1∣0⟩+r2,cis(−θ)∣1⟩.
Compute ⟨ϕ∣ψ⟩, where ∣ϕ⟩=r1,cis,θ1,∣0⟩+r2,cis,θ2,∣1⟩ and ∣ψ⟩=s1,cis,λ1,∣0⟩+s2,cis,λ2,∣1⟩.
Show that for any quantum state ∣ψ⟩ and phase θ: ⟨cis,θ,ψ∣,cis,θ,ψ⟩=⟨ψ∣ψ⟩.
Input state ∣q⟩ is compared against each input basis ∣ψk⟩
Each output basis ϕk is multiplied by input state similarity ⟨ψk∣q⟩
Instructor's annotation
Writes out the Greek letters with their names — ϕ "phi", ψ "psi" — as a pronunciation reminder. On the derivation, labels ∣ϕk⟩ as a "vector" and ⟨ψk∣q⟩ as a "complex number", describing it as the "similarity between input ∣q⟩ and state ∣ψk⟩."
Analogy A quantum operator built this way is like a lookup table made of comparisons: for every incoming state, check "how much does this look like
ψ1? like ψ2? ..." (a set of numbers), then blend the corresponding output states ϕk by those amounts.
Example: Quantum Operator/1
Suppose we want to construct a quantum operator from the following state mapping:
∣0⟩↦2∣0⟩+∣1⟩∣1⟩↦2∣0⟩−∣1⟩
ทำไมต้องใส่ 21 ด้วย ก็เพราะว่าเราต้องทำให้มันเป็น unit vector ด้วยเหตุผลอะไรก็ตาม — ถ้าเราลองบวก ket 0, ket 1 ดูก็จะรู้ว่าเดี๋ยวต้องทำให้มันเป็น unit vector
อย่าลืม Adjoint = conjugate transpose
[(1+2i)∣0⟩]∗=(1−2i)⟨0∣
conjugate เปลี่ยน sign, transpose เป็น ket เป็น bra, bra เป็น ket
Trick 1: Each ∣j⟩⟨k∣ represents the value at position (row j, column k)
We put 21(∣0⟩+∣1⟩) into column 0
We put 21(∣0⟩−∣1⟩) into column 1
Therefore, our quantum operator U is:
U=[212121−21]=21[111−1]
Beware: You always have to compute the adjoint of each input basis ⟨ψk∣.
Instructor's annotation
Full worked expansion, showing each outer-product term as an explicit column-times-row matrix product: 21∣0⟩+21∣1⟩=[1/21/2][10]+[1/2−1/2][01]
Example: Quantum Operator/2
Now let's construct a quantum operator from the following state mapping:
cis4π∣0⟩↦∣1⟩cis(−4π)∣1⟩↦∣0⟩
Remember: Always compute the adjoint of the input bases. #MidtermExam (don’t forget about the adjoint!!!!) - you’ll be asked to construct a quantum operator
You’ll be given a state mapping, but it’ll be multi-qubit (not just one qubit), construct a quantum operators (tips: don’t forget the adjoint!) U=∣1⟩(cis4π∣0⟩)∗+∣0⟩(cis(−4π)∣1⟩)∗=∣1⟩(cis(−4π)⟨0∣)+∣0⟩(cis4π⟨1∣)=cis(−4π)∣1⟩⟨0∣+cis4π∣0⟩⟨1∣
Trick 1: Each ∣j⟩⟨k∣ represents the value at position (row j, column k)
We put 0∣0⟩+cis(−4π)∣1⟩ into column 0
We put cis4π∣0⟩+0∣1⟩ into column 1
Therefore, our quantum operator U is:
U=[0cis(−4π)cis4π0]
Trick 2: It is recommended to have unit input and output bases, because we want to avoid stretching.
Trick 3: In most cases, the input bases are ∣0⟩ and ∣1⟩ for ease of understanding.
Instructor's annotation
Highlights the phrase "∣j⟩⟨k∣" in Trick 1 for emphasis, and writes out the final matrix explicitly to double-check the result: [0cis(−π/4)cis(π/4)0]
Exercise 2.2: Quantum Operator
Compute a quantum operator for the following state mappings:
∣0⟩↦∣1⟩ and ∣1⟩↦∣0⟩
∣0⟩↦i∣1⟩ and ∣1⟩↦−i∣0⟩
∣0⟩↦∣0⟩ and ∣1⟩↦−∣1⟩
∣0⟩↦∣0⟩ and ∣1⟩↦i∣1⟩
∣0⟩↦∣0⟩ and ∣1⟩↦cis(−4π)∣1⟩
∣0⟩↦2∣0⟩+∣1⟩ and ∣1⟩↦2∣0⟩−∣1⟩
2∣0⟩+∣1⟩↦∣0⟩ and 2∣0⟩−∣1⟩↦∣1⟩
cis4π∣0⟩↦cis4π∣1⟩ and cis4π∣1⟩↦cis4π∣0⟩
2cis(−π/4)∣0⟩+cis(−π/4)∣1⟩↦∣0⟩ and 2cis(π/4)∣0⟩−cis(π/4)∣1⟩↦∣1⟩
In the #MidtermExam it may look something like number 9, just don’t forget the adjoint step
Instructor's annotation
Next to item 9, a reassuring note: "TRICK: CALM DOWN" — i.e. the phases look intimidating, but it's the exact same outer-product method as every other item.
Answer the following questions:
Show that for any quantum operator U, applying it twice on any quantum state yields the same state: UU∣ψ⟩=∣ψ⟩.
Show that if there exists phase θ such that all k-th input-output pairs are in the form cis,θ,∣ψk⟩↦cis,θ,∣ϕk⟩, then the quantum operator is U=k=1∑K∣ϕk⟩⟨ψk∣. θ is called a global phase (หรือว่าเรียกอีกอย่างว่า common coefficient).
Exercise 2.2 (cont'd): Quantum Operator
Reminder: ∣j⟩⟨k∣ = element at row j and column k
โจทย์นี้จะเป็นแบบ convert quantum operator back to state mapping!!
We should group them by INPUT STATE because we want state mapping :)
Extract a state mapping out of each quantum operator as follows:
12. [0110]
13. [100−1]
14. 21[111−1]
15. [0i−i0]
16. 21[cis4πcis(−4π)cis4π−cis(−4π)]
Answer the following questions:
Show that any quantum operator U=[abcd] can always be rewritten as U(λ)=[ab−bˉ,cis,λaˉ,cis,λ] for some phase λ. _(Hint: U is a unitary matrix, i.e. U−1=U∗ and det(U)=1. Note that U−1=det(U)1[d−c−ba].)*
Motivation: How can we represent such probability distribution with a particle's spin in a unit sphere?
Spin coordinate is a vector function of polar angle θ and azimuthal angle ϕ:
มุมอสิมุต จำได้มั้ย ที่เรียนกับครูบุ๋ม 5555
σ(θ,ϕ)=sinθcosϕsinθsinϕcosθ
Quantum state is like a Rubik's cube:
Axis Z: ∣0⟩ = up and ∣1⟩ = down
Axis X: ∣+⟩ = front and ∣−⟩ = back
Axis Y: ∣+i⟩ = right and ∣−i⟩ = left
Figure 1: Bloch sphere, with ∣0⟩/∣1⟩ at the poles, ∣+⟩/∣−⟩ (positive/negative real) and ∣+i⟩/∣−i⟩ (positive/negative imaginary) around the equator
Analogy
The Bloch sphere is like a globe for a single qubit: the north and south poles are the "pure" classical states ∣0⟩ and ∣1⟩, and every point on the surface in between is some valid superposition — latitude controls the 0-vs-1 mixture, longitude controls the relative phase.
Spinor
Spinor (pronounced "spinner") is an affine transformation that rotates a complex vector and slightly changes the sign of its phase in parallel.
Non-spinning objects take a 360° full rotation: π to flip the sign and 2π to return to the original sign.
Spinning objects take a 720° full rotation: 2π to flip the sign and 4π to return to the original sign.
Activity: Let's make a one-twist Möbius strip and observe a full rotation on it.
The notion of spinor is applied only on the phase θ to reflect the spin direction.
Figure 2: Rotation on a one-twist Möbius strip — original sign "+", new sign "–" after one loop
Analogy
A qubit's phase behaves like a strip of paper with a single twist (a Möbius strip): walk all the way around once and you come back "flipped" even though you're standing in the same spot — you need to go around twice to truly return to where you started, sign and all. That's exactly why qubits need a 720°, not 360°, full rotation.
3-Step Universal Rotation
Any quantum operator is decomposed into a 3-step rotation: ω→θ→ϕ
Step
Action
Remark จดเอง
Start
—
We have empty quantum operator U=[1001] แม้ว่าจะคูณเลขอะไรไปก็จะได้ vector ตัวเดิม
Step 1
Rotate only ∥1⟩ around Axis Z by phase ω
Step 2
Rotate ∥0⟩ and ∥1⟩ around Axis X by phase θ/2 (like a spinor)
Previously, we found that any quantum operator can be rewritten as U=[abcd]=[ab−bˉcisλaˉcisλ]
Since U is unitary, each column should be a unit vector, i.e. aaˉ+bbˉ=1
Motivated by cos2x+sin2x=1, we choose a=cos2θ due to the spinors
To make b a complex number, we choose b=cis,ϕsin2θ
Letting λ=ω+ϕ, we choose c=−bˉ,cis(ω+ϕ)=−cis,ωsin2θ
Therefore, d=cos2θ,cis(ω+ϕ)
Conversion to U3
Any quantum operator Q can be converted to U3(ϕ,θ,ω): Q=[a1cisλ1a2cisλ2−a2cisλ3a1cisλ4]
where all ak,λk are real numbers.
Steps:
Rewrite Q with the global phase λ1: Q′=[a1a2cis(λ2−λ1)−a2cis(λ3−λ1)a1cis(λ4−λ1)]
We obtain θ,ϕ,ω via: θ=2arccosa12+a22a1,ϕ=λ2−λ1,ω=λ3−λ1
Example: Let's convert Q (Quantum operator) to U3: Q=[212121−21]
We rewrite Q with global phase 0: Q′=[21cis021cis0−21cisπ21cisπ] Q′=[11cis0−1cisπ1cisπ]
We extract θ,ϕ,ω via:
θ=2arccos12+121=2πϕ=0ω=π
Instructor's annotation
On the general form of Q: **"Each column must be a unit vector."**On the worked example, labels which number plays which role: a1=1, a2=1 (the two magnitudes before normalizing by 2), λ1=0 (under the first "cis 0"), and identifies which entries correspond to ϕ and ω in Q′ (the exponents "cis 0" ↔ λ1, "cis π" ↔ λ3), tying the abstract formula directly to the numbers used above.
Exercise 2.3: Rotation Matrix U3
Convert the following quantum operators into the equivalent rotation matrices:
Show that for any quantum operator Q=[a1,cis,λ1a2,cis,λ2−a2,cis,λ3a1,cis,λ4], we can extract θ,ϕ,ω for U3 via: θ=2arccosa12+a22a1, ϕ=λ2−λ1, ω=λ3−λ1.
ก็คูณกันได้เลย หน้าคูณหลัง หลังคูณหลังงี้555 แต่ข้างใน ket ก็แค่เอามาต่อกัน concatinate
Note that each outcome has equal probabilities (1/2)2=0.25
Analogy
Tensor product is like combining two independent coin flips into one joint description: if flip A can be H or T, and flip B can be H or T, the tensor product gives you all four combined outcomes (HH, HT, TH, TT) at once, each with its own probability.
Factorization of Multi-Qubit States
ไหนมามาแปลงกลับดูบ้าง → look for common part AND separate them
แต่ก็มีวิธีที่ถูกต้องทาง Math อยู่ ก็หาง่าย ๆ ทำละกันน
Example: Factorize 21(∣00⟩+∣01⟩)
Factorization of two qubits means (a∣0⟩+b∣1⟩)⊗(c∣0⟩+d∣1⟩)=ac∣00⟩+ad∣01⟩+bc∣10⟩+bd∣11⟩
We obtain the following equations: ac=ad=1/2, bc=bd=0
Since c,d=0, therefore b=0.
Since c=d, we obtain a=1/2,b=0,c=d=1 (Case 1),
or a=1,b=0,c=d=1/2 (Case 2).
ก็ลองแทนเข้าไป แต่ก็ต้องเช็คด้วยว่า each qubit must be a unit vector → Case 2
Example: Factorize 21(∣00⟩+∣11⟩)
Factorization of two qubits means (a∣0⟩+b∣1⟩)⊗(c∣0⟩+d∣1⟩)=ac∣00⟩+ad∣01⟩+bc∣10⟩+bd∣11⟩
We obtain: ac=bd=1/2, ad=bc=0
Since a,b,c,d=0, there are no ways to allow ad=bc=0.
Therefore, there are no solutions for these equations. This multi-qubit state cannot be factorized any further.
Example อันนี้ทำให้ปวดหัวไปอีก เราไม่สามารถ separate them ได้ it’s impossible to factorize this superposition, it’s entangle
Analogy
This second example is the famous Bell state — a maximally entangled pair. No matter how you try to split it into "qubit 1's own state" times "qubit 2's own state," it won't factor, because knowing one qubit's outcome instantly tells you the other's — they're not independent the way separate coin flips are.
Factorization Formulae
Common prefix ∣w⟩: k=1∑Nak∣wsk⟩=∣w⟩⊗(k=1∑Nak∣sk⟩)
Common suffix ∣w⟩: k=1∑Nak∣skw⟩=(k=1∑Nak∣sk⟩)⊗∣w⟩
Bit-flipped prefixes ∣w⟩ and ∣wˉ⟩: k=1∑Nak(b∣wsk⟩+c∣wˉsk⟩)=(b∣w⟩+c∣wˉ⟩)⊗(k=1∑Nak∣sk⟩)k=1∑Nak(b∣skw⟩+c∣skwˉ⟩)=(k=1∑Nak∣sk⟩)⊗(b∣w⟩+c∣wˉ⟩)
Exercise 2.5: Tensor Product and Factorization
Compute the following tensor products. Compare each of them against a lattice.
∣0⟩⊗∣1⟩
2∣0⟩+∣1⟩⊗2∣0⟩−∣1⟩
2∣00⟩+∣11⟩⊗2∣0⟩−∣1⟩
2∣00⟩+∣11⟩⊗2∣01⟩+∣10⟩
∣0⟩⊗2∣0⟩+∣1⟩⊗∣1⟩
2∣0⟩+∣1⟩⊗2∣0⟩−∣1⟩⊗2∣0⟩+∣1⟩
2∣0⟩+∣1⟩⊗2∣01⟩+∣10⟩⊗2∣0⟩−∣1⟩
3∣00⟩+∣01⟩+∣10⟩⊗3∣01⟩+∣10⟩+∣11⟩
Factorize the following multi-qubit states into as many tensor products as possible:
Entanglement: the phenomenon where the quantum state of each particle in a group cannot be described independently of the others.
If a multi-qubit state is factorizable, it can be decomposed into separate qubits.
However, if it is unfactorizable, we say it is an entangled state.
Properties:
Measuring one particle in a group will destroy the superposition, causing all of them to reveal their pure states.
Entangled state can be used for secure data sharing, where each particle carries shared secret information.
Figure 4: Entangled states are created with the SPDC process (spontaneous parametric down-conversion) using Beta-Barium Borate (BBO) crystals. In 2024, it takes 106 photon pumps to create 1 pair of entangled particles. Quantum entanglement is such an expensive resource!
P.Arm บอกว่าใน Physics 1 ใน 1,000,000 or something, มีโอกาสที่ photon จะ slice in half แล้วมันจะมี spin เหมือนกัน ถ้าเราไปวัดมันก็จะ collapse เป็นค่าเดียวกัน up or down
Categories of Quantum Entanglement
Category 1: Bell state (four maximally-entangled 2-qubit states, shown corrected above) ∣Φ+⟩=2∣00⟩+∣11⟩∣Φ−⟩=2∣00⟩−∣11⟩∣Ψ+⟩=2∣01⟩+∣10⟩∣Ψ−⟩=2∣01⟩−∣10⟩
We refer to each qubit of the entangled state with letters A, B, C, …
For example, ∣ΦA+⟩ and ∣ΦB+⟩ are either (0,0) or (1,1).
where onehot(k) is the one-hot vector at position k
Quantum Robustness
Every time when we talk about entanglement, it comes with quantum mechanical phenomenon called “Decoherence” - particle loses its properties because of the environment (เช่น 10 ล้อขับผ่าน ตึกสั่น ทำให้มัน flip ไปอีก state? อาจจะ collapse)
It means that quantum state start to lose its superposition
We can represent this using Projection Matrix (meaning that you map a multi-qubit state into a lower dimension one)
Repetition ∣b⟩⊗N is more prone to quantum decoherence than ∣onehot(k)⟩.
One corrupted qubit (projected to either ∣0⟩ or ∣1⟩) makes the remaining qubits disentangled.
Example: Corruption on the third bit to ∣0⟩ of the 3-qubit states is the projector:
P=∣00⟩⟨000∣+∣01⟩⟨010∣+∣10⟩⟨100∣+∣11⟩⟨110∣
Note that all multi-qubits ending with ∣1⟩ are eliminated.
Instructor's annotation
P3@3, glossing the notation as PN@k = "corrupted at [bit k]", "total qubits [N]" — matching the PN@k notation used later in Exercise 2.6.
"Projector matrix can be non-square!"
Case 1: We have a 3-qubit GHZ state ∣GHZ3⟩=21(∣000⟩+∣111⟩)
The superposition collapses to the subspace whose third qubit is ∣0⟩:
P∣GHZ3⟩=P(21∣000⟩+∣111⟩)=∣00⟩=∣0⟩⊗∣0⟩
The result is not an entangled state — GHZ state is fragile and intolerant to corrupted qubits.
Case 2: We have a 3-qubit W-state ∣W3⟩=31(∣100⟩+∣010⟩+∣001⟩)
The superposition collapses to the subspace whose third qubit is ∣0⟩:
The result is still an entangled state — W-state is more robust and tolerant to corrupted qubits.
Analogy
A GHZ state is like a house of cards — pull out one card (corrupt one qubit) and the whole structure collapses into something trivially separable. A W-state is more like a rope made of several strands — cut one strand and the rest still hold together as a genuine entangled bundle.
Comparison of Quantum Entanglement (Table 1)
Bell State
GHZ State
W-State
Qubit counts
2
3 or more
3 or more
Robustness
Robust
Fragile
Moderate
Creation complexity
Simple
Moderate
Hard
Error tolerance
High
Low
High
Applications
Fundamental experiments
Distributed quantum computing
Distributed quantum computing
Exercise 2.6: Entanglement
Compute the projector matrix P4@2 for corruption on the second bit to ∣1⟩ of the 4-qubit states.
Compute a 4-qubit GHZ state ∣GHZ4⟩, and show that P4@2∣GHZ4⟩ is not an entangled state anymore.
Compute a 4-qubit W-state ∣W4⟩, and show that P4@2∣W4⟩ is still entangled.
Compute the projector matrix PN@1 for corruption on the first bit to ∣1⟩ of the N-qubit states.
Show that ∣GHZN⟩ is more fragile than ∣WN⟩ using the projector matrix PN@1.
Suppose we have invented a new entangled state:
∣QN⟩=2∣0⟩⊗N⊗∣1⟩⊗N+∣1⟩⊗N⊗∣0⟩⊗N
Show that ∣QN⟩ is still as fragile as ∣GHZ2N⟩ using the projector matrix.
Explain why it is hard to create an entangled state with the SPDC process.
6. Multi-Qubit Quantum Operators
Multi-Qubit Operators
Quantum operator: is a unitary matrix
U=k=1∑K∣ϕk⟩⟨ψk∣(don’t forget the input adjoint)
where each (ψk,ϕk) is a pair of input and output states, single- or multi-qubit.
That means U is always a square matrix (unlike projectors, which can also be non-square).
Due to frugality reasons, multi-qubit quantum operators partially manipulate the input state to return the output.
Example: Let's construct a quantum operator that flips the second qubit if the first qubit is ∣1⟩, i.e.
Example: Let's construct a quantum operator that swaps both input qubits:
∣00⟩↦∣00⟩∣01⟩↦∣10⟩∣10⟩↦∣01⟩∣11⟩↦∣11⟩
Our quantum operator becomes SWAP:
SWAP=∣00⟩⟨00∣+∣10⟩⟨01∣+∣01⟩⟨10∣+∣11⟩⟨11∣
SWAP=1000001001000001
Analogy
CNOT is a "conditional coin flip": it only flips the second qubit if the first qubit says "go." SWAP is literally just trading the values of two qubits, like swapping the contents of two variables in code.
Exercise 2.7: Multi-Qubit Operators
Compute multi-qubit operators from the following state mappings:
∣00⟩↦∣01⟩, ∣01⟩↦∣00⟩, ∣10⟩↦∣10⟩, and ∣11⟩↦∣11⟩
∣00⟩↦∣01⟩, ∣01⟩↦∣00⟩, ∣10⟩↦i∣11⟩, and ∣11⟩↦i∣10⟩
∣00⟩↦∣00⟩, ∣01⟩↦∣01⟩, ∣10⟩↦2∣10⟩+∣11⟩, and ∣11⟩↦2∣10⟩−∣11⟩
2∣00⟩+∣01⟩↦∣00⟩, 2∣00⟩−∣01⟩↦∣01⟩, ∣10⟩↦∣10⟩, and ∣11⟩↦∣11⟩
cis4π∣00⟩↦∣01⟩, cis(−4π)∣01⟩↦∣00⟩, ∣10⟩↦∣10⟩, and ∣11⟩↦∣11⟩
Answer the following questions:
Design a quantum operator whose state mapping is ∣0x⟩↦∣0x⟩ and ∣1x⟩↦∣1xˉ⟩, where xˉ denotes the bit-flipping of x. #Important
Design a quantum operator that imitates the NAND gate, whose state mapping is ∣xy⟩↦∣x∧y⟩⊗∣y⟩. #Important (CCNOT)
Might appear on #MidtermExam na
Design a quantum operator that bit-flips the third qubit only if the first and second qubits are ∣1⟩, or preserves the third qubit otherwise. (This is the Toffoli gate.) #Important
Design a quantum operator whose state mapping is ∣xy⟩↦∣x∧y⟩⊗∣x∨y⟩. #Important