Quantum algorithms require a universal set of gates that can be implemented in a physical system. For these, an optimal decomposition into a sequence of available operations is desired. Here, we present a method to find such sequences for a small-scale ion trap quantum information processor. We further adapt the method to state preparation and quantum algorithms with in-sequence measurements.