In quantum mechanics, a density matrix (or density operator) is a matrix that describes an ensemble of physical systems as quantum states (even if the ensemble contains only one system). It allows for the calculation of the probabilities of the outcomes of any measurements performed upon the systems of the ensemble using the Born rule. It is a generalization of the more usual state vectors or wavefunctions : while those can only represent pure states, density matrices can also represent mixed ensembles (sometimes ambiguously called mixed states). Mixed ensembles arise in quantum mechanics in two different situations: