To perform the non-adiabatic QED simulation with the TSH method, one needs to obtain the molecular dipoles and their derivatives with respect to the nuclear coordinates (see Eq. 11 and Eq. 35). In this work, we use the KRR method to obtain a machine-learning expression of the analytical expression of the dipoles. We then obtain their derivatives using Eq. 52 to compute the contribution of the nuclear gradient due to the derivative of dipoles. As we know, the dipoles of the molecular system, including the permanent dipole and transition dipole, are vectors and have three components in space. Fig. presents the global Cartesian coordinate system defined in this work, which is used to determine the components of dipoles in different directions. For convenience, the optimized geometry of the cis isomer is used as the reference geometry (with the XYZ coordinates provided in the Supporting Information). As illustrated in Fig. , the X-axis is defined along the NN bond, the Y-axis is defined as the direction that is perpendicular to the molecular plane (the plane of the CNNC bond of the cis isomer), and the Z-axis is defined perpendicular to the X-and Y-axes simultaneously. Note that the field polarization direction (used in Eq. 7) is also defined in the axis depicted in Fig. . We emphasize that the global Cartesian coordinate system defined in Fig. is a reference coordinate used in the polariton dynamics process, and is different from the relative Cartesian coordinate system, which is only used in the machine learning processes, see Supporting Information for details.