Question: Given vector 
$$\vec x = \begin{bmatrix} x\_1 \\ \vdots \\ x\_n \end{bmatrix},$$
How can we write out vector 
$$\vec y = \begin{bmatrix} y\_1 \\ \vdots \\ y\_n \end{bmatrix} := \begin{bmatrix} x^2\_1 \\ \vdots \\ x^2\_n \end{bmatrix}$$ 
in terms of $\vec x$ using only matrix operations? 

It is simple to write $\vec y$ in terms of $\vec x$ element wise, for example in the form of system of equations $y\_i = x\_i^2$ for $i = 1, \dots, n$.
However, I am struggling to do so using matrix notation and operations.

The best guess I could come up with was to write expressions like 
$$
\begin{aligned}
\vec y &= \vec x ^T \cdot I\_{n \times n} \cdot\vec x, 
& I\_{n \times n} -\text{ identity matrix, } &
& I\_{n \times n} & =
\begin{bmatrix} 
1 & 0 & \cdots & 0 \\ 
0 & 1 & \cdots & 0 \\ 
\vdots & \vdots & \ddots & \vdots \\ 
0 & 0 & \cdots & 1 \\ \end{bmatrix} 
\\
\vec y &= \left\langle \vec x, \vec x \right \rangle 
= \left\| \vec x \right\|
& - \text{ inner product / norm, } &
& \left\| \vec x \right\| &= \left\langle \vec x, \vec x \right \rangle = 
\sum\_{i=1}^{n} x\_i^2
\end{aligned}
$$
both of which are obviously flawed.

Any hint would be appreciated.

Answer: 
What you are looking for is a vector-valued bilinear form. 

Let $B$ be a bilinear form from $\mathbb{R}^n \times \mathbb{R}^n$ into $\mathbb{R}^n$, such that, for all $i,j,k\in\{1,\cdots n\}$, 

$B\_{i,j}^k =1$ if $i=j=k$

and 

$B\_{i,j}^k =0$ otherwise

Then you have $\vec{y} = B(\vec{x},\vec{x})$. 

In terms of coordenates: $y\_k=\sum\_{i,j=1}^{n}B\_{i,j}^k x\_i x\_j=(x\_k)^2$

**Remark**: If you want to think of $B$ as a vector of matrices, it is 
$$B = \left(
 \pmatrix{1 & & \\ & 0 & \\ & & 0},
 \pmatrix{0 & & \\ & 1 & \\ & & 0},
\pmatrix{0 & & \\ & 0 & \\ & & 1}
 \right) $$
And the rule to apply it to vectors $\vec{v}$ and $\vec{w}$ is
$$B(\vec{v},\vec{w}) = \left(
 \vec{v}^T \pmatrix{1 & & \\ & 0 & \\ & & 0}\vec{w},
\vec{v}^T \pmatrix{0 & & \\ & 1 & \\ & & 0}\vec{w},
\vec{v}^T\pmatrix{0 & & \\ & 0 & \\ & & 1}\vec{w}
 \right) $$

Note that this way to write $B$ and to write $B(\vec{v},\vec{w})$ generalizes to any bilinear form from $\mathbb{R}^n \times \mathbb{R}^n$ into $\mathbb{R}^n$.
$\begin{pmatrix}
x\_1 & 0 & 0\\
0 & x\_2 & 0\\
0 & 0 & x\_3\\
\end{pmatrix}\begin{pmatrix}x\_1\\x\_2\\x\_3\end{pmatrix}=\begin{pmatrix}x\_1^2\\x\_2²\\x\_3^2\end{pmatrix}$