# Charge flipping

### From Online Dictionary of Crystallography

## Definition

Charge flipping is a structure solution method from the class of dual-space algorithms. The key component of the charge flipping algorithm is the charge flipping operation. In this operation, all scattering density pixels with density lower than a small positive threshold δ are multiplied by -1 (flipped). In the classical charge flipping algorithm, this direct-space modification is combined with simple resubstitution of structure-factor amplitudes by experimental values, but other modifications and iteration schemes have been proposed and successfully used.

Given a trial scattering density ρ sampled on a regular grid, and a set of measured structure-factor amplitudes , the basic charge flipping algorithm follows this scheme:

First, the algorithm is initiated in the zeroth cycle by assigning random starting phases to all experimental amplitudes and making all unobserved amplitudes equal to zero:

The iteration cycle then proceeds as follows:

- The density ρ
^{(n)}is calculated by inverse Fourier transform of*F*^{(n)}. - The modified density
*g*^{(n)}is obtained by flipping the density of all pixels with density values below a certain positive threshold δ and keeping the rest of the pixels unchanged:

- Temporary structure factors are calculated by Fourier transform of
*g*^{(n)}.

- New structure factors
*F*^{(n + 1)}are obtained by combining the experimental amplitudes with the phases and setting all non-measured structure factors to zero:

These modified structure factors then enter the next cycle of iteration.