Duality between partial coherence and partial entanglement