The final stage in the fitting procedure is the optimization of torsional parameters. Torsional rotation is an important factor controlling the conformational preference of a molecule due to its association with QM stereoelectronic effects, and the parameters are therefore often a target for re-optimization. In this work, we follow a standard procedure of fitting the parameters to minimize the difference between MM and QM constrained one dimensional torsional scans. In particular, we aim to fit the four V n parameters of the OPLS FF torsion potential shown in eq 1 by automating the scheme outlined in Ref. 70 into QUBEKit with some additional considerations. The steepest descent algorithm is employed to find the torsional parameters that minimize the regularized Boltzmann weighted error function: