We explore the effect of the external magnetic and Aharonov–Bohm (AB) flux fields on the energy levels of Dirac particle subjects to mixed scalar and vector anharmonic oscillator field in the two-dimensional (2D) space. We calculate the exact energy eigenvalues and the corresponding un-normalized two-spinor-components wave functions in terms of the chemical potential parameter, magnetic field strength, AB flux field and magnetic quantum number by using the Nikiforov–Uvarov (NU) method.
Making an ansatz to the wave function, the exact solutions of the D-dimensional radial Schrödinger equation with some molecular potentials, such as pseudoharmonic and modified Kratzer, are obtained. Restrictions on the parameters of the given potential, δ and ν are also given, where η depends on a linear combination of the angular momentum quantum number ℓ and the spatial dimensions D and δ is a parameter in the ansatz to the wave function. On inserting D = 3, we find that the bound state eigensolutions recover their standard analytical forms in literature.