A basic question we can ask about any crystal is: How big is it? Many properties depend on size, so this is often a key question. Often it is not as easy to answer as you might hope. Take a look at the crystalline nanocrystal above. Its total size is about 59,000 atoms, or about 40 atoms across. But it is actually made up of two crystalline domains. To see this, look at the rows of yellow and orange coloured atoms, in most of the particle they are roughly vertical, but at the top right they are tilted a bit below the horizontal. So this is two crystals not one.
All the atoms are actually identical, the colour coding just shows that the two crystals are both actually mixed crystals. They are actually a combination of two crystal lattices: face-centred cubic (yellow) and hexagonal close packed (orange). But that is a detail that is not important here (and the few green atoms are basically just errors in the classification scheme, don’t worry about those).
The human eye is very good at spotting correlation so spotting that there is one big and one small crystal is easy, but we want an algorithm to do this. A bunch of people, starting with a smart guy called Paul Steinhardt, have come up with idea of using the arrangement of neighbouring atoms around an atom, to determine that atom’s state, i.e., if it is crystal or not. This works well and is behind the colour coding above.
This scheme gives a vector of numbers, so you would hope that taking the dot product of the vectors on a pair of atoms would give some measure of how correlated they are, and this works. Again this not my idea. And it appears to work. It gives a weighted average crystal size of about 40,000 atoms.
Now, I think that, by eye, we have one crystal with maybe 50,000 atoms and another much smaller one of around 9,000 atoms. This gives an average size of around 28,000 atoms. But the method of dot produces weights each crystal by its fraction of atoms it contains, so for that my by-eye estimate gives: 50,000*(50,000/59,000) + 9,000*(9,000/59,000) = 44,000 atoms. That is pretty good agreement between the dot-product method and my eye. I’m happy about that.