2 % Copyright (C) 2018 Peter Rakyta, Ph.D
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.
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.
14 % You should have received a copy of the GNU General Public License
15 % along with
this program. If not, see http:
17 %> @addtogroup unit_tests Unit Tests
19 %> @file test_C_chain_siesta.m
20 %> @brief Testfile to check SIESTA (dft)
interface on a carbon chain with
23 %> EQuUs v4.9.... or later
27 filename = mfilename(
'fullpath');
28 [directory, fncname] = fileparts( filename );
30 Label =
'C_chain_siesta_SZ' 32 filenameIn = [
'Input_',Label,
'.xml'];
33 filenameOut = [
'output-',Label,
'.xml'];
38 % calculated conductance (and number of open channels) at five different
42 check_conductivity = [0.000001435198111];
45 Conductivity = NaN(num,1);
46 Open_channels1 = NaN(num,1);
47 Open_channels2 = NaN(num,1);
50 disp(
'***** test of SIESTA interface, Transport of Carbon chain with Hamiltonian from Siesta *****' );
56 for idx = 1:length(Evec)
57 cTwoTerminal =
NTerminal('filenameIn', fullfile( pwd, filenameIn), 'filenameOut', fullfile( filenameOut), 'Silent',1);
59 [Conductivity_tmp, ny_tmp, DeltaC_tmp] = cTwoTerminal.
Transport( Evec(idx), 'constant_channels', false, 'SelfEnergy', 1);
61 Conductivity(idx) = -Conductivity_tmp(1,1);
62 Open_channels1(idx) = ny_tmp(1);
63 Open_channels2(idx) = ny_tmp(2);
67 % checking conductances
68 checkpoint = max(Conductivity' - check_conductivity);
70 warning(['EQuUs:Tests:', fncname, ':checkpoint failed with error ', num2str( checkpoint)]);
A class describing an N-terminal geometry for equilibrium calculations mostly in the zero temperature...
Structure Opt contains the basic computational parameters used in EQuUs.
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 ...
function CalculateTransport()
function structures(name)