# import the drawing methods
from matplotlib.pyplot import plot, figure

# draw a figure
figure(figsize=(6,6), dpi=60)

# draw the origin
plot(0,0,'ro') # a point in red color

# draw the quantum states as points (in blue color)
plot(1,0,'bo')
plot(0,1,'bo')
plot(-1,0,'bo')
plot(0,-1,'bo')

# import the drawing methods
from matplotlib.pyplot import plot, figure

# draw a figure
figure(figsize=(6,6), dpi=80)

# include our predefined functions
%run qlatvia.py

# draw the axes
draw_axes()

# draw the origin
plot(0,0,'ro') # a point in red color

# draw these quantum states as points (in blue color)
plot(1,0,'bo') 
plot(0,1,'bo')
plot(-1,0,'bo')
plot(0,-1,'bo')

# import the drawing methods
from matplotlib.pyplot import figure, arrow

# draw a figure
figure(figsize=(6,6), dpi=80)

# include our predefined functions
%run qlatvia.py

# draw the axes
draw_axes()

# draw the quantum states as vectors (in blue color)
arrow(0,0,0.92,0,head_width=0.04, head_length=0.08, color="blue")
arrow(0,0,0,0.92,head_width=0.04, head_length=0.08, color="blue")
arrow(0,0,-0.92,0,head_width=0.04, head_length=0.08, color="blue")
arrow(0,0,0,-0.92,head_width=0.04, head_length=0.08, color="blue")

# import the drawing methods
from matplotlib.pyplot import plot, figure

# draw a figure
figure(figsize=(6,6), dpi=60) 

# draw the origin
plot(0,0,'ro') 

# draw the axes
draw_axes()
#
# your solution is here
#
# include our predefined functions
%run qlatvia.py

for i in range(100):
    quantum_state = random_quantum_state()
    x = quantum_state[0];
    y = quantum_state[1];
    plot(x,y,'bo') 

# import the drawing methods
from matplotlib.pyplot import plot, figure, arrow

# draw a figure
figure(figsize=(6,6), dpi=60) 

# include our predefined functions
%run qlatvia.py

# draw the axes
draw_axes()

# draw the origin
plot(0,0,'ro') 

#
# your solution is here
#
for i in range(100):
    quantum_state = random_quantum_state()
    x = quantum_state[0];
    y = quantum_state[1];
    arrow(0,0,x,y,head_width=0.04,head_length=0.08,color="red")


# import the drawing methods
from matplotlib.pyplot import figure

figure(figsize=(6,6), dpi=80) # size of the figure

# include our predefined functions
%run qlatvia.py

# draw axes
draw_axes()

# draw the unit circle
draw_unit_circle()

# import the drawing methods
from matplotlib.pyplot import figure, text

figure(figsize=(6,6), dpi=80) # size of the figure

# include our predefined functions
%run qlatvia.py

# draw axes
draw_axes()

# randomly determine the points
from random import randrange
for i in range(5):
    x = randrange(-100,101)/100
    y = randrange(-100,101)/100
    string = str(i+1)+". point at ("+str(x)+","+str(y)+")"
    print(string)
    text(x,y,string)

# %%writefile FILENAME.py
# import the drawing methods
from matplotlib.pyplot import figure, arrow, text

def display_quantum_state(x,y,name):
    # draw axes
    draw_axes()

    # draw the unit circle
    draw_unit_circle()
    
    # get the random quantum state
    quantum_state = random_quantum_state()
    x = quantum_state[0];
    y = quantum_state[1];
    arrow(0,0,x * 0.90,y * 0.90,head_width=0.04,head_length=0.1,color="red")
    
    # display the name out of unit circle
    text(x + 0.1,y + 0.1,name,fontsize=15)
    

#
# test your function
#

# import the drawing methods
from matplotlib.pyplot import figure

figure(figsize=(6,6), dpi=80) # size of the figure

# include our predefined functions
%run qlatvia.py

# draw axes
draw_axes()

# draw the unit circle
draw_unit_circle()

for i in range(6):
    s = random_quantum_state()
    display_quantum_state(s[0],s[1],"v"+str(i))