10

In Qiskit's extension package we have the UnitaryGate module that you can initialize using a unitary matrix and then add it to your circuit. How efficiently is this decomposition done under the hood?

Also, if I wanted to do the decomposition myself, what's the best way of doing so?

glS
  • 27,510
  • 7
  • 37
  • 125
Dani007
  • 595
  • 2
  • 12

1 Answers1

9

For 2x2 unitary, it is just a U3-gate.

For 4x4 unitary, TwoQubitBasisDecomposer is used. TwoQubitBasisDecomposer implements KAK decomposition method described in arXiv:0806.4015 by Drury and Love. This method uses optimal number of CNOT gates.

For larger unitaries, Isometry class is used. This class implements the method introduced by Iten et al. in arXiv:1501.06911. This method achieves the theoretical lower bound on the number of used CNOT gates.


Update: In Qiskit version 0.37 a new module qiskit.quantum_info.synthesis.qsd is added to apply Quantum Shannon Decomposition of arbitrary unitaries. This functionality replaces the previous isometry-based approach.

The Quantum Shannon Decomposition (arXiv:quant-ph/0406176) uses about half the CNOT gates as the isometry implementation when decomposing unitary matrices of greater than two qubits.

Egretta.Thula
  • 11,986
  • 1
  • 13
  • 34