This research examines the gravitational field in detail and derives the quantum mechanics equation under the influence of gravity. Subsequently, the Schrödinger and Dirac equations are solved by separating variables in the presence of the gravitational field. Consequently, the Rydberg equation is deduced under these conditions, providing evidence that variations in the external gravitational field intensity lead to spectral shifts. This effect can explain the partial redshift observed in quasar spectra. Moreover, it suggests the existence of distinct quantum regions within the universe. The structural characteristics of dark matter are also determined. Furthermore, by incorporating the gravitational field, energy-mass concepts, symmetry, gravity theory, and gauge theory, it is deduced that the interaction between matter and antimatter is a repulsive force referred to as "gravity." This repulsive force serves as the driving factor behind the accelerated expansion phenomenon known as dark energy in the universe. The calculated cosmological constant is found to be a small variable associated with the radial and angular directions of the universe. Additionally, the "spontaneous breaking of vacuum symmetry" is attributed to the gravitational field. Furthermore, the gravitational field leads to the non-conservation of weak action parity. The study also confirms the equal number of baryons and antibaryons, as well as energy conservation, in the universe. By introducing the gravitational field into quantum theory, this research enhances the comprehensiveness of quantum mechanics and provides a constitutional explanation for the phenomenon of dark energy. This study contributes to a better understanding of the gravitational field, vacuum, and vacuum state. Additionally, it advances astrophysical theory and gauge theory in particle physics, enabling further exploration of energy levels, fundamental particle structure, and quantum gravity theory.