xraytools.

Charge Flipping

Single-crystal data

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

× the map’s rms

Density at or below this changes sign each cycle. Blank means 0.2; the range is −0.5 to 2.

The literature works at about 1 σ and this page defaults to 0.2, which is not a disagreement: Oszlányi & Sütő flip a three-dimensional map, and this one is a projection. A projection piles several atoms onto every peak and none of the empty space, so its peak-to-noise is far worse — quartz’s true-phase projection peaks at 7 σ where a 3-D map at atomic resolution reaches tens. What matters is the cut relative to the peak, so a smaller multiple of σ here is the same cut. A negative value is accepted and flips density that is already negative, which is a different algorithm and is offered so you can watch it fail.

How many times the four steps run. Blank means 400, and 2000 is the most this will do.

Which set of random starting phases, from 1 to 999. It is a lottery: the same structure solves from some starts and not others, and changing this is how you play it again.

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