Eötvös Quantum Utilities  v5.0.144
Providing the Horsepowers in the Quantum Realm
ValidateStructures.m
Go to the documentation of this file.
1 %% Eotvos Quantum Transport Utilities - ValidateStructures
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 filters Filters
18 %> @{
19 %> @file ValidateStructures.m
20 %> @brief This function verify the input structures #Opt and #param and create system specific data structures.
21 %> @}
22 %> @brief This function verify the input structures #Opt and #param and create system specific data structures.
23 %> @param Opt An instance of structure #Opt
24 %> @param param An instance of structure #param
25 %> @return [1] An instance of structure #Opt
26 %> @return [2] An instance of structure #param
27 function [Opt, param] = ValidateStructures( Opt, param )
28 
29 filename = mfilename('fullpath');
30 [directory, fncname] = fileparts( filename );
31 
32 
33 % checking the number of leads
34 if isempty( Opt.NofLeads )
35  Opt.NofLeads = length( param.Leads );
36 elseif length( param.Leads ) > Opt.NofLeads
37  warning(['EQuUs:Filters:', fncname], 'Structure param contains more leads as structure Opt. Reducing number of leads');
38 elseif length( param.Leads ) < Opt.NofLeads
39  error(['EQuUs:Filters:', fncname], 'Structure param contains less leads as structure Opt.');
40 end
41 
42 
43 % checking the lattice type
44 if isempty( Opt.Lattice_Type )
45  if isempty( Opt.custom_Hamiltonians )
46 
47  end
48 end
49 
50 Lattice_Type = Opt.Lattice_Type;
51  param.scatter = ConvertParamScatter( param.scatter );
52  for idx = 1:length( param.Leads )
53 
54  % handling obsolete XML parameter 'orientation'
55  if isfield( param.Leads{idx}, 'orientation' )
56  param.Leads{idx}.Lead_Orientation = param.Leads{idx}.orientation;
57  end
58 
59  param.Leads{idx} = ConvertParamLead( param.Leads{idx} );
60 
61  end
62 
63 %TODO
64 % check data consistency like LeadNum, orientation VS Lead_orientation
65 % create lattice specific data structures
66 
67  %% ConvertParam
68  %> @brief Convert structure param relsted to the scattering region to system specific structure.
69  %> @param param_in In stance of structure #param_scatter.
70  %> @return Returns with the system specific strucutre #param_scatter
71  function param = ConvertParamScatter( param_in )
72 
73  if strcmpi(Lattice_Type, 'Square')
75  elseif strcmpi(Lattice_Type, 'SSH')
77  elseif strcmp(Lattice_Type, 'Lieb')
79  elseif strcmp(Lattice_Type, 'BiTeI')
81  elseif strcmp(Lattice_Type, 'Graphene')
83  elseif strcmp(Lattice_Type, 'Graphene_SOC')
85  elseif strcmpi(Lattice_Type, 'Graphene_Bilayer')
87  elseif strcmpi(Lattice_Type, 'Graphene_Bilayer_2')
89  elseif strcmpi(Lattice_Type, 'Graphene_Bilayer_3')
91  elseif strcmpi(Lattice_Type, 'Silicene')
93  elseif strcmpi(Lattice_Type, 'Triangle')
95  elseif strcmpi(Lattice_Type, 'TMDC_Monolayer')
97  elseif strcmpi(Lattice_Type, 'TMDC_Monolayer_SOC')
99  elseif strcmpi(Lattice_Type, 'TMDC_Bilayer_SOC')
101  elseif isempty(Lattice_Type)
102  param = param_scatter();
103  end
104 
105  param_fieldnames = fieldnames( param );
106  for iidx = 1:length( param_fieldnames )
107  fieldname = param_fieldnames{iidx};
108 
109  if ~isfield( param_in, fieldname )
110  continue
111  end
112 
113  param.(fieldname) = param_in.(fieldname);
114  end
115 
116 
117  end
118 
119  %% ConvertParam
120  %> @brief Convert structure param relsted to the scattering region to system specific structure.
121  %> @param param_in In stance of structure #param_Lead.
122  %> @return Returns with the system specific strucutre #param_Lead
123  function param = ConvertParamLead( param_in )
124 
125  if strcmpi(Lattice_Type, 'Square')
127  elseif strcmpi(Lattice_Type, 'SSH')
128  param = param_SSH_Lead();
129  elseif strcmp(Lattice_Type, 'Lieb')
131  elseif strcmp(Lattice_Type, 'BiTeI')
133  elseif strcmp(Lattice_Type, 'Graphene')
135  elseif strcmp(Lattice_Type, 'Graphene_SOC')
137  elseif strcmpi(Lattice_Type, 'Graphene_Bilayer')
139  elseif strcmpi(Lattice_Type, 'Graphene_Bilayer_2')
141  elseif strcmpi(Lattice_Type, 'Graphene_Bilayer_3')
143  elseif strcmpi(Lattice_Type, 'Silicene')
145  elseif strcmpi(Lattice_Type, 'Triangle')
147  elseif strcmpi(Lattice_Type, 'TMDC_Monolayer')
149  elseif strcmpi(Lattice_Type, 'TMDC_Monolayer_SOC')
151  elseif strcmpi(Lattice_Type, 'TMDC_Bilayer_SOC')
153  elseif isempty(Lattice_Type)
154  param = param_Lead();
155  end
156 
157  param_fieldnames = fieldnames( param );
158  for iidx = 1:length( param_fieldnames )
159  fieldname = param_fieldnames{iidx};
160 
161  if ~isfield( param_in, fieldname )
162  continue
163  end
164 
165  param.(fieldname) = param_in.(fieldname);
166  end
167 
168 
169  end
170 
171 end
Class containing physical parameters of a scattering center defined on a graphene lattice including s...
Class containing physical parameters of a particular lead defined on a Triangle lattice.
Class containing physical parameters of a particular lead defined on a bilayer graphene lattice.
lead_param Leads
A list of structures lead_param containing the physical parameters for the scattering region.
Definition: structures.m:49
Class containing physical parameters of a scattering center defined on a bilayer graphene (hexagonal)...
Base class to construct a structure containing physical parameters of a specific lead.
Definition: param_Lead.m:26
Structure Opt contains the basic computational parameters used in EQuUs.
Definition: structures.m:60
Class containing physical parameters of a particular lead defined on a graphene lattice including spi...
NofLeads
Number of leads attached to the scattering region.
Definition: structures.m:82
function Transport(Energy, B)
Calculates the conductance at a given energy value.
Class containing physical parameters of a scattering center defined on a TMDC_Monolayer lattice.
Class containing physical parameters of a scattering center defined on a Lieb lattice.
Class containing physical parameters of a particular lead defined on a BiTeI lattice.
Class containing physical parameters of a particular lead defined on a TMDC_Monolayer lattice.
Class containing physical parameters of a scattering center defined on a TMDC_Monolayer lattice inclu...
Class containing physical parameters of a scattering center defined on a graphene (hexagonal) lattice...
Class containing physical parameters of a particular lead defined on a Lieb lattice.
Class containing physical parameters of a particular lead defined on a TMDC_Monolayer lattice includi...
function ConvertParamLead(param_in)
Convert structure param relsted to the scattering region to system specific structure.
Class containing physical parameters of a scattering center defined on a Silicene lattice.
Class containing physical parameters of a particular lead defined on a Silicene lattice.
Class containing physical parameters of a particular lead defined on a square lattice.
Structure param contains data structures describing the physical parameters of the scattering center ...
Definition: structures.m:45
Base class to construct a structure containing physical parameters of the scattering region.
Definition: param_scatter.m:26
Class containing physical parameters of a scattering center defined on a Triangle (hexagonal) lattice...
Class containing physical parameters of a particular lead defined on a TMDC Bilayer lattice including...
Class containing physical parameters of a scattering center defined on a TMDC bilayer lattice includi...
function ConvertParamScatter(param_in)
Convert structure param relsted to the scattering region to system specific structure.
Class containing physical parameters of a particular lead defined on a SSH lattice.
function ValidateStructures(Opt, param)
This function verify the input structures Opt and param and create system specific data structures.
Class containing physical parameters of a scattering center defined on a square lattice.
Class containing physical parameters of a scattering center defined on a BiTeI lattice.
function structures(name)
Class containing physical parameters of a particular lead defined on a graphene lattice.
Class containing physical parameters of a scattering center defined on a SSH lattice.