In this short tutorial we are gonna cover some basic aspects of statistics, time-of-flight (TOF) mass spectrometry (MS) and how can we use it to see the chemical reactions.
(image from Scientific Reports volume 10, Article number: 2884 (2020)).
Let X and Y be random variables described by a probability density , which should be normalized to unity (). The probability density can be thought as a underlying law of the physical behavior, while the X or Y are just the observable symptoms. By measuring the X,Y we through the dice, and the probability of observing result is .
For every variable dependent on we can calculate its expectation values:
In practice, the probability distribution is usually unknown and in the experiment we observe = measure the random realizations of the random variables . If we do N measurements, we will get a set of results
The probability distribution will be ``encoded'' inside the measurements, therefore we can calculate expectation value of any variable F as simple as:
There are a lot of useful stuff that can be calculated, but a we will focus only on the few chosen ones.
Moments describe how one of the variables (X or Y) are distributed, thus using those we can characterize the unknown ``projections'' of on X or Y:
Distributions and are called marginal densities.
There are quite a few of different types of moments, but we will remember only the two main types.
The best illustration of these concepts is the Gaussian distribution (see Fig. above).
The expectation value of X is and the variance is (i.e. is the standard deviation).
But please always remember the following: FWHM (full width at half maximum) for Gaussian distribution is NOT the standard deviation .
Since , the condition for FWHM is . Solutions of this equations are
thus taking the difference between the edges of Gaussian distribution at half-way-to-maximum we will get FWHM:
If we want to know something about how the variables X and Y are distributed jointly, we can use a quantity called covariance. It is calculated as
It is fairly simple to compute from the measurements:
and such calculation is usually done by special functions in high-level languages (in MATLAB it is
and in Python one can use either
or
).
To understand the meaning of this relation we need a concept of independent events. The events A and B are independent, if their probability is . In case of continuous distribution this means factorizability of probability density function:
This means that
therefore and thus for independent X and Y .
The covariance normed at the standard deviations is called Pearson correlation coefficient:
Statisticians love this one more then the pure covariance, however, in the physics it's completely opposite.
Let us consider a prototypical quantum cryptography scheme (see Fig. above):
In this system there are four possible measurement outcomes:
where lower index denotes result of the observation on the detector A or B.
There can be a three basic situations, that can be happening.
The source can produce entangled pair of electrons created from a singlet state
In this case probabilities of the outcomes will be and .
The average spin orientations and measured at the detectors will be
However, the cross-term for the entangled state will be:
and thus
Negative covariance means that if one value of positive, then the value of is probably negative.
If we break the entanglement we will get independent electrons, which will give equal probabilities for all four outcomes: . This will not change the expectation values of the single detector measurements:
but the cross-term will now change:
and we will see the independence of the electrons as a
However, we can set the source to produce entangled electrons from a triplet state, that can be one of three possibilities:
This will give a set of probabilities
and (in reality the probabilities will be different, we just do an oversimplification). The and will still be zero, but the cross-term
will be positive, and thus the covariance
This positive correlation means that when positive, the is also positive.
To summarize:
First, we need to bring back the memory of what is time-of-flight (TOF) mass spectroscopy (MS).
The simplest setup (see Fig. above) consists of the two plates charged positively and negatively. This capacitor-like construction forms an uniform electric field. When the ions are produced at distance from the detector (being close to the negative plate) they are accelerated by Lorentz force towards negative plate. Depending on the mass-to-charge ratio, the time from ion production to registration will be different: the heavier ions will come later then the lighter ones.
This simple scheme provides a very fine mass-to-charge resolution.
In the end, the MS signal is the , ion current as a function of TOF. When it is digitized, the continuous signal turns into a discrete vector-like quantity:
where , is the discretization time step and M is the number of TOF points taken.
We can perform N measurements of the TOF MS, which will give us a set of independent results .
Based on this ensamble of points we can calculate size covariance map consisting of elements
From the meaning of the covariance we can expect to see the underlying reactions.
However, life is a little bit more interesting than that. :)
The Coulomb explosion is a reaction of the kind
We have then two ions flying away from each other (see Fig. above). According to the momentum conservation law, the final velocities of the fragments ( for and for ) should be related to the initial velocity of () as
where m are the masses of the parent and the fragments. Let us consider only the projection of the velocities on the electric field direction (v, see Fig. above):
Each of the fragments will move towards the detector according to the second Newton's law , where is the charge of the ion and is the electric field strength (we consider only the electric field direction). This we can solve taking the initial position of the ion and velocity v:
where a is the ion acceleration in the constant electric field. We need to know the time when the ion will reach the detector located at distance L from the reaction place. It can be found according to , which is a quadratic equation for TOF t
The solution is
Since the applied field should be strong enough too pull each and every ion towards the detector, we can write , thus
where is the time when the velocity-less ion will reach the detector (it should also be the average arrival time for this sort of ions) and
is the TOF drift. Obviously, the ions that are already flying towards the detector will reach the final destination earlier (), and those, that initially run away from detector will come later ().
We want to know how the arrival times of and are connected = correlated. From momentum conservation law above we can write
The time drift for is , while for it is
This gives the TOFs for ions and :
The times and are connected through the variable that shows initial velocity of fragment .
Thus the positive correlation = covariance in coordinates (i.e. in the coordinates of the covariance map, ) for ions and will look like a straight line with a slope (see Fig. above). Those straight lines with negative slopes are the clear signatures of the Coulomb explosions. If there are some intermediate or later reactions, the shape of covariances will change in very wierd ways.
The free electron lasers (FELs) are really great at making ions. Also they are known to have large fluctuations of the pulse energies. Let us consider ion yields of two ions: A and B. Assuming that the formation of all the ions happens as a result of one-photon process, we can assume that the ion yields of ions will be proportional to the power of the FEL (W):
where a and b are the true random ion yields, that depend only on the intermolecular random variables, i.e. a and b are independent of W. This means that .
Let us calculate the covariance of A and B that we will get from the covariance maps:
But in reality we want to have
so let's clean it up in . To do that we need to add and subtract missing , and by doing that we'll get
The first term is what we want: it represents the true intramolecular relation between ions. The second term is called false covariance: it will give a nonzero covariance even if the ions in reality are unrelated ().
To clean out the first term we need to express the second addend in the terms of observables .
Let us calculate covariance of A and B with W:
therefore
Now we can calculate which is called partial covariance () as
In principle, this value represents the ``true'' covariance of ionic signals.
If we have the same measured data , as we first did when introduced TOF-TOF covariance maps, we would have to calculate the following matrix elements:
where is the covariance map.
If we denote the TOF-TOF covariance matrix as and a define a vector of length M for ion intensity covariance with FEL power W:
then we can write partial covariance matrix as
where is an outer product. When using high-level languages (such as MATLAB and Python) please use this or equivalent expressions, otherwise the calculation of the partial covariance will take forever.
In reality, the FEL power can be not the only random variable that creates the false covariances. The molecular beam can fluctuate, the other lasers can also have power variations, the detection devices can do some stuff, so a lot of possible things can happen. If there are multiple random variables that are independent from each other ( for ), then the generalized covariance can be calculated:
However, other variables except for FEL power are usually unknown, therefore people take the assumption that the FEL power correction factor looks exactly like the other ones, i.e.
so to get rid of all the false covariances we can just take a partial covariance modified by a scale factor :
Let us consider example from paper O. Kornilov et al. «Coulomb explosion of diatomic molecules in intense XUV fields mapped by partial covariance» // J. Phys. B: At. Mol. Opt. Phys. 46 (2013) 164028.
These people have ionized poor N2 molecules with strong X-ray/Ultraviolet (XUV) radiation produced by a free electron laser at Hamburg (FLASH), thus obtaining the TOF-TOF covariance maps given above. Panels (a) and (b) show the components of the covariance maps, namely cross-term and averages product . The panel © is the resulting covariance map, and there we can see some lines with negative slopes. If we take the FEL power correction map (panel (d)) and substract it from the covariance, we will obtain the partial covariance map (panel (e)) with lots and lots of lines. To correct even more for the other fluctuations, the scaling of the correction matrix (d) can be taken with scale factor , and this will give an even clearer map, given in panel (f).
And this is how it's done :)
This tutorial was written for a very specific and advanced people. So if there are any questions and concerns, please feel free to ask. I'll be glad to help! :)
(image from Scientific Reports volume 10, Article number: 2884 (2020)).
What is covariance?
Formal explanation
Probability distribution and measurements
Let X and Y be random variables described by a probability density , which should be normalized to unity (). The probability density can be thought as a underlying law of the physical behavior, while the X or Y are just the observable symptoms. By measuring the X,Y we through the dice, and the probability of observing result is .
For every variable dependent on we can calculate its expectation values:
In practice, the probability distribution is usually unknown and in the experiment we observe = measure the random realizations of the random variables . If we do N measurements, we will get a set of results
The probability distribution will be ``encoded'' inside the measurements, therefore we can calculate expectation value of any variable F as simple as:
There are a lot of useful stuff that can be calculated, but a we will focus only on the few chosen ones.
Moments
Moments describe how one of the variables (X or Y) are distributed, thus using those we can characterize the unknown ``projections'' of on X or Y:
Distributions and are called marginal densities.
There are quite a few of different types of moments, but we will remember only the two main types.
- The raw moments are calculated as
The most important raw moment is the variable expectation value:
It characterize the ``center-of-mass'' of the distribution, which however is not necessarily the most probable outcome of the measurement.
Usually the is denoted as , and due to the lack of letters in Latin+Greek alphabets we will be very confused by the next item in the list.
- The central moments are the second important parameters:
The is really boring, however
is really cool and is known as variance of X and thus denoted as .
This value is closely related to the standard deviation which is defined as
Both variance and standard deviation show how the variable is ``spread'' around the expectation value.
The best illustration of these concepts is the Gaussian distribution (see Fig. above).
The expectation value of X is and the variance is (i.e. is the standard deviation).
But please always remember the following: FWHM (full width at half maximum) for Gaussian distribution is NOT the standard deviation .
Since , the condition for FWHM is . Solutions of this equations are
thus taking the difference between the edges of Gaussian distribution at half-way-to-maximum we will get FWHM:
Covariance
If we want to know something about how the variables X and Y are distributed jointly, we can use a quantity called covariance. It is calculated as
It is fairly simple to compute from the measurements:
and such calculation is usually done by special functions in high-level languages (in MATLAB it is
cov
and in Python one can use either
numpy.cov
or
scipy.stats.cov
).
To understand the meaning of this relation we need a concept of independent events. The events A and B are independent, if their probability is . In case of continuous distribution this means factorizability of probability density function:
This means that
therefore and thus for independent X and Y .
The covariance normed at the standard deviations is called Pearson correlation coefficient:
Statisticians love this one more then the pure covariance, however, in the physics it's completely opposite.
Simple example of how covariance works
Let us consider a prototypical quantum cryptography scheme (see Fig. above):
- a source that produces two electrons flying in opposite directions,
- two detectors (``A'' and ``B'') to catch electrons and measure their spin on the vertical axis.
In this system there are four possible measurement outcomes:
- and with spins and ,
- and with and ,
- and with and ,
- and with and ,
where lower index denotes result of the observation on the detector A or B.
There can be a three basic situations, that can be happening.
Anticorrelated electrons
The source can produce entangled pair of electrons created from a singlet state
In this case probabilities of the outcomes will be and .
The average spin orientations and measured at the detectors will be
However, the cross-term for the entangled state will be:
and thus
Negative covariance means that if one value of positive, then the value of is probably negative.
Non-correlated electrons
If we break the entanglement we will get independent electrons, which will give equal probabilities for all four outcomes: . This will not change the expectation values of the single detector measurements:
but the cross-term will now change:
and we will see the independence of the electrons as a
Positively correlated electrons
However, we can set the source to produce entangled electrons from a triplet state, that can be one of three possibilities:
This will give a set of probabilities
and (in reality the probabilities will be different, we just do an oversimplification). The and will still be zero, but the cross-term
will be positive, and thus the covariance
This positive correlation means that when positive, the is also positive.
All together now!
To summarize:
- negative covariance = anti-relation between variables (when one is increased, the other is decreased, and vice versa),
- zero covariance = independent variables,
- positive covariance = when one value is increased, the second is increased as well (and vice versa).
TOF-TOF covariance maps
What is TOF covariance map?
First, we need to bring back the memory of what is time-of-flight (TOF) mass spectroscopy (MS).
The simplest setup (see Fig. above) consists of the two plates charged positively and negatively. This capacitor-like construction forms an uniform electric field. When the ions are produced at distance from the detector (being close to the negative plate) they are accelerated by Lorentz force towards negative plate. Depending on the mass-to-charge ratio, the time from ion production to registration will be different: the heavier ions will come later then the lighter ones.
This simple scheme provides a very fine mass-to-charge resolution.
In the end, the MS signal is the , ion current as a function of TOF. When it is digitized, the continuous signal turns into a discrete vector-like quantity:
where , is the discretization time step and M is the number of TOF points taken.
We can perform N measurements of the TOF MS, which will give us a set of independent results .
Based on this ensamble of points we can calculate size covariance map consisting of elements
From the meaning of the covariance we can expect to see the underlying reactions.
- If fragments A and B are formed independently, in the corresponding part of the map will be .
- If the fragment A is formed from parent ion B, the increase of the A will deplete amount = intensity of the parent, and vice versa, less fragmentation of B will yield in smaller amounts of observed A. Therefore we expect from this part of the map .
- If the A and B are produced in the same reaction sequence from the same parent species, the increase/decrease of one ion can be noticed in the connected fragment, therefore .
However, life is a little bit more interesting than that. :)
Coulomb explosions
The Coulomb explosion is a reaction of the kind
We have then two ions flying away from each other (see Fig. above). According to the momentum conservation law, the final velocities of the fragments ( for and for ) should be related to the initial velocity of () as
where m are the masses of the parent and the fragments. Let us consider only the projection of the velocities on the electric field direction (v, see Fig. above):
Each of the fragments will move towards the detector according to the second Newton's law , where is the charge of the ion and is the electric field strength (we consider only the electric field direction). This we can solve taking the initial position of the ion and velocity v:
where a is the ion acceleration in the constant electric field. We need to know the time when the ion will reach the detector located at distance L from the reaction place. It can be found according to , which is a quadratic equation for TOF t
The solution is
Since the applied field should be strong enough too pull each and every ion towards the detector, we can write , thus
where is the time when the velocity-less ion will reach the detector (it should also be the average arrival time for this sort of ions) and
is the TOF drift. Obviously, the ions that are already flying towards the detector will reach the final destination earlier (), and those, that initially run away from detector will come later ().
We want to know how the arrival times of and are connected = correlated. From momentum conservation law above we can write
The time drift for is , while for it is
This gives the TOFs for ions and :
The times and are connected through the variable that shows initial velocity of fragment .
Thus the positive correlation = covariance in coordinates (i.e. in the coordinates of the covariance map, ) for ions and will look like a straight line with a slope (see Fig. above). Those straight lines with negative slopes are the clear signatures of the Coulomb explosions. If there are some intermediate or later reactions, the shape of covariances will change in very wierd ways.
Partial covariance maps
The free electron lasers (FELs) are really great at making ions. Also they are known to have large fluctuations of the pulse energies. Let us consider ion yields of two ions: A and B. Assuming that the formation of all the ions happens as a result of one-photon process, we can assume that the ion yields of ions will be proportional to the power of the FEL (W):
where a and b are the true random ion yields, that depend only on the intermolecular random variables, i.e. a and b are independent of W. This means that .
Let us calculate the covariance of A and B that we will get from the covariance maps:
But in reality we want to have
so let's clean it up in . To do that we need to add and subtract missing , and by doing that we'll get
The first term is what we want: it represents the true intramolecular relation between ions. The second term is called false covariance: it will give a nonzero covariance even if the ions in reality are unrelated ().
To clean out the first term we need to express the second addend in the terms of observables .
Let us calculate covariance of A and B with W:
therefore
Now we can calculate which is called partial covariance () as
In principle, this value represents the ``true'' covariance of ionic signals.
If we have the same measured data , as we first did when introduced TOF-TOF covariance maps, we would have to calculate the following matrix elements:
where is the covariance map.
If we denote the TOF-TOF covariance matrix as and a define a vector of length M for ion intensity covariance with FEL power W:
then we can write partial covariance matrix as
where is an outer product. When using high-level languages (such as MATLAB and Python) please use this or equivalent expressions, otherwise the calculation of the partial covariance will take forever.
In reality, the FEL power can be not the only random variable that creates the false covariances. The molecular beam can fluctuate, the other lasers can also have power variations, the detection devices can do some stuff, so a lot of possible things can happen. If there are multiple random variables that are independent from each other ( for ), then the generalized covariance can be calculated:
However, other variables except for FEL power are usually unknown, therefore people take the assumption that the FEL power correction factor looks exactly like the other ones, i.e.
so to get rid of all the false covariances we can just take a partial covariance modified by a scale factor :
Real life example
Let us consider example from paper O. Kornilov et al. «Coulomb explosion of diatomic molecules in intense XUV fields mapped by partial covariance» // J. Phys. B: At. Mol. Opt. Phys. 46 (2013) 164028.
These people have ionized poor N2 molecules with strong X-ray/Ultraviolet (XUV) radiation produced by a free electron laser at Hamburg (FLASH), thus obtaining the TOF-TOF covariance maps given above. Panels (a) and (b) show the components of the covariance maps, namely cross-term and averages product . The panel © is the resulting covariance map, and there we can see some lines with negative slopes. If we take the FEL power correction map (panel (d)) and substract it from the covariance, we will obtain the partial covariance map (panel (e)) with lots and lots of lines. To correct even more for the other fluctuations, the scaling of the correction matrix (d) can be taken with scale factor , and this will give an even clearer map, given in panel (f).
And this is how it's done :)
Conclusions
- Covariance maps are not scary at all.
- They can show the reaction pathways for the ions.
Stuff to read
- To know at least something, Wikipedia can help.
- The really good reviews is:
Frasinski, L. J. Covariance mapping techniques. Journal of Physics B: Atomic, Molecular and Optical Physics 49, 15 (jul 2016), 152004.
- It's a paper, but with lots of useful theoretical stuff in it:
Zhaunerchyk, V., Frasinski, L. J., Eland, J. H. D., and Feifel, R. Theory and simulations of covariance mapping in multiple dimensions for data analysis in high-event-rate experiments. Phys. Rev. A 89 (May 2014), 053418.
P.S.
This tutorial was written for a very specific and advanced people. So if there are any questions and concerns, please feel free to ask. I'll be glad to help! :)
BlessYourHeart
А почему не по русски? по английски то статей по масспектрометрии много, а вот по русски практически ничего нет по крайней мере свежего, при том, что российская школа аналитическая в глубоком вакууме (скажем так), учебники устарели, англоязычные основы стоят дорого да еще и языковой барьер… Ту же теорию квадруполей по русски и не найдешь, а это понимание инструмента. Я уже не говорю про разные ионизации…