Any potential Lewis structure — valid or not — can be represented in terms of a matrix, and the properties of the structure can be read off as properties of that matrix:

Suppose you have a built a Lewis structure for a molecule composed of
\(n\) atoms. You can form an \(n\times n\) matrix with one row and one
column for each atom. Fill in the entries of the matrix with 0, 1, 2,
or 3 depending on whether the structure assigns no bond, a single
bond, a double bond, or a triple bond between the atom in that row and
the atom in that column. Now according to this scheme, the diagonal
entries of the matrix would be places where an atom bonds to itself,
which doesn't make sense — instead, fill in the diagonal
elements of the matrix with the number of non-bonding electrons that
the Lewis structure assigns to that atom. Altogether, I call the
resulting matrix the *electron matrix*, \(E\). (Question: what
quantity do you obtain if you add up all the entries in this matrix?)

$$ E_{i,j} = \begin{cases}\text{bond strength between \(i\) and $j$},&&\text{if $i\neq j$} \\ \text{# of non-bonding electrons at atom $i$}&&\text{if $i=j.$}\end{cases} $$

**Example (Electron matrix):** Nitrous oxide (N_{2}O) has several possible Lewis
structures, two of which are described by the following electron
matrices (where the columns/rows correspond to atoms of nitrogen,
nitrogen, and oxygen in that order.):

$$E_1 = \begin{bmatrix}2 & 3 & 0 \\ 3 & 0 & 1 \\ 0 & 1 & 6\end{bmatrix}, \quad E_2 = \begin{bmatrix}4 & 2 & 0 \\ 2 & 0 & 2 \\ 0 & 2 & 4\end{bmatrix}$$

For practice interpreting such configurations, consider the first matrix. By reading the first row/column, we see that the first nitrogen has two (2) nonbonding electrons itself, that it is triple-bonded (3) to the other nitrogen atom, and that it is not bonded (0) to the oxygen atom. The second row/column tells us that the second nitrogen atom is triple bonded (3) to the first, that it has no non-bonding electrons itself (0), and that it is single-bonded (1) to the oxygen atom. Finally, in the third row/column, we discover that the oxygen atom is not bonded to the first nitrogen atom (0), that it's single-bonded (1) to the second nitrogen atom, and that it has six (6) non-bonding electrons.

For our purposes, we will also need a second \(n\times n\) matrix
which encodes the properties of the molecular components only and does
not depend on the Lewis structure itself: the *atomic valence matrix*
\(V\) is a matrix whose diagonal entries are the number of valence
electrons of the atom in that row (or, equivalently, column); all
other entries are 0.

**Example (Atomic valence matrix):** The atomic valence matrix of nitrous oxide (N_{2}O) is
always

$$V = \begin{bmatrix}5 & 0 & 0 \\ 0 & 5 & 0 \\ 0 & 0 & 6\end{bmatrix},$$

corresponding to the accessible electrons in the valence shells of
nitrogen, nitrogen, and oxygen. Because \(V\) encodes only atomic
properties and not properties of the overall molecule, this matrix
will be the same regardless of which N_{2}O Lewis structures you're
considering .

Now according to the theory, the *physical feasibility* of a given
Lewis structure depends on two criteria: first, it must account for
all the valence electrons provided by the individual atoms (if it uses
too many or too few, the charge of the molecule will come out wrong.)
Second, it must ensure that the *formal charges* of the atoms in the
structure are as small in magnitude as possible, which means that each
atom in the molecule “has access to” about as many
electrons as it had in its valence shell before bonding to anything.

Interestingly enough, the atomic valence and electron matrices can
help us account for these criteria: if you take their difference, you
get what I call the *charge matrix* \(C = V - E,\) which has the
following remarkable properties:

- The sum of the entries in any row or column in \(C\) is the formal charge on that atom.
- The sum of all the entries in \(C\) is the charge of the molecule.

**Example (Charge matrix):** From our earlier examples with N_{2}O, we
have the atomic valence matrix

$$V = \begin{bmatrix}5 & 0 & 0 \\ 0 & 5 & 0 \\ 0 & 0 & 6\end{bmatrix},$$

and two possible electron matrices:

$$E_1 = \begin{bmatrix}2 & 3 & 0 \\ 3 & 0 & 1 \\ 0 & 1 & 6\end{bmatrix}, \quad E_2 = \begin{bmatrix}4 & 2 & 0 \\ 2 & 0 & 2 \\ 0 & 2 & 4\end{bmatrix}$$.

Taking the first electron matrix as an example, we obtain the following charge matrix:

$$\begin{eqnarray*}C_1 &=& V - E_1\\ &=& \begin{bmatrix}5 & 0 & 0 \\ 0 & 5 & 0 \\ 0 & 0 & 6\end{bmatrix} - \begin{bmatrix}2 & 3 & 0 \\ 3 & 0 & 1 \\ 0 & 1 & 6\end{bmatrix}\\ &=& \begin{bmatrix}3 & -3 & 0 \\ -3 & 5 & -1 \\ 0 & -1 & 0\end{bmatrix}\end{eqnarray*}.$$

And look—by taking row/column totals, we find that the formal charges of the atoms are respectively 0, +1, and -1. By adding up these formal charges (or, equivalently, by adding up all the entries in the charge matrix), we find that the overall charge on the molecule is 0.

So this is the general result — why does it matter? On one view, we are just using a kind of adjacency matrix for book-keeping purposes when we would ordinarily use electron dot diagrams. But on another view, matrices are rather nice to work with in general, and (as we have already seen in one case) they produce succinct formulas like \(C = V - E\) which, through a straightforward calculation, help you to produce a number of useful quantities simultaneously.

**Afterword**: I plan to extend these ideas more as I work on them. In
particular, it's interesting to extend electron matrices (which we
have used here only for molecules with exclusively covalent bonds) to
the case where some bonds have more polar character. In this case,
the matrix ceases to be symmetric — matrix symmetry corresponds to
covalence(!). Computing formal charges with these new matrices still
works — and in fact will produce more realistic values.

Second, I notice that the charge matrix looks like a discrete Laplacian operator, which suggests that it could be involved in a kind of diffusion equation (the diffusion of charge across a molecule); I wonder what the equilibrium solutions could be?

I also suspect that these matrices represent a sort of pixelated model of the actual quantum mechanics involved with the formation of bonds — I wonder how close the correspondence is?