I.1: Stuck on question I.1

Hi, I’m just starting to be interested in quantum computing. I got stuck on the first question. Why is my code not working? Thanks!

##################
# YOUR CODE HERE #
##################
z=abs(alpha)
x=abs(beta)

a = alpha/z
b = beta/x

# CREATE A VECTOR [a', b'] BASED ON alpha AND beta SUCH THAT |a'|^2 + |b'|^2 = 1
vector= np.array([a,b])
return vector
# RETURN A VECTOR

I figured it out. I was normalizing each complex number on its own. I’m forgetting some of my linear algebra and that I have to normalize the vector of complex numbers.

Well done @Jack1!
The codercises in the Codebook will help you learn (or remember) important concepts such as this one.
Keep enjoying the Codebook! :smiley: