HW 4 - Multi-Qubit Systems

3.3, 5.10, 5.11, 5.12, 5.15 from Kasirajan
and the other document.

Kasirajan

3.3

Question

Consider a system of 4 qubits (spin-12 states). How many states are exhibited by the system?

Proof
Since there are 4 qubits, each with a possible | or |, which we relabel to the corresponding |0,|1 states. As such, this question is just asking how many different numbers are represented by 4 bits, which is 24=16 total states of the system. This is assuming that no entanglement from our QC occurs, but we can assume that's not the case since this is independents of the QC.

5.10

Question

Verify whether the circuits shown in the following figure are equivalent:

Pasted image 20240506131234.png

Proof
Consider arbitrary inputs given |ψ=|q0q1. Since we have 2 qubits, we have 4 possible quantum states |00,|01,|10,|11 where ψ is a superposition of these:

|ψ=a|00+b|01+c|10+d|11=[abcd]

Apply each QC to this state to see what happens.

(a):

|ψH=12[1111][ab]=12[a+bab]

And similarly:

|ψH2=12[c+dcd]

Thus applying CNOT:

|ψCNOT=[1000010000010010]12[a+babc+dcd]=12[a+babcdc+d]

Then applying the last H gate to just the top two rows:

|ψFin,a=[ab12(cd)12(c+d)]

(b):

|ψCNOT=[1000010000010010][abcd]=[abdc]|ψFin,b=[ab12(d+c)12(dc)]

Notice that, in general, |ψFin,a|ψFin,b so these QC's are not equal. This is best shown doing the computation where the input is |ψ=|10, as then |ψFin,a=12(|10+|11) while |ψFin,b=12(|10|11) which are different states (not even by some relative phase).

5.11

Question

What is the output of the quantum circuit shown in the following figure? Assume all qubits are initialized to the default state |0. Calculate the circuits's width and depth. Evaluate the circuit for other combinations of inputs and produce a truth table.

Pasted image 20240506133022.png

Proof
Notice that since our initial input states are all in |0, then we start in the |00000 state. As such:

Q=CCNOT1CCNOT2CCNOT3CCNOT4

Let's consider each gate c2Xi operating on our starting arbitrary input state:

|ψin=q0|00000+q1|00001++q31|11111

for each part of Q. Notice that we can write:

|ψ=i=0251qi|base2(i)

We write all our steps in a table:

Step (CNOT Gate #) cXij bits States that change and corresponding maps Effect on qi's
1 Control: 2, 3
Target: 4
|XX110|XX111
q6q7
q14q15
q22q23
q30q31
2 Control: 0, 1
Target: 3
|11X0X|11X1X q24q26
q25q27
q28q30
q29q31
3 Control: 2, 3
Target: 4
|XX110|XX111
q6q7
q14q15
q22q23
q30q31
4 Control: 0, 1
Target: 3
|11X0X|11X1X q24q26
q25q27
q28q30
q29q31
We can itemize all our entries and see what swapped with what:
[q0q6q7q14q15q22q23q24q25q26q27q28q29q30q31][q0q7q6q15q14q23q22q24q25q26q27q28q29q31q30][q0q7q6q15q14q23q22q26q27q24q25q31q30q28q29][q0q6q7q14q15q22q23q26q27q24q25q31q30q29q28][q0q6q7q14q15q22q23q24q25q26q27q29q28q31q30]

All in all, this gate is equivalent to the identity except that it swaps the probabilities associated with |111XX around. Namely:

|11100|11101|11101|11100|11110|11111|11111|11110

As such, the truth table is:

Input Output
Anything Else Identity (same input)
|11100 |11101
|11101 |11100
|11110 |11111
|11111 |11110

As such, then the output state of our given circuit is |00000. We have 4 qubits, so a width of 4 and our longest path is 4 so a depth of 4 is also apparent.

5.12

Question

What is the output of the quantum circuit illustrated in the following figure? Calculate the circuit's width and depth.

Pasted image 20240508190321.png

Proof
We go step by step along the depth of the circuit:

t1:

Notice for qubit 1 after H:

H|q0=12[1111]|0=12(|0+|1)

Similarly at the same time:

X|q3=[0110]|0=|1

So our total state would be:

|ψt1=12(|0+|1)|0|0|1=12(|0001+|1001)

t2:

We do CNOT on |q0 as the control and |q1 as the target:

cX|q0,q1=cX(12(|0+|1)|0)=cX12(|00+|10)=12[1000010000010010][1010]=12[1001]=12(|00+|11)

So we have entanglement here!

We have:

|ψt2start=12(|0001+|1101)=12(|000+|110)|13

On the other qubit |q3:

H|q3=12[1111]|1=12(|0|1)

Putting them together:

|ψt2=12(|000+|110)12(|0|1)=12(|0000|0001+|1100|1101)

t3:

Replicate the same calculation done for cX|q0,q1 here, except do it for q2. As a result:

cX|q0,q2=cX0212(|0000|0001+|1100|1101)=12(|0000|0001+|1110|1111)

t4:

cX|q0,q3=cX0312(|0000|0001+|1110|1111)=12(|0000|0001+|1111|1110)

t5:

cX|q3,q0=cX3012(|0000|0001+|1111|1110)=12(|0000|1001+|0111|1110)

t6:

cX|q3,q1=cX3112(|0000|1001+|0111|1110)=12(|0000|1101+|0011|1110)

t7:

cX|q3,q2=cX3212(|0000|1101+|0011|1110)=12(|0000|1111+|0001|1110)

So our final state will be

|ψ=12(|0000|1111+|0001|1110)

Notice that we have 4 qubits so our width is 4. Furthermore, we have the longest path is traversed by q3 with a length of 4 (we can ignore the reading steps and parallelize all of them), so our depth is 4.

5.15

Question

The square root of the X-gate and it Hermitian conjugate are called the V and V gates. The matrices from the following equation define them. Develop quantum circuits to emulate them. Derive the math and establish that the circuit works.

V=12[1+i1i1i1+i],V=12[1i1+i1+i1i]

Notice that all we have to do to show that X=V is show that X=V2 which we do:

(12[1+i1i1i1+i])2=14[(1+i)2+(1i)22(1+i)(1i)2(1+i)(1i)(1i)2+(1+i)2]=14[0440]=X

Thus V is the unique square root of the X-gate (it's unique since we only deal with unitary matrices, so all matrices like X is positive). Clearly V is correctly defined as it is the complex conjugate of V.

To construct V to start, we know that U3 can span any gate, so make it out of that. Notice specifically that:

U3(θ,ϕ,λ)=[cosθ2eiλsinθ2eiϕsinθ2eiλ+iϕcosθ2]=12[1+i1i1i1+i]

So equate entries. Notice that we need:

1+i2=cosθ2

But cos will never be imaginary for θR. As such, we need to do some rotations first to get ourselves in the correct relative phase. We essentially want to multiply our number by the complex conjugate to get our real entry:

1+i21i2=12=cos(θ2)

Thus we need to apply some transformation like Rz perhaps:

1+i2=22eiπ/4

So we need to rotate π2 radians, preferably via Rz:

Rz(π2)V=[eiπ400eiπ4]12[1+i1i1i1+i]=[eiπ400eiπ4]12[2eiπ42eiπ42eiπ42eiπ4]=12[1i1i]

We still need to reduce this to the identity, as then we apply the gates backwards to get our V implementation.

We can now can use the U3 gate. Equating items that we currently have, we see that we need:

cosθ2=22θ=π2

As a result, looking at the next entry:

12=eiϕsin(θ2)=(θ=π2)eiϕ22eiϕ=1ϕ=0

Thus we can get our last parameter λ:

eiλsin(θ2)=(θ=π2,ϕ=0)eiλ22=i2eiλ=iλ=π2

Therefore, we can construct:

U3(π2,0,π2)=[12i212i2]=Rz(π2)V

Notice we can verify that this combinations of gates works by flipping their order in the way we applied them here:

V=Rz(π2)U3(π2,0,π2)V=Rz(π2)U3(π2,0,π2)12[1+i1i1i1+i]=[eiπ400eiπ4][12i212i2]=12[eiπ4eiπ4eiπ4eiπ4]=12[1+i1i1i1+i]

Showing our gates worked!

Gate Practice

image 2.jpg image 1 1.jpg