To begin the optimization, the algorithm was initialized with 10 Pd/PdH 0.12 nanodisk arrays of random locations of parameters in their own spaces, which then were sent to the Lumerical FDTD platform, where the transmission was numerically evaluated. After that, FDTD sent the computed optical values back to the algorithm where the FoM was calculated, and produced the parameters for the next generation. The full technical description of the PSO used here is provided in the Supplementary Information.