Optical XOR logic gate design in two dimensional photonic crystal using ANN and PSO | Synapse