Hi @kannan_v! Thanks for your question.
Using simulators, there are many ways to compute gradients of photonic circuits. Perhaps the most straightforward for you is to use the StrawberryFields plugin in PennyLane.
For hardware, it is more challenging to compute analytical gradients. The only results that I am aware of relate to the ability to compute gradients on hardware is the “WAW parametrization”, which is summarized in this tutorial. It’s an idea that I believe hasn’t yet been implemented on actual hardware!