I am trying to decompose a 4x4 unitary into 2 qubit circuit using U3 and CNOT gates but the circuit implementation qiskit gives me is not optimized. So I started looking at qiskit-symb and qympy to see if I can design a parameterized circuit and solve the circuit unitary parameters to get my desired unitary. I am not sure how to equate the parameterized (symbolic) unitary to the unitary I want by solving/evaluating these parameters. Any guidance would be helpful


  • $\begingroup$ Hi, welcome to QCSE. Is the unitary you want to synthesise a circuit for symbolic or numeric? Can you share the matrix and what you've attempted so far? It is known that any two qubit unitary can be implemented with at most 3 CNOT gates. See this paper -> arxiv.org/pdf/quant-ph/0308006 . $\endgroup$
    – Callum
    Commented Jun 13 at 1:03
  • $\begingroup$ In pytket you can pass a 4x4 numpy array representing your (numeric) unitary to Unitary2qBox and then decompose the box in terms of {U3, CNOT} for an optimial circuit. I can expand on this in an answer if thats helpful. $\endgroup$
    – Callum
    Commented Jun 13 at 1:15
  • $\begingroup$ Hi and welcome to Quantum Computing SE. Please provide more detail, for example a circuit you are trying to decompose and used Qiskit code. $\endgroup$ Commented Jun 13 at 6:06
  • $\begingroup$ @Callum, Hey, thanks for the pytket reference, I will check it out. Yes, I am actually looking for something like 'Unitary2qBox'. I found a similar method in Qiskit called 'transpile' that acts on a given unitary to spit out a circuit. But the circuit I'm getting is not optimal. So I am will check out your suggestion. $\endgroup$
    – AishM
    Commented Jul 1 at 2:54


Your Answer

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