Suppose I have a register(qs) of 3 qubits (first 2 being used solely for control, the last one is the input) . The first two control qubits are in the |+>
state and the state of the 3rd input is unknown. Let it be a|0> + b|1>
.
Now I apply CCNOT(qs[0],qs[1],qs[2]) so their combined state becomes 0.5(a,b,a,b,a,b,b,a)
in Transposed matrix form [Please correct if I'm wrong here] . Now I apply S-gate to the 3rd qubit which transforms |1> -> i|1>
.
I am unable to guess the state of the combined state of 'qs' now.
What I thought:
- One logic is to multiply every state by 'i' if it has the form
|XY1>
so the combined state becomes0.5(a,ib,a,ib,a,ib,b,ia) [Transposed]
- Another logic is to find tensor product of
(I x I x S)
since I'm not changing the first 2 qubits. Performing this yields a different result which is0.5(a,b,a,b,ia,ib,ib,ia) [Transposed]
[Again, correct me if I'm wrong].
Which is the correct output after passing through S-gate (if any) ?