TransWikia.com

IBM quantum circuit - order of tensor product for equivalent matrix

Quantum Computing Asked by logicOnAbstractions on July 4, 2021

I’m trying to understand how to apply tensor products on 3-qubit systems (or well at least 2 qubits). Let’s take a basic example:

enter image description here

where $$lvert psi rangle = lvert q_2q_1q_0rangle $$ with $q_2$ being the most significant bit and $q_0$ the least significant (matching the above schematic for the circuit).

H matrix (for a single qubit): $$H = frac{1}{sqrt{2}}begin{bmatrix}
1 & 1
1 & -1
end{bmatrix} $$

I understand that I need to use the identity matrix and tensor product in order to format the Hadamard matrix (and any other in the circuit) to be applied to 3 qubits. What I do not understand is how, generally, I determine the order of the tensor product? In order words, with the above description, should I do:

$$M=(Hotimes I)otimes I =
frac{1}{sqrt{2}}
begin{bmatrix}
I & 0 & I & 0
0 & I & 0 & I
I & 0 & -I & 0
0 & I & 0 & -I
end{bmatrix}$$

or

$$M=(Iotimes I)otimes H =
begin{bmatrix}
H & 0 & 0 & 0
0 & H & 0 & 0
0 & 0 & H & 0
0 & 0 & 0 & H
end{bmatrix}$$

More generally, how should I think about why the correct one is the right one? What is the logic I need to understand with regards to the "extension" of my gate’s matrices and in which order I need to apply the Identity matrices in the tensor product?

One Answer

Borrowing from Lenny's Paperback, you can value a product state as follows: begin{eqnarray} |psi_1rangle &=& a|0rangle + b|1rangle |psi_1rangle &=& c|0rangle + d|1rangle |psi_3rangle &=& |psi_1rangle otimes ,|psi_2rangle |psi_3rangle &=& ( a|0rangle + b|1rangle) otimes ( c|0rangle + d|1rangle) |psi_3rangle &=& ac |0rangle otimes |0rangle + ad |0rangle otimes |1rangle + bc |1rangle otimes |0rangle + bd|1rangle otimes |1rangle end{eqnarray}

Using this logic into the operators:

begin{eqnarray} O &=& H otimes I otimes I |psirangle &=& |q_1rangle otimes |q_2rangle otimes|q_3rangle O|psirangle &=& Big (H otimes I otimes I Big) |q_1rangle otimes |q_2rangle otimes|q_3rangle O|psirangle &=& (H|q_1rangle)otimes ( I|q_2rangle ) otimes ( I|q_3rangle ) end{eqnarray}

And if you want the other operator: begin{eqnarray} O' &=& I otimes I otimes H |psirangle &=& |q_1rangle otimes |q_2rangle otimes|q_3rangle O|psirangle &=& Big (I otimes I otimes H Big) |q_1rangle otimes |q_2rangle otimes|q_3rangle O|psirangle &=& (I |q_1rangle)otimes ( I|q_2rangle ) otimes ( H|q_3rangle ) end{eqnarray}


Answered by Enrique Segura on July 4, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP