Necessary and Sufficient Condition for Quantum Computing