Friday, June 14, 2024

Swaps

 This is the qiskit swap gate:

It does indeed swap the state between these tow qubits...:



Here, we have the expanded swaps definition:

                                                                             

Interesting that only two gates do the swap. Qubit one is intitially in the |1> state.

                                                                



Here, a reversal:

                                                                               

It all depends on which quibit is in the |1> state. Below, the first gate is useless:

                                                                      

In this second cate, the last ga te is useless:

                                                                       

There is symmetry at work and, of course, one can depict the gate int he below

fashion as well:

                                                                           

All cases are covered, including |00> and |11> !!

                                                                         *     *     *


For anyone wishing to check equations by matrix multiplication:   

                                                             

                                                          

No comments: