Given an N x N unitary operator M, I would like to build a circuit that does the same operation as M by explicitly inputting the gates myself (let's say into the IBMQ composer). I heard that 2-qubit operators could be decomposed using a Qiskit built-in function, however I was wondering if such a thing existed for a general case.
More concretely, given a N x N unitary operator M, I would like to decompose it to something of the form
M_1 x M_2 x M_3 x ... x M_n
where "x" represents the tensor product and M_i is either a 2- or 1-qubit unitary operator. Is there a way to do this programatically, or can it be done by hand on paper in an algorithmic way?
Thank you in advance!