Result is guaranteed to consist exclusively of 1-qubit, CNOT and CCNOT
gates.
If free_qubits has at least 1 element, result has lengts
O(len(controls)).
Args
controls - control qubits.
targets - target qubits.
free_qubits - qubits which are neither controlled nor target. Can be
modified by algorithm, but will end up in their initial state.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2026-10-08 UTC."],[],[]]