Amplitude Encoding

I want use qml.AmplitudeEmbedding to encode my data. And I know that the sum of squares of all inputs needs to be equal to 1. But when I use [1+0j, 0+1j, 1+0j, 0+0j] as the input, why I still set the normalize=True? I think 1^{2} + j^{2}+ 1^{2} + 0^{2}=1. Is there anything wrong? Any help would be greatly appreciated.

Hi @cheng!

You’re forgetting that you need to take the norm of each of the numbers in your vector. It’s the sum of the squares of the norms of each value that must be equal to one.

Since | j | = 1 then | j |^2 = 1 so
| 1 |^2+| j |^2+| 1 |^2+| 0 |^2 = 1+1+1=3

This is why you need to set normalize=True