Charge Flipping
https://xraytools.com/flip
The phases are thrown away and this gets them back. Transform, change the sign of everything below a small threshold, transform back, put the measured amplitudes in again — a few hundred times. Nothing in it knows what an atom is, and the atoms appear anyway.
- Before this
- The method iterates between a map and its transform, so the Fourier pair is the prerequisite — the algorithm is short and means nothing without it.
- You supply
- One of the named structures, and three numbers with defaults: the flip threshold as a multiple of the map’s rms, how many cycles to run, and which random start. The amplitudes are computed from the published coordinates and the phases are then discarded.
- Reading it
- Every result is printed beside a floor — what the same test scores on maps built from random phases. The comparison fixes neither the origin nor the hand of the structure, so it searches both, and on a structure whose sites fall on a regular pattern that search fits a noise map perfectly. Where the floor equals the full count, a perfect score is evidence of nothing, and the page says so.
Worked examples: cristobalite · rock salt — a score worth nothing · berlinite — nothing to show
Earlier on the path: Direct Methods and the Sign Relation Next on the path: Difference Map On From intensities to a structure, step 5 of 6
Notation here: F, |F| — what each one means here
See also: Direct Methods and the Sign Relation · Difference Map
What each input changes
- Threshold
- The threshold below which density gets its sign flipped. Too low and nothing changes; too high and the structure is destroyed along with the noise.
- Cycles
- How long the iteration runs. Charge flipping either converges or wanders, and more cycles do not rescue a run that is wandering.
Teaching with this page
- Objective
- After this page a learner can describe the charge-flipping loop and say what a good figure of merit is and is not evidence for.
- Start from
- this worked example
- Ask first
- Charge flipping drives R to 0.000 on your data. Is the structure solved?
- Watch for
- “Yes — calculated and measured amplitudes agree exactly”
- Then
- Difference Map
Check yourself: Charge flipping drives R to 0.000 on your data. Is the structure solved?
Not established — the loop enforces the thing R measures Yes — calculated and measured amplitudes agree exactly
R here is a real residual — it compares the amplitudes the flipped map implies with the measured ones, before those are put back for the next cycle — so it is not zero by construction and watching it fall is how the run is followed. What it cannot do is decide the question: push the threshold above the map’s maximum and every point flips, which makes the map exactly the negative of itself, every amplitude match and R reach 0.000 with nothing solved. A number a wrong parameter drives to perfect is not a test. What tells you it worked is a map with atoms in chemically sensible places, and this page scores a random-phase map on the same criterion so you can see the floor it has to beat.
Input
Throw the phases away and get them back
A diffraction experiment measures intensities, which correcting and square-rooting turn into |F|; no step of it records a phase. The Fourier page shows what that costs: the amplitudes alone draw nothing. The Patterson function gets a real answer without phases and pays by answering about interatomic vectors rather than atoms, and direct methods show the phases are constrained without being measured. Charge flipping is the one that just solves it.
The whole algorithm is four steps, repeated a few hundred times. Transform the current coefficients into a map. Wherever the density is at or below a small threshold, change its sign. Transform back. Throw away the amplitudes that came out and put the measured ones back, keeping the new phases. Nothing in it knows what an atom is; the only assumption is that a real electron density is mostly flat with a few sharp peaks, and the flip is what enforces it.
Choose a structure. Its amplitudes are computed from the published coordinates, the phases are then discarded and replaced with random numbers, and what comes back is compared with the atoms it never saw.
This runs on the projection down c, using only the hk0 reflections, so the map is a plane and the transform is two-dimensional. Atoms at the same x and y but different z fall on one another, which is why a structure can have more atoms than the map has sites. In one dimension the same algorithm fails on everything but the simplest structures, because a 1-D projection is not sparse and sparseness is the whole assumption the flip enforces.
Where this comes from
- Ab initio structure solution by charge flipping
G. Oszlányi and A. Sütő, Acta Cryst. A 2004, 60, 134–141 · doi:10.1107/S0108767303027569
The algorithm, in four steps and two pages. The threshold and the number of cycles above are the paper’s two parameters, and its own warning about the R factor is the one repeated here. - The probability distribution of X-ray intensities
A. J. C. Wilson, Acta Cryst. 1949, 2, 318–321 · doi:10.1107/S0365110X49000813
The distribution the map’s rms is measured against, and the reason a threshold here is quoted as a multiple of it rather than in electrons.