Guilin Sun
Ansys Employee

Yes, when x dimension is infinite and if it has no isolated nano objects you should use periodic BCs;

Finite sized y diraction should use PML.

For 2D simulation, you can set the source polarization angle 90 to excite Ez.

I would strongly suggest you to watch some videos:

to get more information.