Quantum inference of states and processes