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 paths. Here, we demonstrate a five-qubit trapped-ion quantum computer that can be programmed in software to implement arbitrary quantum algorithms by executing any sequence of universal quantum logic gates. We compile algorithms into a fully-connected set of gate operations that are native to the hardware and have a mean fidelity of 98 %. Reconfiguring these gate sequences provides the flexibility to implement a variety of algorithms without altering the hardware. As examples, we implement the Deutsch-Jozsa (DJ) and Bernstein-Vazirani (BV) algorithms with average success rates of 95 % and 90 %, respectively. We also perform a coherent quantum Fourier transform (QFT) on five trappedion qubits for phase estimation and period finding with average fidelities of 62 % and 84 %, respectively. This small quantum computer can be scaled to larger numbers of qubits within a single register, and can be further expanded by connecting several such modules through ion shuttling or photonic quantum channels.

1 aDebnath, S.1 aLinke, N., M.1 aFiggatt, C.1 aLandsman, K., A.1 aWright, K.1 aMonroe, C. uhttp://www.nature.com/nature/journal/v536/n7614/full/nature18648.html