There is a quantum circuit with several Controlled NOT and Controlled swap gates, with two 2-qubit input registers X,Y and two 2-qubit output registers X',Y' where we have to find the mapping of the circuit and what operations it performs.

  • $\begingroup$ Hi and welcome to Quantum computing SE. Could you please add more details, e.g. a circuit picture? Thank you. $\endgroup$ Commented Apr 12, 2020 at 16:07
  • $\begingroup$ I didnt want to directly ask the question as the guidelines dont allow me but you asked so i have edited the ques and posted a picture of the ques. You dont need to answer the whole ques just give me an explanation because i am totally new to this and just started. $\endgroup$ Commented Apr 13, 2020 at 17:25
  • $\begingroup$ @ArpitSingh Why edit the question to make it less informative? $\endgroup$
    – Rammus
    Commented Mar 18, 2021 at 19:19

1 Answer 1


You only have 4 qubits, so the "full operator" is only at most a 16x16 matrix that combines all 7 of those multi-qubit gates. You can derive this "full operator" in MATLAB quite easily by using the "kron" function to build up the multi-qubit gates from 1-qubit and 2-qubit gates (2x2 and 4x4 matrices respectively), and then doing matrix multiplication.

As for the second question: "what operation does this circuit implement", this will become easier to answer once you figure out the 16x16 matrix see what it does to the four input qubits.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.