Eötvös Quantum Utilities  v4.9.146
Providing the Horsepowers in the Quantum Realm
test_C_chain_siesta_SZ.m
Go to the documentation of this file.
1 %% Eotvos Quantum Transport Utilities
2 % Copyright (C) 2018 Peter Rakyta, Ph.D
3 %
4 % This program is free software: you can redistribute it and/or modify
5 % it under the terms of the GNU General Public License as published by
6 % the Free Software Foundation, either version 3 of the License, or
7 % (at your option) any later version.
8 %
9 % This program is distributed in the hope that it will be useful,
10 % but WITHOUT ANY WARRANTY; without even the implied warranty of
11 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 % GNU General Public License for more details.
13 %
14 % You should have received a copy of the GNU General Public License
15 % along with this program. If not, see http://www.gnu.org/licenses/.
16 %
17 %> @addtogroup unit_tests Unit Tests
18 %> @{
19 %> @file test_C_chain_siesta.m
20 %> @brief Testfile to check SIESTA (dft) interface on a carbon chain with
21 % two modified atoms
22 %> @Available
23 %> EQuUs v4.9.... or later
24 %> @}
25 function test_C_chain_siesta_SZ( filenum )
26 
27  filename = mfilename('fullpath');
28  [directory, fncname] = fileparts( filename );
29 
30  Label = 'C_chain_siesta_SZ'
31  % create input structures
32  filenameIn = ['Input_',Label,'.xml'];
33  filenameOut = ['output-',Label,'.xml'];
34  [Opt, param] = parseInput( filenameIn );
35 
36  Silent=1;
37  Test = false;
38  % calculated conductance (and number of open channels) at five different
39  % energies
40 
41  Evec = [-3.2454];
42  check_conductivity = [0.000001435198111];
43 
44  num = length(Evec);
45  Conductivity = NaN(num,1);
46  Open_channels1 = NaN(num,1);
47  Open_channels2 = NaN(num,1);
48  format long;
49 
50  disp( '***** test of SIESTA interface, Transport of Carbon chain with Hamiltonian from Siesta *****' );
51 
53 
54  function CalculateTransport()
55 
56  for idx = 1:length(Evec)
57  cTwoTerminal = NTerminal('filenameIn', fullfile( pwd, filenameIn), 'filenameOut', fullfile( filenameOut), 'Silent',1);
58  DeltaC_tmp = 0;
59  [Conductivity_tmp, ny_tmp, DeltaC_tmp] = cTwoTerminal.Transport( Evec(idx), 'constant_channels', false, 'SelfEnergy', 1);
60 
61  Conductivity(idx) = -Conductivity_tmp(1,1);
62  Open_channels1(idx) = ny_tmp(1);
63  Open_channels2(idx) = ny_tmp(2);
64  end
65  end
66 
67  % checking conductances
68  checkpoint = max(Conductivity' - check_conductivity);
69  if checkpoint > 1e-7
70  warning(['EQuUs:Tests:', fncname, ':checkpoint failed with error ', num2str( checkpoint)]);
71  end
72 
73 
74 end
75 
76 
A class describing an N-terminal geometry for equilibrium calculations mostly in the zero temperature...
Definition: NTerminal.m:38
Structure Opt contains the basic computational parameters used in EQuUs.
Definition: structures.m:60
function test_C_chain_siesta_SZ(filenum)
function Transport(Energy, B)
Calculates the conductance at a given energy value.
Structure param contains data structures describing the physical parameters of the scattering center ...
Definition: structures.m:45
function CalculateTransport()
function parseInput(filename)
This function parses the input file containing the input parameters.
function structures(name)