Logic for Compound Quantum Systems