I have a (6 qubit) circuit which implements a unitary $U$.
I need the circuits which implement $-U, iU, -iU$.
Phase matters, because I later embed a controlled version of $\pm i U $ into a bigger circuit.
for 3 qubits, Qiskit decomposes e.g. $-i$ into
qnum = 3 unitary = -1j * np.eye(2**qnum) _qc = QuantumCircuit(qnum) _qc.unitary(unitary, [*range(qnum)], label='U1') _qc = transpile(_qc, backend=AerSimulator(), optimization_level=3, basis_gates=['cx', 'id', 'u3']) _qc.decompose().draw('mpl')
And for four qubits (qnum=4):
Both decompositions are not obvious to me.
Is it known how to find the right gates analytically?
Is this decomposition for 4 qubits really optimal?