../fullrmc/Examples/atomicNiTi/
A box of 3375 Nickel atoms and 3375 Titanium which makes a total of 6750 arranged
in a body centred cubic crystal of length \(3.05 \AA\). x-rays pair distribution
function and Atomic Structure Factor are used simultaneously to build and fit a model.
In this example, it was necessary to use SwapPositionsGenerator
in order to
fit long ranger ordering. This example was used to generate the
swap video
as seen in the online documentation.
PairDistributionConstraint
and
ReducedStructureFactorConstraint
constraints data.IMPORTING USEFUL DEFINITIONS:
All useful packages, modules and definitions are imported.
CREATE ENGINE:
Check if engine already saved on disk. In the affirmative load it to continue
fitting from last saved configuration. Otherwise, build the engine and the needed
constraints. In this particular example, ‘experimental.fq’ has no regular bins.
Therefore, rebinning it needs to be rebinned using ‘fullrmc.Core.Collection.rebin’
function. Even though engine contains AtomicCoordinationNumberConstraint
we decided to discard this constraint upon fitting by using set_used method and
assigned ‘used’ flag to False.
DIFFERENT RUNS:
Define functions to run the fitting engine. All of the following functions finish running the engine using Engine.run method.
RandomSelector
and random
atomic translations using TranslationGenerator
move
generator.SwapPositionsGenerator
for swapping Nickel atoms with
Titanium and the other the opposite. Loop over all engine’s groups, check
whether group’s atom is Nickel or Titanium and assign it respectively
SwapPositionsGenerator
to Titanium atoms and another
SwapPositionsGenerator
to Nickel atoms.
Advanced users can change AtomicCoordinationNumberConstraint
used flag
to True and try playing with the given coordination number definition and improve
the fit quality and the physical meaning of the final structure.RUN SIMULATION:
run_normal several times with different number of steps and saving frequencies. This sampling is not needed but it was done as such for the purpose of saving different pdb file snapshots at different stages of the fitting. At the end run_swap is called to fit long range order correlations.
PLOT PDF CONSTRAINT:
Plotting simultaneously PairDistributionConstraint
and
ReducedStructureFactorConstraint
data after fitting.