Synthesis of and compilation with time-optimal multi-qubit gates