  Successful implementations of quantum technologies require protocols and
algorithms that use as few quantum resources as possible. Many applications
require a desired quantum operation, such as rotation gates in quantum
computing or broadband pulses in NMR or MRI applications, that is not feasible
to directly implement or would require longer coherence times than achievable.
This work develops an approach that enables -- at the cost of a modestly
increased measurement repetition rate -- the exact implementation of such
operations. One proceeds by first building a library of a large number of
different approximations to the desired gate operation; by randomly selecting
these operations according to a pre-optimised probability distribution, one can
on average implement the desired operation with a rigorously controllable
approximation error. The approach relies on sophisticated tools from convex
optimisation to efficiently find optimal probability distributions. A diverse
spectrum of applications are demonstrated as (a) exactly synthesising rotations
in fault-tolerant quantum computers using only short T-depth circuits and (b)
synthesising broadband and band-selective pulses of superior performance in
quantum optimal control with (c) further applications in NMR or MRI. The
approach is very general and a broad spectrum of practical applications in
quantum technologies are explicitly demonstrated.
