Quantum lock