Abstract .Quantum computers can solve certain problems more efficiently than any possible conventional computer. Small quantum algorithms have been demonstrated on multiple quantum computing platforms, many specifically tailored in hardware to implement a particular algorithm or execute a limited number of computational paths1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10. Here we demonstrate a five-qubit trapped-ion quantum computer that can be programmed in software to im...