Coherence and entanglement in a two-qubit system