I will give an example, and to make the typing as economical as possible, i will use sage:
sage: G = graphs.PetersenGraph()
sage: G
Petersen graph: Graph on 10 vertices
sage: G.adjacency_matrix()
[0 1 0 0 1 1 0 0 0 0]
[1 0 1 0 0 0 1 0 0 0]
[0 1 0 1 0 0 0 1 0 0]
[0 0 1 0 1 0 0 0 1 0]
[1 0 0 1 0 0 0 0 0 1]
[1 0 0 0 0 0 0 1 1 0]
[0 1 0 0 0 0 0 0 1 1]
[0 0 1 0 0 1 0 0 0 1]
[0 0 0 1 0 1 1 0 0 0]
[0 0 0 0 1 0 1 1 0 0]
sage: G.vertices()
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
sage: G.show()
Launched png viewer for Graphics object consisting of 26 graphics primitives
Above, the rows and the columns of the matrix are labeled $0,1,2,3,4,5,6,7,8,9$ and considered with this order of them. For instance, $6$ and $9$ are joined by an edge, because of this we have the $\boxed 1$ entry in row $6$ column $9$ (and vice versa):
$$
\left[\begin{array}{rrrrrrrrrr}
0 & 1 & 0 & 0 & 1 & 1 & 0 & 0 & 0 & 0 \\
1 & 0 & 1 & 0 & 0 & 0 & 1 & 0 & 0 & 0 \\
0 & 1 & 0 & 1 & 0 & 0 & 0 & 1 & 0 & 0 \\
0 & 0 & 1 & 0 & 1 & 0 & 0 & 0 & 1 & 0 \\
1 & 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 1 \\
1 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & 1 & 0 \\
0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & \boxed 1 \\
0 & 0 & 1 & 0 & 0 & 1 & 0 & 0 & 0 & 1 \\
0 & 0 & 0 & 1 & 0 & 1 & 1 & 0 & 0 & 0 \\
0 & 0 & 0 & 0 & 1 & 0 & \boxed 1 & 1 & 0 & 0
\end{array}\right]
\ .
$$
The first row is 0 1 0 0 1 1 0 0 0 0
corresponding to the columns $0,1,2,3,4,5,6,7,8,9$, and the ones are corresponding to $1,4,5$, which are the neighbours of $0$ in the graph.
Now it is possible that an alien prefers an other order, for instance
$9,6,7,2,1,3,5,4,0,8$. Then he/she/it should write an other matrix. The corresponding boxed entries are now
$$
\left[\begin{array}{rrrrrrrrrr}
0 & \boxed 1 & 1 & 0 & 0 & 0 & 0 & 1 & 0 & 0 \\
\boxed 1 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 & 1 \\
1 & 0 & 0 & 1 & 0 & 0 & 1 & 0 & 0 & 0 \\
0 & 0 & 1 & 0 & 1 & 1 & 0 & 0 & 0 & 0 \\
0 & 1 & 0 & 1 & 0 & 0 & 0 & 0 & 1 & 0 \\
0 & 0 & 0 & 1 & 0 & 0 & 0 & 1 & 0 & 1 \\
0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 1 & 1 \\
1 & 0 & 0 & 0 & 0 & 1 & 0 & 0 & 1 & 0 \\
0 & 0 & 0 & 0 & 1 & 0 & 1 & 1 & 0 & 0 \\
0 & 1 & 0 & 0 & 0 & 1 & 1 & 0 & 0 & 0
\end{array}\right]
$$
The first row is 0 1 1 0 0 0 0 1 0 0
corresponding to the columns $9,6,7,2,1,3,5,4,0,8$, and the ones are corresponding to $6,7,4$, which are the neighbours of $9$ in the graph.
The following code was used to get he new matrix for the new order.
sage: L = [9,6,7,2,1,3,5,4,0,8]
sage: A = G.adjacency_matrix()
sage: B = matrix(ZZ, 10, 10, [A[m,n] for m in L for n in L] )
sage: latex(B)
Note: The cited text is very pedant, puts the accent on some bureaucratic point, the order, then introduces a lot of notation for this, a permutation $\pi$, the space of permutations, makes it part of the structure. This is maybe misleading at least in the same measure i am in similar situations.
Best Answer
As with any linear mapping, the function $F:\mathbb R^n \to \mathbb R^{n\times n}$ that sends a vector $\vec v = (v_1,\ldots,v_n)$ to a diagonal matrix with those entries:
$$ F\, \vec v = \begin{pmatrix} v_1 & & 0 \\ & \ddots & \\ 0 & & v_n \end{pmatrix} $$
is uniquely determined by its action on a basis. With a suitable choice of notation we can turn such a definition into a "formula".
Recall the standard ordered basis for $\mathbb R^n$, namely row vectors:
$$ \textbf e_1 = (1,0,\ldots,0), \ldots, \textbf e_n = (0,\ldots,0,1) $$
We can then define our linear mapping as a sum:
$$ F(v_1,\ldots,v_n) = \sum_{k=1}^n v_k \textbf e_k^T \textbf e_k $$
Note that the product of column vector $\textbf e_k^T$ and the row vector $\textbf e_k$ gives a diagonal $n\times n$ matrix with $1$ in the $k$th diagonal position (and zeros elsewhere). Therefore the summation of these terms gives a diagonal matrix supplying exactly the specified diagonal entries.