Doubt in PF.2.1

I am a newbie and i have been trying to debug this
help will be appreciated

Hi @swarad! welcome to the forum
You approach is almost correct. However, notice the last part of the Codercise instructions where you are told to not assume that the state is normalized.
The argument normalize tells PennyLane whether to normalize the state vector.
Could that change in any way your code?

Thanks.