For any physical theory, to experimentally check its validity, we need to formulate an alternative theory and check whether the experimental results are consistent with the original theory or with an alternative theory. In particular, to check whether energy is preserved, it is necessary to formulate an alternative theory in which energy is not preserved. Formulating such a theory is not an easy task in quantum physics, where the usual Schroedinger equation implicitly assumes the existence of an energy (Hamiltonian) operator whose value is preserved. In this paper, we show that the only way to get a consistent quantum theory with energy non-conservation is to use Heisenberg representation in which operators representing physical quantities change in time. We prove that in this representation, energy is preserved if and only if Planck's constant remains a constant. Thus, an appropriate quantum analogue of a theory with non-preserved energy is a theory in which Planck's constant can change -- i.e., is no longer a constant, but a new field.