Reading Week 4 - Multiqubit Gates, Quantum Entanglement

2.11: Tensors (for me)

The Tensor Product or the Kronecker product, or the direct product is defined as follows. A new set of basis vectors nm is defined by the tensor product ij of the basis vectors. The space is bilinear, so linear in both V,W:

|V|W=i=1nvi|ij=1mwj|j=i=1nj=1mviwj(|i|j)

View this as a space |V|W with basis vectors |i|j whose coefficients are viwj:

|V|W=(v1,...,vn)(w1,...,wn)=[v1w1v1wmv2w1v2wmvnwm]

As an example, if |V=(1,2) and |W=(3,4,5) (as column vectors) then:

|V|W=[131415232425]=[3456810]

For a tensor product of 2x2 matrices, we just repeat entries into submatrices:

[a11a12a21a22][b11b12b21b22]=[a11[b11b12b21b22]a12[b11b12b21b22]a21[b11b12b21b22]a22[b11b12b21b22]]=[a11b11a11b12a12b11a12b12a11b21a11b22a12b21a12b22a21b11a21b12a22b11a22b12a21b21a21b22a22b21a22b22]
Exercise

Notice:

a|b|)(|c|d=?

if |i=(i1,...,in) for each i=a,b,c,d then:

|c|d=|cd=(c1d1,c1d2,...,c1dn,c2d1,...,cndn)

while:

a|b|=ab|=(a1b1,a1b2,...,a1bn,a2b1,...,anbn)

Thus:

Our equation=ab|cd=i=1nj=1naibjcidj=i=1naicij=1nbjdj=a|cb|d

5.4 (cont.) Multiqubit States (no Gates)

To catch up see Reading Week 3 - Ending Quantum Superposition, Starting Qubits#5.4 Quantum Gates

5.4.4: Multiqubit Gates

We'll learn how to represent a system of two or more qubits and the gate operations which are performed on two or more qubits.

5.4.5: Representing a Multi Qubit State

A system of n-qubits has 2n orthonormal computational basis states, denoted |x1...xn where xi0,1. The state is a superposition of all 2n states with probability amplitudes ax:

|ψ=x{0,1}nax|x

where we require:

x{0,1}n|ax|2=1

Recollect the tensor math from Reading Week 4 - Multiqubit Gates, Quantum Entanglement#2.11 Tensors (for me). Assume |ψ1=a1|0+b1|1 and |ψ2=a2|0+b2|1. Then:

|ψ=|ψ1|ψ2=a1a2|00+a1b2|01+b1a2|10+b1b2|11

We require that ψ|ψ=1 (orthonroamality) so then:

i=1n=2j=1n=2|aibj|2=1

We use the |ij notation to combine our tensor product vector |i|j=|ij. As a result:

|00=[1000],|01=[0100],...

Sometimes, to save space, we contract the and just put the ket's or the bra's together:

|0|0=|0|0=|00

As with a single qubit, the probability of measuring a single eigenvalue is via:

Pizz=|λi|ψ|2

where here z indicates the direction of measurement and λi is one of the possible eigenvalues.

The probability of measuring a 0 in the first qubit is:

p1(0)=P(00)+P(01)=|a1a2|2+|a1b2|2

A partial measurement of the system results in a new superposition state. We calculate the state by removing terms which are no longer applicable, and we must normalize the new superposition state since the sum of probabilities may not be 1:

|ψ=a1a2|00+a1b2|01|a1a2|2+|a1b2|2

similarly for measuring 1 in the first qubit:

p1(1)=P(10)+P(11)=|b1a2|2+|b1a2|2|ψ=b1a2|10+b1b2|11|b1a2|2+|b1b2|2

5.6: Quantum Entanglement

In the last section, we looked at a quantum system with 2n dimensions, where n is the number of qubits we have. There is no correlation between qubits. If we somehow find a correlation between qubits and can describe the system as a single system, then the qubits are entangled.

Consider the following QC:

Pasted image 20240501202136.png

We have two qubits in the default |0 state (per usual). We apply an H Gate (see Reading Week 3 - Ending Quantum Superposition, Starting Qubits#5.4.1.3 The Hadamard Gate, H-Gate) to q[0] and perform a CNOT (see later section on multi-qubit systems) gate with target q[1] and q[0] being the control bit. We then measure q[0],q[1] at the and put on the classical wire.

Step 1: Apply H Gate
H|00=12[11]=12(|0+|1)

apply this in a tensor product to bring back to a 2 qubit system:

12[11][10]=12([1000]+[0010])=12(|00+|10)
Step 2: Apply CNOT
[1000010000010010]12([1000]+[0010])=12[1001]=12(|00+|11)=|ϕ+

Note that we cannot "factor" out the |0 or anything from |ϕ+, namely we cannot express it in terms of terms q[0] and q[1]. This resultant state is an entangled state and the qubits are said to be maximally entangled. The entangled qubits are the EPR Pair.

Here |Φ+ is one of the Bell States.

|0012(|00+|11)=|ϕ+|0112(|00|11)=|ϕ+|1012(|01+|10)=|Ψ+|1112(|01+|10)=|Ψ

Some example code to see entanglement:

q = QuantumRegister(2, 'q')
c = ClassicalRegister(2, 'c')
qc = QuantumCircuit(q, c)
qc.h(q[0])
qc.cx(q[0], q[1])
qc.measure(q[0], c[0])
qc.measure(q[1], c[1])

Pasted image 20240501225133.png

Lecture Slides: Multiple Qubit Systems

![[Physics CPE 345 Quantum Computing Lecture slides Week 4 Multi qubit systems 240424 2-1.pdf#page=1]]

Lecture Slides: Systems of Multiple Qubits

![[Physics CPE 345 Quantum Computing Lecture slides Week 4 Multi qubit systems 240501.pdf#page=13]]

Ch 5.4: (cont.) Multi-qubit Gates

We continue our discussion from before.

5.4.6: Controlled U Gates

The general form of a controlled-U gate (where U is the unitary matrix pertaining to the gate operation) is given by:

C(U)=[1000010000u00u0100u10u11]

where the unitary matrix U=[u00u01u10u11] is one of our Pauli Matrices.

We get the mapping:

|00|00|01|01|10|1U|0|11|1U|1

Notice the LHS qubit is the control bit, and the RHS qubit is the target qubit.

5.4.6.1 The Controlled NOT (CNOT) or cX Gate

Operates on two qubits. The first qubit serves as the control bit. The second is the target, and inverts whatever that state is:

CNOT=cX=[1000010000010010]|q0,q1|q0,q0q1

where here refers to the XOR operation (not to be confused with the tensor product).

Pasted image 20240501204204.png

5.4.6.2: cY and cZ (CPHASE) Gates

These operate similar to the cX gate.

cY=[10000100000i00i0],cZ=[1000010000100001]

Pasted image 20240501204332.png
Here the cZ gate is sometimes referred as the CPHASE gate.

5.4.6.3: Controlled Hadamard Gate

It's the same idea, except replace the bottom right of the matrix with Reading Week 3 - Ending Quantum Superposition, Starting Qubits#5.4.1.3 The Hadamard Gate, H-Gate:

|10|1H|0,...

Pasted image 20240501204511.png

5.4.6.4: Controlled RZ-Gate or the cRz Gate

Same idea, except use the Reading Week 3 - Ending Quantum Superposition, Starting Qubits#5.4.2.3 RZ-Gate.

Pasted image 20240501204559.png
Pasted image 20240501204604.png

5.4.6.5: Controlled U3-Gate or the cU3 gat

Same idea but applies a U3 gate. Use Reading Week 3 - Ending Quantum Superposition, Starting Qubits#5.4.3.1 U3 Gate.

Pasted image 20240501222121.png

5.4.6.6: Controlled U1-Gate or the cU1 Gate

Reading Week 3 - Ending Quantum Superposition, Starting Qubits#5.4.3.2 U2 Gate.

Pasted image 20240501222243.png

5.4.7: Extended Gates

5.4.7.1: The Toffoli or CCNOT Gate or the ccX Gate

|q0,q1,q2|q0,q1,q2(q0q1)

here is XOR and is the AND operation.

Pasted image 20240501222605.png

Pasted image 20240501222612.png

Pasted image 20240501222620.png

5.4.7.2: The Fredkin or the CSWAP or the cS Gate

CSWAP|0,q1,q2|0,q1,q2CSWAP|1,q1,q2|1,q2,q1

Pasted image 20240501222742.png

Pasted image 20240501222751.png

5.4.7.3: The Deutsch Gate D(θ)

Pasted image 20240501222947.png