rad-extract-tb2j.py#

Script for extracting of template-based Hamiltonian from TB2J results.

If --output_name is not provided the result is passed to the console, otherwise it is written to the file with first 3 lines giving information about the source of exchange, date and time.

Exchange types#

There are several options to control which exchange types are included in the summary:

Format of the output block for each exchange type is provided in the arguments section.

Usage example#

Example is based on the files from examples folder.

There are two modes in which exchange summary can be printed:

  • with the symmetry of the template and

  • with the Hamiltonian filtered based on the template.

In the first case the symmetry of the template is forced on the Hamiltonian and exchange output is grouped based on the names provided in the template:

rad-extract-tb2j.py -all -fs -if exchange.out -tf template.txt -on summary_forced_symmetry
summary with forced symmetry
Exchange values are extracted from: docs/examples/rad-extract-tb2j/exchange.out
on 29 June 2023 at 14:2:20 by rad-tools 0.7.14

J1
    Isotropic: 0.1219
    Anisotropic:
        -0.0386  0.0007  0.0000
         0.0007 -0.0402 -0.0040
         0.0000 -0.0040  0.0788
    Matrix:
         0.0834 -0.0790  0.1773
         0.0803  0.0817  0.0096
        -0.1773 -0.0176  0.2007
    |DMI|: 0.1949
    |DMI/J|: 1.5982
    DMI:  0.0136 -0.1773 -0.0796 (Ni1 Ni1 -1  0  0)
    DMI: -0.0136  0.1773  0.0796 (Ni1 Ni1  1  0  0)
    DMI: -0.1449  0.0987 -0.0850 (Ni1 Ni1 -1 -1  0)
    DMI:  0.0952 -0.1700  0.0038 (Ni1 Ni1  0 -1  0)
    DMI: -0.0952  0.1700 -0.0038 (Ni1 Ni1  0  1  0)
    DMI:  0.1449 -0.0987  0.0850 (Ni1 Ni1  1  1  0)

J2
    Isotropic: 0.0143
    Anisotropic:
         0.0239  0.0000 -0.0000
         0.0000  0.0242 -0.0007
        -0.0000 -0.0007 -0.0481
    Matrix:
         0.0382 -0.0467  0.0018
         0.0467  0.0385 -0.0031
        -0.0018  0.0018 -0.0338
    |DMI|: 0.0468
    |DMI/J|: 3.2726
    DMI: -0.0024 -0.0018 -0.0467 (Ni1 Ni1 -2 -1  0)
    DMI: -0.0148 -0.0298 -0.0329 (Ni1 Ni1 -1  1  0)
    DMI:  0.0148  0.0298  0.0329 (Ni1 Ni1  1 -1  0)
    DMI:  0.0024  0.0018  0.0467 (Ni1 Ni1  2  1  0)
    DMI: -0.0327  0.0017 -0.0334 (Ni1 Ni1 -1 -2  0)
    DMI:  0.0327 -0.0017  0.0334 (Ni1 Ni1  1  2  0)

J3
    Isotropic: -2.3033
    Anisotropic:
         0.0044  0.0003  0.0000
         0.0003  0.0041  0.0007
         0.0000  0.0007 -0.0086
    Matrix:
        -2.2989  0.0118  0.0356
        -0.0111 -2.2992  0.0133
        -0.0356 -0.0120 -2.3119
    |DMI|: 0.0395
    |DMI/J|: 0.0171
    DMI:  0.0126 -0.0356  0.0114 (Ni1 Ni1 -2  0  0)
    DMI: -0.0126  0.0356 -0.0114 (Ni1 Ni1  2  0  0)
    DMI: -0.0251  0.0289  0.0095 (Ni1 Ni1 -2 -2  0)
    DMI:  0.0193 -0.0344  0.0006 (Ni1 Ni1  0 -2  0)
    DMI: -0.0193  0.0344 -0.0006 (Ni1 Ni1  0  2  0)
    DMI:  0.0251 -0.0289 -0.0095 (Ni1 Ni1  2  2  0)

In the second case exchange summary is printed for every bond in the template file and no additional symmetry constrains are assumed on the Hamiltonian:

rad-extract-tb2j.py -all -if exchange.out -tf template.txt -on summary
summary without forced symmetry
Exchange values are extracted from: docs/examples/rad-extract-tb2j/exchange.out
on 29 June 2023 at 14:2:21 by rad-tools 0.7.14

Ni1 Ni1 (-1,  0,  0)
    Isotropic: 0.1261
    Anisotropic:
         0.4447  0.0000  0.0000
         0.0000 -0.5883 -0.3150
         0.0000 -0.3150  0.1437
    Matrix:
         0.5708 -0.1127  0.2509
         0.1127 -0.4622 -0.2957
        -0.2509 -0.3343  0.2698
    |DMI|: 0.2757
    |DMI/J|: 2.1860
    DMI: 0.0193 -0.2509 -0.1127

Ni1 Ni1 ( 1,  0,  0)
    Isotropic: 0.1261
    Anisotropic:
         0.4447  0.0000  0.0000
         0.0000 -0.5883 -0.3150
         0.0000 -0.3150  0.1437
    Matrix:
         0.5708  0.1127 -0.2509
        -0.1127 -0.4622 -0.3343
         0.2509 -0.2957  0.2698
    |DMI|: 0.2757
    |DMI/J|: 2.1860
    DMI: -0.0193 0.2509 0.1127

Ni1 Ni1 (-1, -1,  0)
    Isotropic: 0.1043
    Anisotropic:
        -0.3097  0.2190 -0.2990
         0.2190  0.2063  0.1220
        -0.2990  0.1220  0.1033
    Matrix:
        -0.2054  0.0976 -0.4400
         0.3404  0.3106 -0.0850
        -0.1580  0.3290  0.2076
    |DMI|: 0.2783
    |DMI/J|: 2.6694
    DMI: -0.2070 0.1410 -0.1214

Ni1 Ni1 ( 0, -1,  0)
    Isotropic: 0.1354
    Anisotropic:
        -0.2507 -0.2170  0.2990
        -0.2170  0.2613  0.1810
         0.2990  0.1810 -0.0107
    Matrix:
        -0.1153 -0.2164  0.3256
        -0.2176  0.3967  0.1959
         0.2724  0.1661  0.1247
    |DMI|: 0.0305
    |DMI/J|: 0.2253
    DMI: 0.0149 -0.0266 0.0006

Ni1 Ni1 ( 0,  1,  0)
    Isotropic: 0.1354
    Anisotropic:
        -0.2507 -0.2170  0.2990
        -0.2170  0.2613  0.1810
         0.2990  0.1810 -0.0107
    Matrix:
        -0.1153 -0.2176  0.2724
        -0.2164  0.3967  0.1661
         0.3256  0.1959  0.1247
    |DMI|: 0.0305
    |DMI/J|: 0.2253
    DMI: -0.0149 0.0266 -0.0006

Ni1 Ni1 ( 1,  1,  0)
    Isotropic: 0.1043
    Anisotropic:
        -0.3097  0.2190 -0.2990
         0.2190  0.2063  0.1220
        -0.2990  0.1220  0.1033
    Matrix:
        -0.2054  0.3404 -0.1580
         0.0976  0.3106  0.3290
        -0.4400 -0.0850  0.2076
    |DMI|: 0.2783
    |DMI/J|: 2.6694
    DMI: 0.2070 -0.1410 0.1214

Ni1 Ni1 (-2, -1,  0)
    Isotropic: 0.0110
    Anisotropic:
         0.0257  0.0020  0.0020
         0.0020  0.0237  0.0010
         0.0020  0.0010 -0.0493
    Matrix:
         0.0367 -0.0578  0.0043
         0.0618  0.0347 -0.0021
        -0.0003  0.0041 -0.0383
    |DMI|: 0.0599
    |DMI/J|: 5.4312
    DMI: -0.0031 -0.0023 -0.0598

Ni1 Ni1 (-1,  1,  0)
    Isotropic: 0.0158
    Anisotropic:
         0.0253 -0.0020 -0.0020
        -0.0020  0.0223  0.0000
        -0.0020  0.0000 -0.0477
    Matrix:
         0.0411 -0.0304  0.0237
         0.0264  0.0381 -0.0128
        -0.0277  0.0128 -0.0319
    |DMI|: 0.0404
    |DMI/J|: 2.5614
    DMI: -0.0128 -0.0257 -0.0284

Ni1 Ni1 ( 1, -1,  0)
    Isotropic: 0.0158
    Anisotropic:
         0.0253 -0.0020 -0.0020
        -0.0020  0.0223  0.0000
        -0.0020  0.0000 -0.0477
    Matrix:
         0.0411  0.0264 -0.0277
        -0.0304  0.0381  0.0128
         0.0237 -0.0128 -0.0319
    |DMI|: 0.0404
    |DMI/J|: 2.5614
    DMI: 0.0128 0.0257 0.0284

Ni1 Ni1 ( 2,  1,  0)
    Isotropic: 0.0110
    Anisotropic:
         0.0257  0.0020  0.0020
         0.0020  0.0237  0.0010
         0.0020  0.0010 -0.0493
    Matrix:
         0.0367  0.0618 -0.0003
        -0.0578  0.0347  0.0041
         0.0043 -0.0021 -0.0383
    |DMI|: 0.0599
    |DMI/J|: 5.4312
    DMI: 0.0031 0.0023 0.0598

Ni1 Ni1 (-1, -2,  0)
    Isotropic: 0.0161
    Anisotropic:
         0.0207  0.0000  0.0000
         0.0000  0.0267 -0.0030
         0.0000 -0.0030 -0.0473
    Matrix:
         0.0368 -0.0287 -0.0015
         0.0287  0.0428 -0.0311
         0.0015  0.0251 -0.0312
    |DMI|: 0.0402
    |DMI/J|: 2.4914
    DMI: -0.0281 0.0015 -0.0287

Ni1 Ni1 ( 1,  2,  0)
    Isotropic: 0.0161
    Anisotropic:
         0.0207  0.0000  0.0000
         0.0000  0.0267 -0.0030
         0.0000 -0.0030 -0.0473
    Matrix:
         0.0368  0.0287  0.0015
        -0.0287  0.0428  0.0251
        -0.0015 -0.0311 -0.0312
    |DMI|: 0.0402
    |DMI/J|: 2.4914
    DMI: 0.0281 -0.0015 0.0287

Ni1 Ni1 (-2,  0,  0)
    Isotropic: -2.3130
    Anisotropic:
         0.0203  0.0000  0.0000
         0.0000 -0.0167 -0.0180
         0.0000 -0.0180 -0.0037
    Matrix:
        -2.2927  0.0131  0.0408
        -0.0131 -2.3297 -0.0035
        -0.0408 -0.0325 -2.3167
    |DMI|: 0.0452
    |DMI/J|: 0.0196
    DMI: 0.0145 -0.0408 0.0131

Ni1 Ni1 ( 2,  0,  0)
    Isotropic: -2.3130
    Anisotropic:
         0.0203  0.0000  0.0000
         0.0000 -0.0167 -0.0180
         0.0000 -0.0180 -0.0037
    Matrix:
        -2.2927 -0.0131 -0.0408
         0.0131 -2.3297 -0.0325
         0.0408 -0.0035 -2.3167
    |DMI|: 0.0452
    |DMI/J|: 0.0196
    DMI: -0.0145 0.0408 -0.0131

Ni1 Ni1 (-2, -2,  0)
    Isotropic: -2.3160
    Anisotropic:
        -0.0053  0.0090 -0.0160
         0.0090  0.0117  0.0100
        -0.0160  0.0100 -0.0063
    Matrix:
        -2.3213  0.0199 -0.0492
        -0.0019 -2.3043 -0.0188
         0.0172  0.0388 -2.3223
    |DMI|: 0.0453
    |DMI/J|: 0.0196
    DMI: -0.0288 0.0332 0.0109

Ni1 Ni1 ( 0, -2,  0)
    Isotropic: -2.2810
    Anisotropic:
        -0.0017 -0.0080  0.0160
        -0.0080  0.0173  0.0100
         0.0160  0.0100 -0.0157
    Matrix:
        -2.2827 -0.0076  0.0403
        -0.0084 -2.2637  0.0236
        -0.0083 -0.0036 -2.2967
    |DMI|: 0.0278
    |DMI/J|: 0.0122
    DMI: 0.0136 -0.0243 0.0004

Ni1 Ni1 ( 0,  2,  0)
    Isotropic: -2.2810
    Anisotropic:
        -0.0017 -0.0080  0.0160
        -0.0080  0.0173  0.0100
         0.0160  0.0100 -0.0157
    Matrix:
        -2.2827 -0.0084 -0.0083
        -0.0076 -2.2637 -0.0036
         0.0403  0.0236 -2.2967
    |DMI|: 0.0278
    |DMI/J|: 0.0122
    DMI: -0.0136 0.0243 -0.0004

Ni1 Ni1 ( 2,  2,  0)
    Isotropic: -2.3160
    Anisotropic:
        -0.0053  0.0090 -0.0160
         0.0090  0.0117  0.0100
        -0.0160  0.0100 -0.0063
    Matrix:
        -2.3213 -0.0019  0.0172
         0.0199 -2.3043  0.0388
        -0.0492 -0.0188 -2.3223
    |DMI|: 0.0453
    |DMI/J|: 0.0196
    DMI: 0.0288 -0.0332 -0.0109

Arguments#

-if, --input-filename#

Relative or absolute path to the "exchange.out" file, including the name and extension of the file itself.

required
type : str

-tf, --template-file#

Relative or absolute path to the template file, including the name and extension of the file.

required
type : str

See also: template

-on, --output-name#

Seedname for the output files.

If this parameter is not specified, the result are printed in standard output stream.

default : "extracted_exchange.txt"
type : str

See also: example.

-d, --decimals#

Decimals after the comma for the exchange values.

default : 4
type : int

Changed in version 0.5.17: Renamed from "-acc"/"--accuracy".

-fs, --force-symmetry#

Whether to force the symmetry of the template on the Hamiltonian.

default : False
type : bool

-i, --isotropic#

Whether to output isotropic exchange.

default : False
type : bool

Section format:

Isotropic: J

-a, --anisotropic#

Whether to output anisotropic exchange.

default : False
type : bool

Section format:

Anisotropic:
    Jxx Jxy Jxz
    Jxy Jyy Jyz
    Jxz Jyz Jzz

-m, --matrix#

Whether to output the whole matrix of exchange.

default : False
type : bool

Section format:

Matrix:
    Jxx Jxy Jxz
    Jyx Jyy Jyz
    Jzx Jzy Jzz

-dmi#

Whether to output DMI exchange.

default : False
type : bool

Section format in the case of forced symmetry:

|DMI|: |DMI|
|DMI/J|: |DMI/J|
DMI: DMI_x DMI_y DMI_z (Atom1 Atom2 Ra Rb Rc)
...

Otherwise:

|DMI|: |DMI|
|DMI/J|: |DMI/J|
DMI: DMI_x DMI_y DMI_z

-all#

Whether to output all types of exchange.

default : False
type : bool

-v, --verbose#

Verbose output, propagates to the called methods.

default : False