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
22 %> EQuUs v4.8.... or later
27 filename = mfilename(
'fullpath');
28 [directory, fncname] = fileparts( filename );
33 % adjusting the
shape of the scattering region
40 %%
test of method of removing indexes from the Hamiltonian
41 disp(
'***** test of class Ribbon_Keldysh, Transport_Interface_Keldysh *****' );
43 % creating the Hamiltonian of the scattering region
46 % retriving the created Hamiltonian
47 Hscatter0 = cCreateHamiltonians.
Read(
'Hscatter');
49 % defining a
circle shaped area that should be removed from the Hamiltonian
55 % determine indexes that should be removed
56 cCoordinates0 = cCreateHamiltonians.
Read(
'coordinates');
57 indexes = (cCoordinates0.x - cCircle.center.x).^2 + (cCoordinates0.y - cCircle.center.y).^2 < cCircle.radius^2;
59 % removing
sites from the Hamiltonian
62 % checking the number of remaininng
sites 65 size_Hscatter0 = size(Hscatter0);
68 checkpoint = norm( size_Hscatter0 - size_Hscatter - length(find(indexes))*[1 1] );
70 warning([
'EQuUs:Tests:', fncname,
':checkpoint failed with error ', num2str( checkpoint)]);
74 cCoordinates = cCreateHamiltonians.
Read(
'coordinates');
75 checkpoint = norm( length(cCoordinates0.x) - length(cCoordinates.x) - length(find(indexes)) );
77 warning([
'EQuUs:Tests:', fncname,
':checkpoint failed with error ', num2str( checkpoint)]);
function test(arg1, arg2)
Brief description of the function.
Structure circle contains data describing a circle shaped area positioned in a two-dimensional space.
Structure Opt contains the basic computational parameters used in EQuUs.
Structure shape contains data about the geometry of the scattering region.
function Transport(Energy, B)
Calculates the conductance at a given energy value.
function CreateScatterH(varargin)
Creates a Hamiltonian of a rectangle shaped area.
function RemoveSites(indexes)
Removes specific sites from the model of the scattering region.
function CreateHamiltonians(Opt, param, varargin)
Constructor of the class.
Structure param contains data structures describing the physical parameters of the scattering center ...
scatter_param scatter
An instance of the structure scatter_param containing the physical parameters for the scattering regi...
Structure sites contains data to identify the individual sites in a matrix.
Property Opt
An instance of structure Opt.
Property Hscatter
The matrix of the Hamiltonian.
function test_CreateHamiltonians()
Testfile to check functionalities of the class CreateHamiltonians.
Property param
An instance of structure param.
Structure containing the coordinates and other quantum number identifiers of the sites in the Hamilto...
function Read(MemberName)
Query for the value of an attribute in the class.
function structures(name)
A class to create and store Hamiltonian of the scattering region.