Lecture 12.

Today we finished Deutsch-Josza (Money or Tiger).

The notebook we developed is available here.

Here are four more problems from the Linear Algebra section from The Highlights Quiz:


**Question 8.** Calculate the complex conjugate of $M = \begin{pmatrix} 1 & e^{-i\frac{\pi}{5}} \\ 3 - i & 10 \end{pmatrix}$

This is example 2.16 on page 48 of Martin LaForest's booklet.

--

# in WolframAlpha just type:
# complex conjugate of {{1,e^(-i*pi/5)},{3-i,10}} 
a = np.array([[1, np.exp(-1j*np.pi/5)], [3-1j, 10]])
result = np.conj(a)
display(sym.Matrix(result))
# confirm top right entry by typing this
# in WolframAlpha: e^(-i*pi/5))

--

Also look up: transpose and conjugate transpose (e.g., example 2.18, p. 49).

**Question 9.** Calculate the inner product of $v = \begin{pmatrix} i \\ 2+i \end{pmatrix}$ and $w = \begin{pmatrix} 2 \\ -1 \end{pmatrix}$.

This is example 2.19 on page 51 in the Martin LaForest booklet.

--

v = np.array([1j, 2+1j])
w = np.array([2, -1])
result = np.dot(v, w)
print(result)
# in Wolfram Alpha type 
# something like {a, b} * {c, d}

--

**Question 10.** Same for $\begin{pmatrix} i \\ i \end{pmatrix}$ and $\begin{pmatrix} 1 \\ -1 \end{pmatrix}$. 

This is example 2.22 on p. 52 in Martin LaForest. 

--

a = np.array([1j, 1j])
b = np.array([1, -1])
result = np.dot(a, b)
print(result)

--

**Question 11.** How long is the vector $\begin{pmatrix} 1 \\ -2 \\ i \end{pmatrix}$ ?

This is example 2.23 on p. 54 in Martin's booklet.

--

np.linalg.norm([1, -2, 1j])
# in WolframAlpha type: 
# Norm[ {1, -2, i} ]

--

np.sqrt(6)

--