Co#

import & prepare#

[1]:
!pip install git+https://github.com/nmdl-mizo/interface_master.git@develop
!mkdir -p cif_files
!curl https://raw.githubusercontent.com/nmdl-mizo/interface_master/develop/test_files/cif_files/Co_mp-54_conventional_standard.cif -o 'cif_files/Co_mp-54_conventional_standard.cif'
Defaulting to user installation because normal site-packages is not writeable
Collecting git+https://github.com/nmdl-mizo/interface_master.git@develop
  Cloning https://github.com/nmdl-mizo/interface_master.git (to revision develop) to /tmp/pip-req-build-lccafuui
  Running command git clone --filter=blob:none --quiet https://github.com/nmdl-mizo/interface_master.git /tmp/pip-req-build-lccafuui
  Resolved https://github.com/nmdl-mizo/interface_master.git to commit 2bdf96ed4835b036557ac18de82b4fa2afdabf24
  Preparing metadata (setup.py) ... done
Requirement already satisfied: pymatgen in /home/vscode/.local/lib/python3.10/site-packages (from interfacemaster==1.1.1) (2023.1.30)
Requirement already satisfied: matplotlib in /home/vscode/.local/lib/python3.10/site-packages (from interfacemaster==1.1.1) (3.7.0)
Requirement already satisfied: gb_code in /home/vscode/.local/lib/python3.10/site-packages (from interfacemaster==1.1.1) (1.0.0)
Requirement already satisfied: numpy>=1.14.0 in /home/vscode/.local/lib/python3.10/site-packages (from gb_code->interfacemaster==1.1.1) (1.24.2)
Requirement already satisfied: python-dateutil>=2.7 in /usr/local/lib/python3.10/site-packages (from matplotlib->interfacemaster==1.1.1) (2.8.2)
Requirement already satisfied: kiwisolver>=1.0.1 in /home/vscode/.local/lib/python3.10/site-packages (from matplotlib->interfacemaster==1.1.1) (1.4.4)
Requirement already satisfied: pyparsing>=2.3.1 in /home/vscode/.local/lib/python3.10/site-packages (from matplotlib->interfacemaster==1.1.1) (3.0.9)
Requirement already satisfied: contourpy>=1.0.1 in /home/vscode/.local/lib/python3.10/site-packages (from matplotlib->interfacemaster==1.1.1) (1.0.7)
Requirement already satisfied: cycler>=0.10 in /home/vscode/.local/lib/python3.10/site-packages (from matplotlib->interfacemaster==1.1.1) (0.11.0)
Requirement already satisfied: pillow>=6.2.0 in /home/vscode/.local/lib/python3.10/site-packages (from matplotlib->interfacemaster==1.1.1) (9.4.0)
Requirement already satisfied: packaging>=20.0 in /usr/local/lib/python3.10/site-packages (from matplotlib->interfacemaster==1.1.1) (23.0)
Requirement already satisfied: fonttools>=4.22.0 in /home/vscode/.local/lib/python3.10/site-packages (from matplotlib->interfacemaster==1.1.1) (4.38.0)
Requirement already satisfied: sympy in /home/vscode/.local/lib/python3.10/site-packages (from pymatgen->interfacemaster==1.1.1) (1.11.1)
Requirement already satisfied: spglib>=2.0.2 in /home/vscode/.local/lib/python3.10/site-packages (from pymatgen->interfacemaster==1.1.1) (2.0.2)
Requirement already satisfied: plotly>=4.5.0 in /home/vscode/.local/lib/python3.10/site-packages (from pymatgen->interfacemaster==1.1.1) (5.13.0)
Requirement already satisfied: palettable>=3.1.1 in /home/vscode/.local/lib/python3.10/site-packages (from pymatgen->interfacemaster==1.1.1) (3.3.0)
Requirement already satisfied: networkx>=2.2 in /home/vscode/.local/lib/python3.10/site-packages (from pymatgen->interfacemaster==1.1.1) (3.0)
Requirement already satisfied: ruamel.yaml>=0.17.0 in /home/vscode/.local/lib/python3.10/site-packages (from pymatgen->interfacemaster==1.1.1) (0.17.21)
Requirement already satisfied: monty>=3.0.2 in /home/vscode/.local/lib/python3.10/site-packages (from pymatgen->interfacemaster==1.1.1) (2022.9.9)
Requirement already satisfied: mp-api>=0.27.3 in /home/vscode/.local/lib/python3.10/site-packages (from pymatgen->interfacemaster==1.1.1) (0.30.10)
Requirement already satisfied: tabulate in /home/vscode/.local/lib/python3.10/site-packages (from pymatgen->interfacemaster==1.1.1) (0.9.0)
Requirement already satisfied: pybtex in /home/vscode/.local/lib/python3.10/site-packages (from pymatgen->interfacemaster==1.1.1) (0.24.0)
Requirement already satisfied: uncertainties>=3.1.4 in /home/vscode/.local/lib/python3.10/site-packages (from pymatgen->interfacemaster==1.1.1) (3.1.7)
Requirement already satisfied: pandas in /home/vscode/.local/lib/python3.10/site-packages (from pymatgen->interfacemaster==1.1.1) (1.5.3)
Requirement already satisfied: tqdm in /home/vscode/.local/lib/python3.10/site-packages (from pymatgen->interfacemaster==1.1.1) (4.64.1)
Requirement already satisfied: requests in /usr/local/lib/python3.10/site-packages (from pymatgen->interfacemaster==1.1.1) (2.28.2)
Requirement already satisfied: scipy>=1.5.0 in /home/vscode/.local/lib/python3.10/site-packages (from pymatgen->interfacemaster==1.1.1) (1.10.1)
Requirement already satisfied: msgpack in /home/vscode/.local/lib/python3.10/site-packages (from mp-api>=0.27.3->pymatgen->interfacemaster==1.1.1) (1.0.4)
Requirement already satisfied: setuptools in /usr/local/lib/python3.10/site-packages (from mp-api>=0.27.3->pymatgen->interfacemaster==1.1.1) (65.5.1)
Requirement already satisfied: typing-extensions>=3.7.4.1 in /home/vscode/.local/lib/python3.10/site-packages (from mp-api>=0.27.3->pymatgen->interfacemaster==1.1.1) (4.5.0)
Requirement already satisfied: emmet-core>=0.39.8 in /home/vscode/.local/lib/python3.10/site-packages (from mp-api>=0.27.3->pymatgen->interfacemaster==1.1.1) (0.44.0)
Requirement already satisfied: tenacity>=6.2.0 in /home/vscode/.local/lib/python3.10/site-packages (from plotly>=4.5.0->pymatgen->interfacemaster==1.1.1) (8.2.1)
Requirement already satisfied: six>=1.5 in /usr/local/lib/python3.10/site-packages (from python-dateutil>=2.7->matplotlib->interfacemaster==1.1.1) (1.16.0)
Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.10/site-packages (from requests->pymatgen->interfacemaster==1.1.1) (3.4)
Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.10/site-packages (from requests->pymatgen->interfacemaster==1.1.1) (2022.12.7)
Requirement already satisfied: charset-normalizer<4,>=2 in /usr/local/lib/python3.10/site-packages (from requests->pymatgen->interfacemaster==1.1.1) (3.0.1)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in /usr/local/lib/python3.10/site-packages (from requests->pymatgen->interfacemaster==1.1.1) (1.26.14)
Requirement already satisfied: ruamel.yaml.clib>=0.2.6 in /home/vscode/.local/lib/python3.10/site-packages (from ruamel.yaml>=0.17.0->pymatgen->interfacemaster==1.1.1) (0.2.7)
Requirement already satisfied: future in /home/vscode/.local/lib/python3.10/site-packages (from uncertainties>=3.1.4->pymatgen->interfacemaster==1.1.1) (0.18.3)
Requirement already satisfied: pytz>=2020.1 in /usr/local/lib/python3.10/site-packages (from pandas->pymatgen->interfacemaster==1.1.1) (2022.7.1)
Requirement already satisfied: latexcodec>=1.0.4 in /home/vscode/.local/lib/python3.10/site-packages (from pybtex->pymatgen->interfacemaster==1.1.1) (2.0.1)
Requirement already satisfied: PyYAML>=3.01 in /usr/local/lib/python3.10/site-packages (from pybtex->pymatgen->interfacemaster==1.1.1) (6.0)
Requirement already satisfied: mpmath>=0.19 in /home/vscode/.local/lib/python3.10/site-packages (from sympy->pymatgen->interfacemaster==1.1.1) (1.2.1)
Requirement already satisfied: pydantic>=1.10.2 in /home/vscode/.local/lib/python3.10/site-packages (from emmet-core>=0.39.8->mp-api>=0.27.3->pymatgen->interfacemaster==1.1.1) (1.10.5)

[notice] A new release of pip available: 22.3.1 -> 23.0.1
[notice] To update, run: pip install --upgrade pip
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   747  100   747    0     0   2575      0 --:--:-- --:--:-- --:--:--  2575
[30]:
from interfacemaster.cellcalc import get_primitive_hkl, get_normal_from_MI, MID, rot
from interfacemaster.interface_generator import core, convert_vector_index, get_disorientation
from numpy import array, dot, round, var, average, ceil, pi
from numpy.linalg import inv,norm

Define an interface core class#

Input two cif files.For GBs, input the same file; for interfaces, input two different files.

The first structure is non-changed while the second one can be deformed to form an approximate CSL

Please input files of CONVENTIONAL cells if you are not familiar with the indices in the primitive cell.

[11]:
my_interface = core('cif_files/Co_mp-54_conventional_standard.cif',\
                    'cif_files/Co_mp-54_conventional_standard.cif')
Warning!, this programme will rewrite the POSCAR file in this dir!
/Users/jasonxie/.local/lib/python3.8/site-packages/pymatgen/io/cif.py:1121: UserWarning: Issues encountered while parsing CIF: Some fractional co-ordinates rounded to ideal values to avoid issues with finite precision.
  warnings.warn("Issues encountered while parsing CIF: %s" % "\n".join(self.warnings))
[3]:
#my_interface.atoms_2 = [1,1,1] - my_interface.atoms_2
[1]:
from symmetric_tilt_co_111 import sample_STGB
[2]:
thetas, sigmas, hkls = sample_STGB([1,1,1], 10, 100, 10)
60.000000003954064
Warning!, this programme will rewrite the POSCAR file in this dir!
Congrates, we found an appx CSL!

U1 =
[[ 0  1  0]
 [-1  1  0]
 [ 0  0  1]]; sigma_1 = 1

U2 =
[[1 0 0]
 [0 1 0]
 [0 0 1]]; sigma_2 = 1

D =
[[1. 0. 0.]
 [0. 1. 0.]
 [0. 0. 1.]]

38.21321070399773
Warning!, this programme will rewrite the POSCAR file in this dir!
/Users/jasonxie/.local/lib/python3.8/site-packages/pymatgen/io/cif.py:1121: UserWarning: Issues encountered while parsing CIF: Some fractional co-ordinates rounded to ideal values to avoid issues with finite precision.
  warnings.warn("Issues encountered while parsing CIF: %s" % "\n".join(self.warnings))
Congrates, we found an appx CSL!

U1 =
[[ 0  2  1]
 [ 0 -1  3]
 [ 1  0  0]]; sigma_1 = 7

U2 =
[[ 0  3 -1]
 [ 0  1  2]
 [ 1  0  0]]; sigma_2 = 7

D =
[[1. 0. 0.]
 [0. 1. 0.]
 [0. 0. 1.]]

46.82644889565461
Warning!, this programme will rewrite the POSCAR file in this dir!
Congrates, we found an appx CSL!

U1 =
[[ 0  2 -5]
 [ 0  5 -3]
 [ 1  0  0]]; sigma_1 = 19

U2 =
[[ 0 -2 -3]
 [ 0  3 -5]
 [ 1  0  0]]; sigma_2 = 19

D =
[[1. 0. 0.]
 [0. 1. 0.]
 [0. 0. 1.]]

50.56999209530953
Warning!, this programme will rewrite the POSCAR file in this dir!
Congrates, we found an appx CSL!

U1 =
[[ 0  3 -4]
 [ 0  7  3]
 [ 1  0  0]]; sigma_1 = 37

U2 =
[[ 0 -3 -7]
 [ 0  4 -3]
 [ 1  0  0]]; sigma_2 = 37

D =
[[1. 0. 0.]
 [0. 1. 0.]
 [0. 0. 1.]]

52.65900698674047
Warning!, this programme will rewrite the POSCAR file in this dir!
Congrates, we found an appx CSL!

U1 =
[[ 0  4 -9]
 [ 0  9 -5]
 [ 1  0  0]]; sigma_1 = 61

U2 =
[[ 0 -4 -5]
 [ 0  5 -9]
 [ 1  0  0]]; sigma_2 = 61

D =
[[1. 0. 0.]
 [0. 1. 0.]
 [0. 0. 1.]]

53.991016805709926
Warning!, this programme will rewrite the POSCAR file in this dir!
Congrates, we found an appx CSL!

U1 =
[[ 0  5 -6]
 [ 0 11  5]
 [ 1  0  0]]; sigma_1 = 91

U2 =
[[  0  -5 -11]
 [  0   6  -5]
 [  1   0   0]]; sigma_2 = 91

D =
[[1. 0. 0.]
 [0. 1. 0.]
 [0. 0. 1.]]

54.91415219542585
Warning!, this programme will rewrite the POSCAR file in this dir!
Congrates, we found an appx CSL!

U1 =
[[ 0  6 -7]
 [ 0 13  6]
 [ 1  0  0]]; sigma_1 = 127

U2 =
[[  0  -6 -13]
 [  0   7  -6]
 [  1   0   0]]; sigma_2 = 127

D =
[[1. 0. 0.]
 [0. 1. 0.]
 [0. 0. 1.]]

55.59154499565904
Warning!, this programme will rewrite the POSCAR file in this dir!
Congrates, we found an appx CSL!

U1 =
[[ 0  7 -8]
 [ 0 15  7]
 [ 1  0  0]]; sigma_1 = 169

U2 =
[[  0  -7 -15]
 [  0   8  -7]
 [  1   0   0]]; sigma_2 = 169

D =
[[1. 0. 0.]
 [0. 1. 0.]
 [0. 0. 1.]]

56.10976183463665
Warning!, this programme will rewrite the POSCAR file in this dir!
Congrates, we found an appx CSL!

U1 =
[[  0   8 -17]
 [  0  17  -9]
 [  1   0   0]]; sigma_1 = 217

U2 =
[[  0  -8  -9]
 [  0   9 -17]
 [  1   0   0]]; sigma_2 = 217

D =
[[1. 0. 0.]
 [0. 1. 0.]
 [0. 0. 1.]]

56.51899391420982
Warning!, this programme will rewrite the POSCAR file in this dir!
Congrates, we found an appx CSL!

U1 =
[[  0   9 -10]
 [  0  19   9]
 [  1   0   0]]; sigma_1 = 271

U2 =
[[  0  -9 -19]
 [  0  10  -9]
 [  1   0   0]]; sigma_2 = 271

D =
[[1. 0. 0.]
 [0. 1. 0.]
 [0. 0. 1.]]

56.85034257731358
Warning!, this programme will rewrite the POSCAR file in this dir!
Congrates, we found an appx CSL!

U1 =
[[  0  10 -21]
 [  0  21 -11]
 [  1   0   0]]; sigma_1 = 331

U2 =
[[  0 -10 -11]
 [  0  11 -21]
 [  1   0   0]]; sigma_2 = 331

D =
[[1. 0. 0.]
 [0. 1. 0.]
 [0. 0. 1.]]

27.795772497548864
Warning!, this programme will rewrite the POSCAR file in this dir!
Congrates, we found an appx CSL!

U1 =
[[ 0  3  1]
 [ 0 -1  4]
 [ 1  0  0]]; sigma_1 = 13

U2 =
[[ 0  4 -1]
 [ 0  1  3]
 [ 1  0  0]]; sigma_2 = 13

D =
[[1. 0. 0.]
 [0. 1. 0.]
 [0. 0. 1.]]

43.573578599186526
Warning!, this programme will rewrite the POSCAR file in this dir!
Congrates, we found an appx CSL!

U1 =
[[ 0 -5 -8]
 [ 0  3 -5]
 [ 1  0  0]]; sigma_1 = 49

U2 =
[[ 0 -8 -5]
 [ 0 -3 -8]
 [ 1  0  0]]; sigma_2 = 49

D =
[[1. 0. 0.]
 [0. 1. 0.]
 [0. 0. 1.]]

49.007266913774274
Warning!, this programme will rewrite the POSCAR file in this dir!
Congrates, we found an appx CSL!

U1 =
[[  0   5 -12]
 [  0  12  -7]
 [  1   0   0]]; sigma_1 = 109

U2 =
[[  0  -5  -7]
 [  0   7 -12]
 [  1   0   0]]; sigma_2 = 109

D =
[[1. 0. 0.]
 [0. 1. 0.]
 [0. 0. 1.]]

51.74437939427305
Warning!, this programme will rewrite the POSCAR file in this dir!
Congrates, we found an appx CSL!

U1 =
[[  0   7 -16]
 [  0  16  -9]
 [  1   0   0]]; sigma_1 = 193

U2 =
[[  0  -7  -9]
 [  0   9 -16]
 [  1   0   0]]; sigma_2 = 193

D =
[[1. 0. 0.]
 [0. 1. 0.]
 [0. 0. 1.]]

53.39138964311669
Warning!, this programme will rewrite the POSCAR file in this dir!
Congrates, we found an appx CSL!

U1 =
[[  0   9 -20]
 [  0  20 -11]
 [  1   0   0]]; sigma_1 = 301

U2 =
[[  0  -9 -11]
 [  0  11 -20]
 [  1   0   0]]; sigma_2 = 301

D =
[[1. 0. 0.]
 [0. 1. 0.]
 [0. 0. 1.]]

21.786789299391558
Warning!, this programme will rewrite the POSCAR file in this dir!
Congrates, we found an appx CSL!

U1 =
[[ 0 -1 -2]
 [ 0  2 -3]
 [ 1  0  0]]; sigma_1 = 7

U2 =
[[ 0 -2 -1]
 [ 0  1 -3]
 [ 1  0  0]]; sigma_2 = 7

D =
[[1. 0. 0.]
 [0. 1. 0.]
 [0. 0. 1.]]

32.20422750579693
Warning!, this programme will rewrite the POSCAR file in this dir!
Congrates, we found an appx CSL!

U1 =
[[ 0 -1 -3]
 [ 0  3 -4]
 [ 1  0  0]]; sigma_1 = 13

U2 =
[[ 0 -3 -1]
 [ 0  1 -4]
 [ 1  0  0]]; sigma_2 = 13

D =
[[1. 0. 0.]
 [0. 1. 0.]
 [0. 0. 1.]]

42.10344887329685
Warning!, this programme will rewrite the POSCAR file in this dir!
Congrates, we found an appx CSL!

U1 =
[[ 0 -1 -5]
 [ 0  5 -6]
 [ 1  0  0]]; sigma_1 = 31

U2 =
[[ 0 -5 -1]
 [ 0  1 -6]
 [ 1  0  0]]; sigma_2 = 31

D =
[[1. 0. 0.]
 [0. 1. 0.]
 [0. 0. 1.]]

44.821821064808795
Warning!, this programme will rewrite the POSCAR file in this dir!
Congrates, we found an appx CSL!

U1 =
[[ 0 -1 -6]
 [ 0  6 -7]
 [ 1  0  0]]; sigma_1 = 43

U2 =
[[ 0 -6 -1]
 [ 0  1 -7]
 [ 1  0  0]]; sigma_2 = 43

D =
[[1. 0. 0.]
 [0. 1. 0.]
 [0. 0. 1.]]

48.36494871414609
Warning!, this programme will rewrite the POSCAR file in this dir!
Congrates, we found an appx CSL!

U1 =
[[ 0 -1 -8]
 [ 0  8 -9]
 [ 1  0  0]]; sigma_1 = 73

U2 =
[[ 0 -8 -1]
 [ 0  1 -9]
 [ 1  0  0]]; sigma_2 = 73

D =
[[1. 0. 0.]
 [0. 1. 0.]
 [0. 0. 1.]]

49.582561797418286
Warning!, this programme will rewrite the POSCAR file in this dir!
Congrates, we found an appx CSL!

U1 =
[[  0  -1  -9]
 [  0   9 -10]
 [  1   0   0]]; sigma_1 = 91

U2 =
[[  0  -9  -1]
 [  0   1 -10]
 [  1   0   0]]; sigma_2 = 91

D =
[[1. 0. 0.]
 [0. 1. 0.]
 [0. 0. 1.]]

51.38676181226738
Warning!, this programme will rewrite the POSCAR file in this dir!
Congrates, we found an appx CSL!

U1 =
[[  0  -1 -11]
 [  0  11 -12]
 [  1   0   0]]; sigma_1 = 133

U2 =
[[  0 -11  -1]
 [  0   1 -12]
 [  1   0   0]]; sigma_2 = 133

D =
[[1. 0. 0.]
 [0. 1. 0.]
 [0. 0. 1.]]

17.896551130147028
Warning!, this programme will rewrite the POSCAR file in this dir!
Congrates, we found an appx CSL!

U1 =
[[ 0  5  1]
 [ 0 -1  6]
 [ 1  0  0]]; sigma_1 = 31

U2 =
[[ 0  6 -1]
 [ 0  1  5]
 [ 1  0  0]]; sigma_2 = 31

D =
[[1. 0. 0.]
 [0. 1. 0.]
 [0. 0. 1.]]

33.9921761163064
Warning!, this programme will rewrite the POSCAR file in this dir!
Congrates, we found an appx CSL!

U1 =
[[ 0  7 10]
 [ 0 -3  7]
 [ 1  0  0]]; sigma_1 = 79

U2 =
[[ 0 10  7]
 [ 0  3 10]
 [ 1  0  0]]; sigma_2 = 79

D =
[[1. 0. 0.]
 [0. 1. 0.]
 [0. 0. 1.]]

41.26600216913314
Warning!, this programme will rewrite the POSCAR file in this dir!
Congrates, we found an appx CSL!

U1 =
[[  0  -9  -5]
 [  0   5 -14]
 [  1   0   0]]; sigma_1 = 151

U2 =
[[  0 -14   5]
 [  0  -5  -9]
 [  1   0   0]]; sigma_2 = 151

D =
[[1. 0. 0.]
 [0. 1. 0.]
 [0. 0. 1.]]

45.37777861403241
Warning!, this programme will rewrite the POSCAR file in this dir!
Congrates, we found an appx CSL!

U1 =
[[  0  -7  18]
 [  0 -18  11]
 [  1   0   0]]; sigma_1 = 247

U2 =
[[  0   7  11]
 [  0 -11  18]
 [  1   0   0]]; sigma_2 = 247

D =
[[1. 0. 0.]
 [0. 1. 0.]
 [0. 0. 1.]]

48.01489971062141
Warning!, this programme will rewrite the POSCAR file in this dir!
Congrates, we found an appx CSL!

U1 =
[[  0   9 -22]
 [  0  22 -13]
 [  1   0   0]]; sigma_1 = 367

U2 =
[[  0  -9 -13]
 [  0  13 -22]
 [  1   0   0]]; sigma_2 = 367

D =
[[1. 0. 0.]
 [0. 1. 0.]
 [0. 0. 1.]]

15.178178938685548
Warning!, this programme will rewrite the POSCAR file in this dir!
Congrates, we found an appx CSL!

U1 =
[[ 0  6  7]
 [ 0 -1  6]
 [ 1  0  0]]; sigma_1 = 43

U2 =
[[0 7 6]
 [0 1 7]
 [1 0 0]]; sigma_2 = 43

D =
[[1. 0. 0.]
 [0. 1. 0.]
 [0. 0. 1.]]

24.43269768075289
Warning!, this programme will rewrite the POSCAR file in this dir!
Congrates, we found an appx CSL!

U1 =
[[ 0  7  2]
 [ 0 -2  9]
 [ 1  0  0]]; sigma_1 = 67

U2 =
[[ 0  9 -2]
 [ 0  2  7]
 [ 1  0  0]]; sigma_2 = 67

D =
[[1. 0. 0.]
 [0. 1. 0.]
 [0. 0. 1.]]

30.59068860452153
Warning!, this programme will rewrite the POSCAR file in this dir!
Congrates, we found an appx CSL!

U1 =
[[  0  -8 -11]
 [  0   3  -8]
 [  1   0   0]]; sigma_1 = 97

U2 =
[[  0 -11  -8]
 [  0  -3 -11]
 [  1   0   0]]; sigma_2 = 97

D =
[[1. 0. 0.]
 [0. 1. 0.]
 [0. 0. 1.]]

34.960340407542425
Warning!, this programme will rewrite the POSCAR file in this dir!
Congrates, we found an appx CSL!

U1 =
[[ 0  9  4]
 [ 0 -4 13]
 [ 1  0  0]]; sigma_1 = 133

U2 =
[[ 0 13 -4]
 [ 0  4  9]
 [ 1  0  0]]; sigma_2 = 133

D =
[[1. 0. 0.]
 [0. 1. 0.]
 [0. 0. 1.]]

40.72519309888428
Warning!, this programme will rewrite the POSCAR file in this dir!
Congrates, we found an appx CSL!

U1 =
[[  0 -11  -6]
 [  0   6 -17]
 [  1   0   0]]; sigma_1 = 223

U2 =
[[  0 -17   6]
 [  0  -6 -11]
 [  1   0   0]]; sigma_2 = 223

D =
[[1. 0. 0.]
 [0. 1. 0.]
 [0. 0. 1.]]

42.72175565271277
Warning!, this programme will rewrite the POSCAR file in this dir!
Congrates, we found an appx CSL!

U1 =
[[ 0 12 19]
 [ 0 -7 12]
 [ 1  0  0]]; sigma_1 = 277

U2 =
[[ 0 19 12]
 [ 0  7 19]
 [ 1  0  0]]; sigma_2 = 277

D =
[[1. 0. 0.]
 [0. 1. 0.]
 [0. 0. 1.]]

44.3458564102037
Warning!, this programme will rewrite the POSCAR file in this dir!
Congrates, we found an appx CSL!

U1 =
[[  0 -13 -21]
 [  0   8 -13]
 [  1   0   0]]; sigma_1 = 337

U2 =
[[  0 -21 -13]
 [  0  -8 -21]
 [  1   0   0]]; sigma_2 = 337

D =
[[1. 0. 0.]
 [0. 1. 0.]
 [0. 0. 1.]]

45.6923236281079
Warning!, this programme will rewrite the POSCAR file in this dir!
Congrates, we found an appx CSL!

U1 =
[[  0  -9  23]
 [  0 -23  14]
 [  1   0   0]]; sigma_1 = 403

U2 =
[[  0   9  14]
 [  0 -14  23]
 [  1   0   0]]; sigma_2 = 403

D =
[[1. 0. 0.]
 [0. 1. 0.]
 [0. 0. 1.]]

13.173551107883242
Warning!, this programme will rewrite the POSCAR file in this dir!
Congrates, we found an appx CSL!

U1 =
[[ 0  2  3]
 [ 0 -3  5]
 [ 1  0  0]]; sigma_1 = 19

U2 =
[[ 0  3  2]
 [ 0 -2  5]
 [ 1  0  0]]; sigma_2 = 19

D =
[[1. 0. 0.]
 [0. 1. 0.]
 [0. 0. 1.]]

35.56730232261096
Warning!, this programme will rewrite the POSCAR file in this dir!
Congrates, we found an appx CSL!

U1 =
[[ 0  2  9]
 [ 0 -7  2]
 [ 1  0  0]]; sigma_1 = 67

U2 =
[[ 0  7  9]
 [ 0 -2  7]
 [ 1  0  0]]; sigma_2 = 67

D =
[[1. 0. 0.]
 [0. 1. 0.]
 [0. 0. 1.]]

40.34714037075397
Warning!, this programme will rewrite the POSCAR file in this dir!
Congrates, we found an appx CSL!

U1 =
[[ 0  2  9]
 [ 0 -9 11]
 [ 1  0  0]]; sigma_1 = 103

U2 =
[[ 0  9  2]
 [ 0 -2 11]
 [ 1  0  0]]; sigma_2 = 103

D =
[[1. 0. 0.]
 [0. 1. 0.]
 [0. 0. 1.]]

11.635051289428839
Warning!, this programme will rewrite the POSCAR file in this dir!
Congrates, we found an appx CSL!

U1 =
[[ 0  8  1]
 [ 0 -1  9]
 [ 1  0  0]]; sigma_1 = 73

U2 =
[[ 0  9 -1]
 [ 0  1  8]
 [ 1  0  0]]; sigma_2 = 73

D =
[[1. 0. 0.]
 [0. 1. 0.]
 [0. 0. 1.]]

19.652859632662715
Warning!, this programme will rewrite the POSCAR file in this dir!
Congrates, we found an appx CSL!

U1 =
[[ 0  9 11]
 [ 0 -2  9]
 [ 1  0  0]]; sigma_1 = 103

U2 =
[[ 0 11  9]
 [ 0  2 11]
 [ 1  0  0]]; sigma_2 = 103

D =
[[1. 0. 0.]
 [0. 1. 0.]
 [0. 0. 1.]]

25.461055578162068
Warning!, this programme will rewrite the POSCAR file in this dir!
Congrates, we found an appx CSL!

U1 =
[[ 0 10 13]
 [ 0 -3 10]
 [ 1  0  0]]; sigma_1 = 139

U2 =
[[ 0 13 10]
 [ 0  3 13]
 [ 1  0  0]]; sigma_2 = 139

D =
[[1. 0. 0.]
 [0. 1. 0.]
 [0. 0. 1.]]

29.841724166344697
Warning!, this programme will rewrite the POSCAR file in this dir!
Congrates, we found an appx CSL!

U1 =
[[  0 -11 -15]
 [  0   4 -11]
 [  1   0   0]]; sigma_1 = 181

U2 =
[[  0 -15 -11]
 [  0  -4 -15]
 [  1   0   0]]; sigma_2 = 181

D =
[[1. 0. 0.]
 [0. 1. 0.]
 [0. 0. 1.]]

33.25434838566584
Warning!, this programme will rewrite the POSCAR file in this dir!
Congrates, we found an appx CSL!

U1 =
[[ 0 12 17]
 [ 0 -5 12]
 [ 1  0  0]]; sigma_1 = 229

U2 =
[[ 0 17 12]
 [ 0  5 17]
 [ 1  0  0]]; sigma_2 = 229

D =
[[1. 0. 0.]
 [0. 1. 0.]
 [0. 0. 1.]]

35.98339777345344
Warning!, this programme will rewrite the POSCAR file in this dir!
Congrates, we found an appx CSL!

U1 =
[[ 0 13 19]
 [ 0 -6 13]
 [ 1  0  0]]; sigma_1 = 283

U2 =
[[ 0 19 13]
 [ 0  6 19]
 [ 1  0  0]]; sigma_2 = 283

D =
[[1. 0. 0.]
 [0. 1. 0.]
 [0. 0. 1.]]

40.067987051841655
Warning!, this programme will rewrite the POSCAR file in this dir!
Congrates, we found an appx CSL!

U1 =
[[  0 -15  -8]
 [  0   8 -23]
 [  1   0   0]]; sigma_1 = 409

U2 =
[[  0 -23   8]
 [  0  -8 -15]
 [  1   0   0]]; sigma_2 = 409

D =
[[1. 0. 0.]
 [0. 1. 0.]
 [0. 0. 1.]]

41.63423541438396
Warning!, this programme will rewrite the POSCAR file in this dir!
Congrates, we found an appx CSL!

U1 =
[[ 0 16 25]
 [ 0 -9 16]
 [ 1  0  0]]; sigma_1 = 481

U2 =
[[ 0 25 16]
 [ 0  9 25]
 [ 1  0  0]]; sigma_2 = 481

D =
[[1. 0. 0.]
 [0. 1. 0.]
 [0. 0. 1.]]

42.97395143659504
Warning!, this programme will rewrite the POSCAR file in this dir!
Congrates, we found an appx CSL!

U1 =
[[  0  17  10]
 [  0 -10  27]
 [  1   0   0]]; sigma_1 = 559

U2 =
[[  0  27 -10]
 [  0  10  17]
 [  1   0   0]]; sigma_2 = 559

D =
[[1. 0. 0.]
 [0. 1. 0.]
 [0. 0. 1.]]

10.417438206188187
Warning!, this programme will rewrite the POSCAR file in this dir!
Congrates, we found an appx CSL!

U1 =
[[ 0  9  1]
 [ 0 -1 10]
 [ 1  0  0]]; sigma_1 = 91

U2 =
[[ 0 10 -1]
 [ 0  1  9]
 [ 1  0  0]]; sigma_2 = 91

D =
[[1. 0. 0.]
 [0. 1. 0.]
 [0. 0. 1.]]

23.48306199301877
Warning!, this programme will rewrite the POSCAR file in this dir!
Congrates, we found an appx CSL!

U1 =
[[  0 -11 -14]
 [  0   3 -11]
 [  1   0   0]]; sigma_1 = 163

U2 =
[[  0 -14 -11]
 [  0  -3 -14]
 [  1   0   0]]; sigma_2 = 163

D =
[[1. 0. 0.]
 [0. 1. 0.]
 [0. 0. 1.]]

31.216797207913945
Warning!, this programme will rewrite the POSCAR file in this dir!
Congrates, we found an appx CSL!

U1 =
[[  0 -13 -18]
 [  0   5 -13]
 [  1   0   0]]; sigma_1 = 259

U2 =
[[  0 -18 -13]
 [  0  -5 -18]
 [  1   0   0]]; sigma_2 = 259

D =
[[1. 0. 0.]
 [0. 1. 0.]
 [0. 0. 1.]]

36.28641752878408
Warning!, this programme will rewrite the POSCAR file in this dir!
Congrates, we found an appx CSL!

U1 =
[[ 0 15 22]
 [ 0 -7 15]
 [ 1  0  0]]; sigma_1 = 379

U2 =
[[ 0 22 15]
 [ 0  7 22]
 [ 1  0  0]]; sigma_2 = 379

D =
[[1. 0. 0.]
 [0. 1. 0.]
 [0. 0. 1.]]

39.853416056816506
Warning!, this programme will rewrite the POSCAR file in this dir!
Congrates, we found an appx CSL!

U1 =
[[  0 -17 -26]
 [  0   9 -17]
 [  1   0   0]]; sigma_1 = 523

U2 =
[[  0 -26 -17]
 [  0  -9 -26]
 [  1   0   0]]; sigma_2 = 523

D =
[[1. 0. 0.]
 [0. 1. 0.]
 [0. 0. 1.]]

9.430007908324026
Warning!, this programme will rewrite the POSCAR file in this dir!
Congrates, we found an appx CSL!

U1 =
[[ 0  3  7]
 [ 0 -4  3]
 [ 1  0  0]]; sigma_1 = 37

U2 =
[[ 0  4  7]
 [ 0 -3  4]
 [ 1  0  0]]; sigma_2 = 37

D =
[[1. 0. 0.]
 [0. 1. 0.]
 [0. 0. 1.]]

16.426421404283587
Warning!, this programme will rewrite the POSCAR file in this dir!
Congrates, we found an appx CSL!

U1 =
[[ 0 -3 -8]
 [ 0  5 -3]
 [ 1  0  0]]; sigma_1 = 49

U2 =
[[ 0 -5 -8]
 [ 0  3 -5]
 [ 1  0  0]]; sigma_2 = 49

D =
[[1. 0. 0.]
 [0. 1. 0.]
 [0. 0. 1.]]

26.00782388704711
Warning!, this programme will rewrite the POSCAR file in this dir!
Congrates, we found an appx CSL!

U1 =
[[ 0  3 10]
 [ 0 -7  3]
 [ 1  0  0]]; sigma_1 = 79

U2 =
[[ 0  7 10]
 [ 0 -3  7]
 [ 1  0  0]]; sigma_2 = 79

D =
[[1. 0. 0.]
 [0. 1. 0.]
 [0. 0. 1.]]

29.40931139882104
Warning!, this programme will rewrite the POSCAR file in this dir!
Congrates, we found an appx CSL!

U1 =
[[  0  -3  -8]
 [  0   8 -11]
 [  1   0   0]]; sigma_1 = 97

U2 =
[[  0  -8  -3]
 [  0   3 -11]
 [  1   0   0]]; sigma_2 = 97

D =
[[1. 0. 0.]
 [0. 1. 0.]
 [0. 0. 1.]]

34.53894442519475
Warning!, this programme will rewrite the POSCAR file in this dir!
Congrates, we found an appx CSL!

U1 =
[[  0   3  13]
 [  0 -10   3]
 [  1   0   0]]; sigma_1 = 139

U2 =
[[ 0 10 13]
 [ 0 -3 10]
 [ 1  0  0]]; sigma_2 = 139

D =
[[1. 0. 0.]
 [0. 1. 0.]
 [0. 0. 1.]]

36.516938010353115
Warning!, this programme will rewrite the POSCAR file in this dir!
Congrates, we found an appx CSL!

U1 =
[[  0  -3 -14]
 [  0  11  -3]
 [  1   0   0]]; sigma_1 = 163

U2 =
[[  0 -11 -14]
 [  0   3 -11]
 [  1   0   0]]; sigma_2 = 163

D =
[[1. 0. 0.]
 [0. 1. 0.]
 [0. 0. 1.]]

39.68334042988478
Warning!, this programme will rewrite the POSCAR file in this dir!
Congrates, we found an appx CSL!

U1 =
[[  0   3  16]
 [  0 -13   3]
 [  1   0   0]]; sigma_1 = 217

U2 =
[[ 0 13 16]
 [ 0 -3 13]
 [ 1  0  0]]; sigma_2 = 217

D =
[[1. 0. 0.]
 [0. 1. 0.]
 [0. 0. 1.]]

Warning!, this programme will rewrite the POSCAR file in this dir!
Warning!, this programme will rewrite the POSCAR file in this dir!
Warning!, this programme will rewrite the POSCAR file in this dir!
Warning!, this programme will rewrite the POSCAR file in this dir!
Warning!, this programme will rewrite the POSCAR file in this dir!
Warning!, this programme will rewrite the POSCAR file in this dir!
Warning!, this programme will rewrite the POSCAR file in this dir!
Warning!, this programme will rewrite the POSCAR file in this dir!
Warning!, this programme will rewrite the POSCAR file in this dir!
Warning!, this programme will rewrite the POSCAR file in this dir!
Warning!, this programme will rewrite the POSCAR file in this dir!
Warning!, this programme will rewrite the POSCAR file in this dir!
Warning!, this programme will rewrite the POSCAR file in this dir!
Warning!, this programme will rewrite the POSCAR file in this dir!
Warning!, this programme will rewrite the POSCAR file in this dir!
Warning!, this programme will rewrite the POSCAR file in this dir!
Warning!, this programme will rewrite the POSCAR file in this dir!
Warning!, this programme will rewrite the POSCAR file in this dir!
Warning!, this programme will rewrite the POSCAR file in this dir!
Warning!, this programme will rewrite the POSCAR file in this dir!
Warning!, this programme will rewrite the POSCAR file in this dir!
Warning!, this programme will rewrite the POSCAR file in this dir!
Warning!, this programme will rewrite the POSCAR file in this dir!
Warning!, this programme will rewrite the POSCAR file in this dir!
Warning!, this programme will rewrite the POSCAR file in this dir!
Warning!, this programme will rewrite the POSCAR file in this dir!
Warning!, this programme will rewrite the POSCAR file in this dir!
[7]:
hkls
[7]:
array([[ 9, -8,  0],
       [ 8, -7,  0],
       [ 7, -6,  0],
       [ 6, -5,  0],
       [ 5, -4,  0],
       [ 9, -7,  0],
       [ 4, -3,  0],
       [ 7, -5,  0],
       [ 3, -2,  0],
       [ 8, -5,  0],
       [ 5, -3,  0],
       [ 7, -4,  0],
       [ 9, -5,  0],
       [ 2, -1,  0]])
[13]:
my_interface.conv_lattice_1[:,0] +  my_interface.conv_lattice_1[:,1]
[13]:
array([1.25039190e+00, 2.16574230e+00, 3.06257688e-16])
[39]:
#get the rotation mtx
import os
os.mkdir('co<001>tst_GBs_POSCAR')
[35]:
thetas/pi * 180
[35]:
array([11.63505129, 13.17355111, 15.17817894, 17.89655113, 21.7867893 ,
       24.43269768, 27.7957725 , 32.20422751, 38.2132107 , 43.5735786 ,
       46.8264489 , 50.5699921 , 52.65900699, 60.        ])
[36]:
small_thetas = thetas[thetas/pi * 180 < 30]
[41]:
for i in range(len(small_thetas)):
    R = rot([0,0,1], small_thetas[i])
    hkl1 = get_primitive_hkl(C_lattice = my_interface.conv_lattice_1, P_lattice = my_interface.lattice_1, hkl=[0,0,1])
    my_interface.search_fixed(R, exact = True)
    my_interface.compute_bicrystal(hkl1, plane_ortho=True, normal_ortho= True, lim = 50, tol_ortho = 1e-3)
    x_dimension = ceil(70/norm(dot(my_interface.lattice_1,my_interface.bicrystal_U1)[:,0]))
    hkl2 = get_primitive_hkl(C_lattice = my_interface.conv_lattice_1, P_lattice = dot(R, my_interface.conv_lattice_1), hkl = hkls[i])
    my_interface.get_bicrystal(xyz_1 = [x_dimension,1,1], \
                                   xyz_2 = [x_dimension,1,1], \
                               filename = 'co<001>tst_GBs_POSCAR/sigma{0}'.\
                               format(sigmas[i]),filetype='VASP')
Congrates, we found an appx CSL!

U1 =
[[ 0  8  1]
 [ 0 -1  9]
 [ 1  0  0]]; sigma_1 = 73

U2 =
[[ 0  9 -1]
 [ 0  1  8]
 [ 1  0  0]]; sigma_2 = 73

D =
[[1. 0. 0.]
 [0. 1. 0.]
 [0. 0. 1.]]

cell 1:
[[ 0 -1 17]
 [ 0 -9  7]
 [ 1  0  0]]
cell 2:
[[ 0  1 17]
 [ 0 -8 10]
 [ 1  0  0]]
Congrates, we found an appx CSL!

U1 =
[[ 0  2  3]
 [ 0 -3  5]
 [ 1  0  0]]; sigma_1 = 19

U2 =
[[ 0  3  2]
 [ 0 -2  5]
 [ 1  0  0]]; sigma_2 = 19

D =
[[1. 0. 0.]
 [0. 1. 0.]
 [0. 0. 1.]]

cell 1:
[[ 0 -3 -7]
 [ 0 -5  1]
 [-1  0  0]]
cell 2:
[[ 0 -2 -8]
 [ 0 -5 -1]
 [-1  0  0]]
Congrates, we found an appx CSL!

U1 =
[[ 0  6  7]
 [ 0 -1  6]
 [ 1  0  0]]; sigma_1 = 43

U2 =
[[0 7 6]
 [0 1 7]
 [1 0 0]]; sigma_2 = 43

D =
[[1. 0. 0.]
 [0. 1. 0.]
 [0. 0. 1.]]

cell 1:
[[ 0 -1 13]
 [ 0 -7  5]
 [ 1  0  0]]
cell 2:
[[ 0  1 13]
 [ 0 -6  8]
 [ 1  0  0]]
Congrates, we found an appx CSL!

U1 =
[[ 0  5  1]
 [ 0 -1  6]
 [ 1  0  0]]; sigma_1 = 31

U2 =
[[ 0  6 -1]
 [ 0  1  5]
 [ 1  0  0]]; sigma_2 = 31

D =
[[1. 0. 0.]
 [0. 1. 0.]
 [0. 0. 1.]]

cell 1:
[[  0  -1 -11]
 [  0  -6  -4]
 [ -1   0   0]]
cell 2:
[[  0   1 -11]
 [  0  -5  -7]
 [ -1   0   0]]
Congrates, we found an appx CSL!

U1 =
[[ 0 -1 -2]
 [ 0  2 -3]
 [ 1  0  0]]; sigma_1 = 7

U2 =
[[ 0 -2 -1]
 [ 0  1 -3]
 [ 1  0  0]]; sigma_2 = 7

D =
[[1. 0. 0.]
 [0. 1. 0.]
 [0. 0. 1.]]

cell 1:
[[ 0  2  4]
 [ 0  3 -1]
 [-1  0  0]]
cell 2:
[[ 0  1  5]
 [ 0  3  1]
 [-1  0  0]]
Congrates, we found an appx CSL!

U1 =
[[ 0  7  2]
 [ 0 -2  9]
 [ 1  0  0]]; sigma_1 = 67

U2 =
[[ 0  9 -2]
 [ 0  2  7]
 [ 1  0  0]]; sigma_2 = 67

D =
[[1. 0. 0.]
 [0. 1. 0.]
 [0. 0. 1.]]

cell 1:
[[ 0 -2 16]
 [ 0 -9  5]
 [ 1  0  0]]
cell 2:
[[ 0  2 16]
 [ 0 -7 11]
 [ 1  0  0]]
Congrates, we found an appx CSL!

U1 =
[[ 0  3  1]
 [ 0 -1  4]
 [ 1  0  0]]; sigma_1 = 13

U2 =
[[ 0  4 -1]
 [ 0  1  3]
 [ 1  0  0]]; sigma_2 = 13

D =
[[1. 0. 0.]
 [0. 1. 0.]
 [0. 0. 1.]]

cell 1:
[[ 0 -1 -7]
 [ 0 -4 -2]
 [-1  0  0]]
cell 2:
[[ 0  1 -7]
 [ 0 -3 -5]
 [-1  0  0]]
[14]:
my_interface.parse_limit(du = 1e-2, S  = 1e-2, sgm1=200, sgm2=200, dd = 1e-2)
[26]:
for i in range(len(thetas)):
    R = rot([0,0,1], thetas[i])
    hkl1 = get_primitive_hkl(C_lattice = my_interface.conv_lattice_1, P_lattice = my_interface.lattice_1, hkl = hkls[i])
    my_interface.search_fixed(R, exact = True)
    my_interface.compute_bicrystal(hkl1, plane_ortho=True, normal_ortho= True, lim = 50, tol_ortho = 1e-3)
    x_dimension = ceil(70/norm(dot(my_interface.lattice_1,my_interface.bicrystal_U1)[:,0]))
    hkl2 = get_primitive_hkl(C_lattice = my_interface.conv_lattice_1, P_lattice = dot(R, my_interface.conv_lattice_1), hkl = hkls[i])
    my_interface.get_bicrystal(xyz_1 = [x_dimension,1,1], \
                                   xyz_2 = [x_dimension,1,1], \
                               filename = 'co<001>tst_GBs/sigma{0}_({1} {2} {3})_({4} {5} {6})'.\
                               format(sigmas[i], hkl1[0], hkl1[1], hkl1[2], hkl2[0], hkl[1], hkl[2]),filetype='LAMMPS')
Congrates, we found an appx CSL!

U1 =
[[ 0  8  1]
 [ 0 -1  9]
 [ 1  0  0]]; sigma_1 = 73

U2 =
[[ 0  9 -1]
 [ 0  1  8]
 [ 1  0  0]]; sigma_2 = 73

D =
[[1. 0. 0.]
 [0. 1. 0.]
 [0. 0. 1.]]

cell 1:
[[-10   0  -8]
 [-17   0   1]
 [  0   1   0]]
cell 2:
[[ -7   0  -9]
 [-17   0  -1]
 [  0   1   0]]
Congrates, we found an appx CSL!

U1 =
[[ 0  2  3]
 [ 0 -3  5]
 [ 1  0  0]]; sigma_1 = 19

U2 =
[[ 0  3  2]
 [ 0 -2  5]
 [ 1  0  0]]; sigma_2 = 19

D =
[[1. 0. 0.]
 [0. 1. 0.]
 [0. 0. 1.]]

cell 1:
[[ 3  0  7]
 [ 5  0 -1]
 [ 0  1  0]]
cell 2:
[[2 0 8]
 [5 0 1]
 [0 1 0]]
Congrates, we found an appx CSL!

U1 =
[[ 0  6  7]
 [ 0 -1  6]
 [ 1  0  0]]; sigma_1 = 43

U2 =
[[0 7 6]
 [0 1 7]
 [1 0 0]]; sigma_2 = 43

D =
[[1. 0. 0.]
 [0. 1. 0.]
 [0. 0. 1.]]

cell 1:
[[ -8   0  -6]
 [-13   0   1]
 [  0   1   0]]
cell 2:
[[ -5   0  -7]
 [-13   0  -1]
 [  0   1   0]]
Congrates, we found an appx CSL!

U1 =
[[ 0  5  1]
 [ 0 -1  6]
 [ 1  0  0]]; sigma_1 = 31

U2 =
[[ 0  6 -1]
 [ 0  1  5]
 [ 1  0  0]]; sigma_2 = 31

D =
[[1. 0. 0.]
 [0. 1. 0.]
 [0. 0. 1.]]

cell 1:
[[ 7  0  5]
 [11  0 -1]
 [ 0  1  0]]
cell 2:
[[ 4  0  6]
 [11  0  1]
 [ 0  1  0]]
Congrates, we found an appx CSL!

U1 =
[[ 0 -1 -2]
 [ 0  2 -3]
 [ 1  0  0]]; sigma_1 = 7

U2 =
[[ 0 -2 -1]
 [ 0  1 -3]
 [ 1  0  0]]; sigma_2 = 7

D =
[[1. 0. 0.]
 [0. 1. 0.]
 [0. 0. 1.]]

cell 1:
[[ 2  0  4]
 [ 3  0 -1]
 [ 0  1  0]]
cell 2:
[[1 0 5]
 [3 0 1]
 [0 1 0]]
Congrates, we found an appx CSL!

U1 =
[[ 0  7  2]
 [ 0 -2  9]
 [ 1  0  0]]; sigma_1 = 67

U2 =
[[ 0  9 -2]
 [ 0  2  7]
 [ 1  0  0]]; sigma_2 = 67

D =
[[1. 0. 0.]
 [0. 1. 0.]
 [0. 0. 1.]]

cell 1:
[[-11   0  -7]
 [-16   0   2]
 [  0   1   0]]
cell 2:
[[ -5   0  -9]
 [-16   0  -2]
 [  0   1   0]]
Congrates, we found an appx CSL!

U1 =
[[ 0  3  1]
 [ 0 -1  4]
 [ 1  0  0]]; sigma_1 = 13

U2 =
[[ 0  4 -1]
 [ 0  1  3]
 [ 1  0  0]]; sigma_2 = 13

D =
[[1. 0. 0.]
 [0. 1. 0.]
 [0. 0. 1.]]

cell 1:
[[-5  0 -3]
 [-7  0  1]
 [ 0  1  0]]
cell 2:
[[-2  0 -4]
 [-7  0 -1]
 [ 0  1  0]]
Congrates, we found an appx CSL!

U1 =
[[ 0 -1 -3]
 [ 0  3 -4]
 [ 1  0  0]]; sigma_1 = 13

U2 =
[[ 0 -3 -1]
 [ 0  1 -4]
 [ 1  0  0]]; sigma_2 = 13

D =
[[1. 0. 0.]
 [0. 1. 0.]
 [0. 0. 1.]]

cell 1:
[[-3  0 -5]
 [-4  0  2]
 [ 0  1  0]]
cell 2:
[[-1  0 -7]
 [-4  0 -2]
 [ 0  1  0]]
Congrates, we found an appx CSL!

U1 =
[[ 0  2  1]
 [ 0 -1  3]
 [ 1  0  0]]; sigma_1 = 7

U2 =
[[ 0  3 -1]
 [ 0  1  2]
 [ 1  0  0]]; sigma_2 = 7

D =
[[1. 0. 0.]
 [0. 1. 0.]
 [0. 0. 1.]]

cell 1:
[[ 4  0  2]
 [ 5  0 -1]
 [ 0  1  0]]
cell 2:
[[1 0 3]
 [5 0 1]
 [0 1 0]]
Congrates, we found an appx CSL!

U1 =
[[ 0 -5 -8]
 [ 0  3 -5]
 [ 1  0  0]]; sigma_1 = 49

U2 =
[[ 0 -8 -5]
 [ 0 -3 -8]
 [ 1  0  0]]; sigma_2 = 49

D =
[[1. 0. 0.]
 [0. 1. 0.]
 [0. 0. 1.]]

cell 1:
[[11  0  5]
 [13  0 -3]
 [ 0  1  0]]
cell 2:
[[ 2  0  8]
 [13  0  3]
 [ 0  1  0]]
Congrates, we found an appx CSL!

U1 =
[[ 0  2 -5]
 [ 0  5 -3]
 [ 1  0  0]]; sigma_1 = 19

U2 =
[[ 0 -2 -3]
 [ 0  3 -5]
 [ 1  0  0]]; sigma_2 = 19

D =
[[1. 0. 0.]
 [0. 1. 0.]
 [0. 0. 1.]]

cell 1:
[[ 7  0  3]
 [ 8  0 -2]
 [ 0  1  0]]
cell 2:
[[1 0 5]
 [8 0 2]
 [0 1 0]]
Congrates, we found an appx CSL!

U1 =
[[ 0  3 -4]
 [ 0  7  3]
 [ 1  0  0]]; sigma_1 = 37

U2 =
[[ 0 -3 -7]
 [ 0  4 -3]
 [ 1  0  0]]; sigma_2 = 37

D =
[[1. 0. 0.]
 [0. 1. 0.]
 [0. 0. 1.]]

cell 1:
[[-10   0  -4]
 [-11   0   3]
 [  0   1   0]]
cell 2:
[[ -1   0  -7]
 [-11   0  -3]
 [  0   1   0]]
Congrates, we found an appx CSL!

U1 =
[[ 0  4 -9]
 [ 0  9 -5]
 [ 1  0  0]]; sigma_1 = 61

U2 =
[[ 0 -4 -5]
 [ 0  5 -9]
 [ 1  0  0]]; sigma_2 = 61

D =
[[1. 0. 0.]
 [0. 1. 0.]
 [0. 0. 1.]]

cell 1:
[[-13   0  -5]
 [-14   0   4]
 [  0   1   0]]
cell 2:
[[ -1   0  -9]
 [-14   0  -4]
 [  0   1   0]]
Congrates, we found an appx CSL!

U1 =
[[ 0  1  0]
 [-1  1  0]
 [ 0  0  1]]; sigma_1 = 1

U2 =
[[1 0 0]
 [0 1 0]
 [0 0 1]]; sigma_2 = 1

D =
[[1. 0. 0.]
 [0. 1. 0.]
 [0. 0. 1.]]

cell 1:
[[ 1  0 -1]
 [ 1  0  1]
 [ 0 -1  0]]
cell 2:
[[ 0  0 -2]
 [ 1  0 -1]
 [ 0 -1  0]]
[5]:
my_interface.parse_limit(du = 1e-2, S  = 1e-2, sgm1=200, sgm2=200, dd = 1e-2)

#Do searching!
#We already know that there is a CSL by rotation 180 degrees
my_interface.search_fixed(R)
Congrates, we found an appx CSL!

U1 =
[[ 1  1  3]
 [ 2  0 -1]
 [ 0  1 -2]]; sigma_1 = 11

U2 =
[[-1 -1  4]
 [ 1 -1  3]
 [ 0  1  2]]; sigma_2 = 11

D =
[[ 0.99853888 -0.         -0.00110625]
 [-0.          1.         -0.        ]
 [ 0.00192983 -0.          1.00146112]]

‘U1’, ‘U2’ are two sets of indices of the CSL in the two crystals’ frames, ‘D’ is the deformation applied to the crystal 2 to form an approximate CSL

As you can see, to form a twinning structure we need to deform the structure provided!

Convert the miller indices to be expressed in the primitive cell#

Now we need to specify the orientation of our interface, which is by giving a miller indices in expressed in the primitive cell.

[6]:
"""
The interface plane is the [1,-1,2] plane in the conventional cell and now we \
transform it into primitive cell
"""
hkl = get_primitive_hkl(array([1, 1, -2]), my_interface.conv_lattice_1, my_interface.lattice_1)
hkl
[6]:
array([-2,  1,  2])

Compute the indices of the two slabs to make bicrystal#

Now let’s compute the indices of the two slabs forming the interface If you want a near orthogonal bicrystal, please set ’orthogonal to yes, and adjust the lim & tol.

[7]:
my_interface.compute_bicrystal(hkl, normal_ortho= True, lim = 50, tol_ortho = 1e-3)
cell 1:
[[ 7  1  1]
 [ 0  2  0]
 [-4  0  1]]
cell 2:
[[ 7 -1 -1]
 [ 7  1 -1]
 [ 4  0  1]]

Here we obtained the two sets of indices to build a bicrystal

Make a bicrystal!#

You can adjust the bicrystal by 1. do expansion by set ‘xyz’ = [dimX, dimY, dimZ] 2. do RBT by ‘dzdy’ = a translation vector (please confine dzdy in the interface plane, for RBT in the normal, please use ‘dp1’ and ‘dp2’, to make vacuum in the interface use ‘dx’); 3. introduce vacuum in the interface by ‘dx’ = the distance spacing the two crystals 4. adjust the termination by ‘dp1’, ‘dp2’ = length of shift of the position of the termination from the interface into the bulk 5. introduce vacuum to make a surface in the end of the bicrystal by ‘vx’ = length of the vaccumn

default: xyz = [1,1,1] and others = 0

[8]:
my_interface.get_bicrystal(xyz_1 = [1,1,1], xyz_2 = [1,1,1], dx = 0)

Good! You have made a ‘POSCAR’ file of this bicrystal, we also generated two files named ‘cell_1.cif’ and ‘cell_2.cif’ providing the structure of the two slabs.

[26]:
import shutil
try:
    shutil.rmtree('CNID_inputs')
except:
    print('No existing files')
#To sample the CNID, try
my_interface.sample_CNID(grid = [8,8], xyz_1 = [1,1,1], xyz_2 = [1,1,1], dx = 0.5, filetype = 'LAMMPS', filename = 'atoms')
CNID
[[ 1. -1.]
 [ 0. -2.]
 [ 1.  0.]]
making 64 files...
completed

Please check the generated ‘POSCAR.x.y’ files. The CNID here is expressed in the primitive cell’s frame. You can refer to the cartesian coordinates or in the conventional cell’s frame

[9]:
CNID_cartesian = round(my_interface.CNID,8)
CNID_cartesian
[9]:
array([[-2.25618721,  6.76856163],
       [-3.90783088, -3.90783088],
       [-5.959899  , -0.        ]])
[10]:
CNID_conv = round(dot(inv(my_interface.conv_lattice_1)\
                              , my_interface.CNID),8)
CNID_conv
[10]:
array([[-1.,  1.],
       [-1., -1.],
       [-1., -0.]])