Quick userguide to mbfit in EDM

Mbfit is a simulation package for Many-beam Bloch wave calculation, which is originally written by K. Tsuda. The details of theory will not be presented here. The main features of mbfit include:

  1. Convergent beam electron diffraction (CBED) simulation
  2. Bloch state calculation
  3. Dispersion surface calculation
  4. Refinement of structure parameters using CBED experimental data

Currently only the first three are implemented in EDM2.0-beta package. Let’s start with a simple tutorial.

Step by step tutorial:

  1. If you are using windows, copy c:\Program Files\edm\mbfit to some appropriate location.
  2. If you are using unix, create a directory with a sample input file s3.txt
    %mkdir test
    %cd test
    %cp /usr/local/edm/mbfit/s3.txt ./
  3. Launch edm either as a command, or from the Programs menu.
  4. Select “ open CBED file” under pull-down menu “File”
    Choose the input file “s3.txt” and click “Ready”
    You will see:

4. click “Run Program” button to run CBED simulation.
5. Image files in tif format are generated under /test directory. You can open those tif files using edm or another program

Anatomy of the input file for mbfit

The EDM code has some ability to edit the input files for mbfit, although this is not complete in all cases. Hence you may need to do some editing by hand. The mbfit ignores comment characters followed by “#” or “%” in an input file. The input file is consists of four main datablocks and their sub-datablocks. Any data in the COMMENT{ }COMMENT data block will also be ignored. There some example input files under directory /usr/local/edm/mbfit/: s1.txt, s2.txt, s3.txt, s3.txt: CBED simulations bl1.txt, bl2.txt: Bloch wave. ds.txt: Dispersion surface

Three IMPORTANT notes about input file format

  1. The input file should be in unix format. If you edit the input file under DOS or windows,
    you may need convert them to unix text format by:
    %dos2unix *.txt
    (use the bash shell for the Windows version).
  2. NO space before keywords such as LATTICE{, }LATTICE, ATOM{, etc.
  3. The CALC_KXY_RANGE{ }CALC_KXY_RANGE block should always before the BEAM_SEARCH{ }BEAM_SEARCH block.

The above input files are all annotated with self-explained text. All input files consist of 4 parts. Here are more details for them.

Part 1: Simulation mode

This tells mbfit what kind of simulation to do. The possible values are:

  • SIM_MODE # for CBED simulation
  • BLOCH_MODE #for Bloch wave calculation 
  • DISPSURF_MODE #for Dispersion surface calculation

Part 2: Internal control parameter

Usually you don’t need to change internal parameters. They are only useful for debugging the package. You can just leave it blank.

EPS_CONTROL_PARAMETERS{ }EPS_CONTROL_PARAMETERS

Part 3: Crystal structure data block

This data block contains unit cell and atom sites information. It has three sub-datablocks:
LATTICE, ATOM, and LOW_ORDER_FG. This data block is the same for CBED simulation,
Bloch Wave calculation and Dispersion surface calculation.
An example for cubic SiC:

CRYSTAL_STRUCTURE_DATA{
#
LATTICE{
216 # Number of space group
# lattice parameter [in Angstrom units]
4.358     # a
4.358     # b
4.358     # c
90.0     # alpha
90.0     # beta
90.0     # gamma
}LATTICE
#
ATOM{
2 # Number of independent sites.
# if you have n independent sites,
#then you should have n SITE{ }SITE sub-datablock.
#
SITE{
SI
0.0     # x (fractional coordinate)
0.0     # y
0.0     # z
ISO # ISO: isotropic-B / ANISO: anisotropic-B

  1. # B [A^{2}]
  2. # occupancy [0.0-1.0]
    0 # f(structure factor) table (0:Mott+BK, 1:BK+BK)
    }SITE
    SITE{
    C

0.25     # x (fractional coordinate)
0.25     # y
0.25     # z
ISO     # ISO: isotropic-B / ANISO: anisotropic-B

  1. # B [A^{2}]
  2. # occupancy [0.0-1.0]
    0 # f(structure factor) table (0:Mott+BK, 1:BK+BK)
    }SITE

}ATOM

#    
LOW_ORDER_FG{
# this is for refinement of structure parameters mode.
# just leave it as 0
# Nothing to do CBED simulation, Bloch wave, and Dispersion surface modes
0 # number of low-order g, this is for refinement of structure parameter }LOW_ORDER_FG }CRYSTAL_STRUCTURE_DATA

Part 4: Simulation conditions data

This data block contains information for simulation conditions, such as incidence beam, accelerating voltage, thickness etc. Note that for different simulation modes, this data block has different sub-datablocks.

4.1 An example for CBED

SIM_CALCULATION_CONDITION{
#
INCIDENT_BEAM{
1 1 1     # Incidence (upward)
1 1 1     # Surface normal (upward)
2 -2 0     # ZOLZ base vector
0.0     # H tilt
0.0     # K tilt

100.0 # Accelerating Voltage [kV]
}INCIDENT_BEAM
# CALC_KXY_RANGE{
0     # cal_range_flag [dummy: always 0]
2     # Calc. type [0:0D, 1:1D, 2:2D disk, 3:2D square]
      # Calc. type: 0 for Bloch waves, 1 for Dispersion surface
      # Calc. Type: 2 and 3 for CBED simulation.
101 # numh: number of calc. points > 5 (total~sq(numh))
#    the final image will be 101x101
-3.0 3.0 # h_begin, h_end
-3.0 3.0 # k_begin, k_end
}CALC_KXY_RANGE
#
BEAM_SEARCH{
# Automatic beam search
2                 # Beam search method [0:manual, 1:auto[wg], 2:[sg]]
400 4.0 0 0  # num_g_limit, g_max[A^{-1}], LaueZone_min, LaueZone_max
# num_g_limit: maximum number of g
# if you want to search higher Lauezones, set LaueZone_max>0
0.02 0.03 1e+11 # Sg_exact_max, Sg_bethe_max, ξg_max
# if the beam search method is 1, then the above line is Wg_exact_max, Wg_bethe_max, ξg_max
}BEAM_SEARCH

# OUTPUT_REFLEX{
2     # Number of reflections to be calculated (0:all)
# indices hkl
0 0 0
2 -2 0
#
}OUTPUT_REFLEX
OUTPUT_THICKNESS{
# Number of thicknesses for output
2
# thicknesses (in Angstrom units)
250 500
}OUTPUT_THICKNESS
}SIM_CALCULATION_CONDITION

4.2 An example for Bloch wave

BLOCH_CALCULATION_CONDITION{
#
INCIDENT_BEAM{
1 1 1         # Incidence (upward)
1 1 1         # Surface normal (upward)
2 -2 0         # ZOLZ base vector

-1.0           # H tilt
0.0            # G tilt
100.0        # Accelerating Voltage [kV]
}INCIDENT_BEAM
#
CALC_KXY_RANGE{
0             # cal_range_flag [0:manual]
0             # Calc. type [0:0D], 0 for Bloch wave
1             # numh: number of calc. points
0.0 0.0     # h_begin, h_end
0.0 0.0     # k_begin, k_end
}CALC_KXY_RANGE

BEAM_SEARCH{
# Automatic beam search
2                 # Beam search [0:manual, 1:automatic-wg, 2:automatic-sg]
200 4.0 0 0  # num_g_limit, g_max[A^{-1}], LaueZone_min, LaueZone_max
# if you want to search higher Lauezones, set LaueZone_max>0
0.02 0.03 1e+11 # Sg_exact_max, Sg_bethe_max, ξg_max
}BEAM_SEARCH
#
CALC_RXY_RANGE{ 1
01 101          # Number of calculation points for x, y (odd number)
-2.0 2.0         # x_begin, x_end (along the ZOLZ base vector)
-2.0 2.0         # y_begin, x_end (perpendicular to the ZOLZ base vector)
}CALC_RXY_RANGE
#
OUTPUT_BRANCH{
1 7             # Number of branches to be calculated (begin, end)
}OUTPUT_BRANCH
}BLOCH_CALCULATION_CONDITION

4.3 An example for Dispersion surface

DISPSURF_CALCULATION_CONDITION{
#
INCIDENT_BEAM{
1 1 1          # Incidence (upward)
1 1 1          # Surface normal (upward)
2 -2 0         # ZOLZ base vector
0.0             # H tilt
0.0             # G tilt
100.0         # Accelerating Voltage [kV] }INCIDENT_BEAM

#
CALC_KXY_RANGE{
0             # cal_range_flag [dummy: always 0]
1             # Calc. type [should be 1 for DISPSURF_MODE]
81             # numh: number of calc. points > 5 (total~sq(numh))
-2.0 2.0     # h_begin, h_end
0.0 1.0     # g_begin, g_end
}CALC_KXY_RANGE
#
BEAM_SEARCH{
# Automatic beam search
2                 # Beam search [0:manual, 1:automatic-wg, 2:automatic-sg]
200 4.0 0 0 # num_g_limit, g_max[A^{-1}], LaueZone_min, LaueZone_max
# if you want to search higher Lauezones, set LaueZone_max>0

0.02 0.03 1e+11 # Sg_exact_max, Sg_bethe_max, ξg_max
}BEAM_SEARCH
#
OUTPUT_BRANCH{
1 7 # Number of branches to be calculated (begin, end)
}OUTPUT_BRANCH
#
OUTPUT_REFLEX{
2     # Number of reflections (0 means no output of epsCg and intensities)
# indices hkl
0 0 0 2 -2 0
}OUTPUT_REFLEX
#
OUTPUT_THICKNESS{
2 # Number of thicknesses for output
# (0: no intensity output) # thicknesses (Angstrom)
250 500 }OUTPUT_THICKNESS }
DISPSURF_CALCULATION_CONDITION

Attached is an input file s1.txt which is for CBED simulation:

# s1.txt
# mbfit: a sample data for CBED simulation
# Comment lines:  # or % or COMMENT{  }COMMENT
# ----------------------------------------------------------------------
# job type
# SIM_MODE: CBED simulations
# ----------
SIM_MODE
# ----------------------------------------------------------------------
# For changing internal control parameters
EPS_CONTROL_PARAMETERS{
}EPS_CONTROL_PARAMETERS
# ----------------------------------------------------------------------
# Crystal structural data block
CRYSTAL_STRUCTURE_DATA{
#
LATTICE{
227     # Number of space group
# lattice parameter [in Angstrom units]
5.43    # a
5.43    # b
5.43    # c
90.0    # alpha
90.0    # beta
90.0    # gamma
}LATTICE
#
ATOM{
1  # Number of independent sites.
##
SITE{
SI
0.0    # x (fractional coordinate)
0.0    # y
0.0    # z
ISO    # ISO: isotropic-B / ANISO: anisotropic-B
0.5    # B [A^{2}]
1.0    # occupancy [0.0-1.0]
0      # f table (0:Mott+BK, 1:BK+BK)
}SITE
}ATOM
#
LOW_ORDER_FG{
0    # number of low-order g
}LOW_ORDER_FG
}CRYSTAL_STRUCTURE_DATA
# ----------------------------------------------------------------------
# ----------------------------------------------------------------------
# Simulation: calculation condition block
SIM_CALCULATION_CONDITION{
#
INCIDENT_BEAM{
1   1   1    # Incidence    (upward)
1   1   1    # Surface normal (upward)
2   -2  0    # ZOLZ base vector
0.0          # H tilt
0.0          # G tilt
100.0        # Accelerating Voltage [kV]
}INCIDENT_BEAM
#
CALC_KXY_RANGE{
0     # cal_range_flag  [dummy: always 0]
2     # Calc. type [0:0D, 1:1D, 2:2D disk, 3:2D square]
101   # numh: number of calc. points  > 5  (total~sq(numh))
-1.0  1.0    # hbgn, hend
-1.0  1.0    # gbgn, gend
}CALC_KXY_RANGE
#
#
BEAM_SEARCH{
# Automatic beam search
2                  # Beam search [0:manual, 1:automatic-wg, 2:automatic-sg]
200  4.0  0  0     # num_g_limit, g_max[A^{-1}], lz_min, lz_max
0.02  0.03  1e+11  # sg_exact_max,  sg_bethe_max,  xi_g_max
}BEAM_SEARCH
#
COMMENT{  --------------------------------------------------
BEAM_SEARCH{
# Manual beam input
0     # Beam search method [0:manual, 1:auto[wg], 2:[sg]]
7  0  # num. of exact, num. of bethe
0    0    0  # hkl
2    -2    0
-2    2    0
2    0    -2
-2    0    2
0    2    -2
0    -2    2
}BEAM_SEARCH
}COMMENT  --------------------------------------------------
#
OUTPUT_REFLEX{
0  # Number of reflections to be calculated (0:all)
# indices hkl
#
}OUTPUT_REFLEX
OUTPUT_THICKNESS{
# Number of thicknesses for output
1
# thicknesses (in Angstrom units)
250
}OUTPUT_THICKNESS
}SIM_CALCULATION_CONDITION