Matrix-vector-constant multiplication

434 Views Asked by At

Problem:

I have the following matrix: $$H=\frac{1}{\sqrt{2}}\begin{bmatrix}1&1\\1&-1\end{bmatrix}$$ and the following vector: $$S=\begin{bmatrix}\alpha\\\beta\end{bmatrix}$$ What is $H*S$?

Work:

First I simplified $H$: $$H=\begin{bmatrix}\frac{1}{\sqrt{2}}&\frac{1}{\sqrt{2}}\\\frac{1}{\sqrt{2}}&-\frac{1}{\sqrt{2}}\end{bmatrix}$$ Then I multiplied it by the vector:

$$\begin{bmatrix}\frac{1}{\sqrt{2}}&\frac{1}{\sqrt{2}}\\\frac{1}{\sqrt{2}}&-\frac{1}{\sqrt{2}}\end{bmatrix}*\begin{bmatrix}\alpha\\\beta\end{bmatrix}=\alpha\begin{bmatrix}\frac{1}{\sqrt{2}}\\\frac{1}{\sqrt{2}}\end{bmatrix}+\beta\begin{bmatrix}\frac{1}{\sqrt{2}}\\-\frac{1}{\sqrt{2}}\end{bmatrix}=\begin{bmatrix}\frac{\alpha}{\sqrt{2}}\\\frac{\alpha}{\sqrt{2}}\end{bmatrix}+\begin{bmatrix}\frac{\beta}{\sqrt{2}}\\-\frac{\beta}{\sqrt{2}}\end{bmatrix}=\begin{bmatrix}\frac{\alpha+\beta}{\sqrt{2}}\\\frac{\alpha-\beta}{\sqrt{2}}\end{bmatrix}$$

Did I do this correctly? If not, where did I make the error?

2

There are 2 best solutions below

2
On BEST ANSWER

You're correct, but it's much faster not to multiply the constant into the matrix:

$$\frac{1}{\sqrt{2}}\begin{bmatrix}1&1\\1&-1\end{bmatrix}\cdot \begin{bmatrix}\alpha\\\beta\end{bmatrix}= \frac{1}{\sqrt{2}}\begin{bmatrix}\alpha + \beta\\\alpha - \beta\end{bmatrix}$$

1
On

Yes, you did it right.

Trivia, the matrix $H$ corresponds to Hadamard gate.