Quantum state control of trapped ions for computation and multi-ensemble atomic clocks