In this research article, a fractional optimal control problem (FOCP) is applied to a nonlinear time-fractional Schrodinger equation (NTFSE) incorporating a trapping potential. The NTFSE is an innovative mathematical advancement in the field of quantum optics, bridging fractional calculus with nonlinear quantum mechanics and addressing the intricacies of systems involving memory and nonlinearity. This exploration helps with potential technological advancements in quantum optics and related domains. Examining the FOCP within this system allows one to design quantum optical systems with enhanced performance, improved precision stability, and robustness against disturbances. In this work, the performance index for the problem is constructed, and then it is reformulated using the fractional variational principle and the Lagrange multiplier method. Additionally, the Jacobi collocation numerical method is employed to solve the FOCP and numerical simulations are demonstrated across various parameters which offer valuable insights into the implemented methodology.