instead an integral over canonical phase space, and the size of microstates in phase space can be chosen somewhat arbitrarily. Quantum mechanical A statistical ensemble in quantum mechanics is represented by a density matrix, denoted by . In basis-free notation, the canonical ensemble is the density matrix where is the system's total energy operator (Hamiltonian), and is the matrix exponential operator. The free energy is determined by the probability normalization condition that the density matrix has a trace of one, : The canonical ensemble can alternatively be written in a simple form using bra–ket notation, if the system's energy eigenstates and energy eigenvalues are known. Given a complete basis of energy eigenstates , indexed by , the canonical ensemble is: where the are the energy eigenvalues determined by . In other words, a set of microstates in quantum mechanics is given by a complete set of stationary states. The density matrix is diagonal in this basis, with the diagonal entries each directly giving a probability. Classical mechanical In classical mechanics, a statistical ensemble is instead represented by a joint probability density function in the system's phase space, , where the and are the canonical coordinates (generalized momenta and generalized coordinates) of the system's internal degrees of freedom. In a system of particles, the number of degrees of freedom depends on the number of particles in a way that depends on the physical situation. For a three-dimensional gas of monoatoms (not molecules), . In diatomic gases there will also be rotational and vibrational degrees of freedom. The probability density function for the canonical ensemble is: where is the energy of the system, a function of the phase , is an arbitrary but predetermined constant with the units of , setting the extent of one microstate and providing correct dimensions to . is an overcounting correction factor, often used for particle systems where identical particles are able to change place with each other. provides a normalizing factor and is also the characteristic state function, the free energy. Again, the value of is determined by demanding that is a normalized probability density function: This integral is taken over the entire phase space. In other words, a microstate in classical mechanics is a phase space region, and this region has volume . This means that each microstate spans a range of energy, however this range can be made arbitrarily narrow by choosing to be