A microstrip patch antenna based on a synthesized photonic bandgap (PBG) substrate is designed and analyzed by using a technique based on the combination of an evolutionary heuristic optimization algorithm with the CST Microwave Studio simulator, which is based on the finite integral technique. The initial antenna is designed by analyzing air cylinders embedded in a thick silicon substrate, which has high relative permittivity. Then, to synthesize the PBG substrate, a binary particle swarm optimization (BPSO) algorithm is implemented in MATLAB to design a two-dimensional (2D) photonic crystal on a square lattice that improves the initially designed microstrip antenna. The unit cell is divided equally into many square pixels, each of which is filled with one of two dielectric materials, silicon or air, corresponding to a binary word consisting of the binary digits 0 and 1. Finally, the performance of the initial antenna is compared with the BPSO-optimized antenna using different merit functions. The results show remarkable improvements in terms of the return loss and fractional bandwidth. Both microstrip patch antennas based on the synthesized photonic crystal substrate achieve noticeable sidelobe suppression. Furthermore, the first design, which is a dual-band antenna, shows a return loss improvement of 5.39 %, while the fractional bandwidth of the second design is increased by 128 % (bandwidth of 128 GHz), compared with the initial antenna based on the air-hole PBG substrate. Both antennas maintain a gain close to 9.17 dB. Also, the results show that the obtained antennas have resonant frequencies around 0.65 THz, as required for next-generation wireless communication technology and other interesting applications.