2 % Copyright (C) 2016 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 basic Basic Functionalities
20 %> @brief Class to create and store Hamiltonian of the translational invariant leads.
22 %> @brief Class to create and store Hamiltonian of the translational invariant leads.
23 %> The notations and the structure of the Hamiltonian is defined accroding to the following image:
24 %> @image html Lead_Hamiltonian.jpg
25 %> @image latex Lead_Hamiltonian.jpg
27 %> EQuUs v4.8 or later
32 properties ( Access =
protected )
33 %> An instance of the structure
param 35 %> The orientation of the lead. Set +1 is the
"incoming" direction of the propagating states is defined in the +x or +y direction, and
"-1" otherwise.
37 %> The
id number of the current lead.
39 %> The number of the
sites in the cross section.
41 %> An instance of the structure lead_param
43 %> The tranverse momentum
for transverse computations.
45 %> List of
sites in the unit cell that should be kept after decimation.
47 %> An instance of the structure coordinates.
49 %> K0=H0-E*S0, see Eq (4) of PRB 78, 035407
51 %> K1=H1-E*S1, see Eq (4) of PRB 78, 035407
53 %> K1adj=H1adj-E*S1', see Eq (4) of PRB 78, 035407
55 %> K1_transverse=H1_transverse-E*S1_transverse
57 %> K1_skew_right = H1_skew_right - E*S1_skew_right.
59 %> K1_skew_left = H1_skew_left - E*S1_skew_left.
61 %> The Hamiltonian of a unit cell.
63 %> The coupling Hamiltonian between the unit cells.
65 %> The coupling Hamiltonian between the unit cells in the opposite direction as H1. (For complex energies they differ from each other.)
69 %> The transverse coupling between the slabs for transverse calculations.
71 %> The skew coupling in the right direction between
Hamiltonians H0 for transverse calculations.
73 %> The skew coupling in the left direction between
Hamiltonians H0 for transverse calculations.
75 %> The overlap integrals of a unit cell.
77 %> The overlap integrals between the unit cells.
79 %> The adjungate of the overlap integrals between the unit cells.
81 %> The overlap integrals between the slabs for transverse calculations.
83 %> The overlap integrals for the skew coupling in the right direction between
Hamiltonians H0 for transverse calculations.
85 %> The overlap integrals for the skew coupling in the left direction between
Hamiltonians H0 for transverse calculations.
87 %> The matrix of the
Peierls phases in the unit cell.
89 %> The matrix of the
Peierls phases in the coupling matrix between the unit cells.
91 %> The matrix of the
Peierls phases in the transverse coupling matrix between the unit cells.
93 %> The matrix of the
Peierls phases in the skew coupling matrix in the right direction between the unit cells.
94 fazis_mtx_H1_skew_right
95 %> The matrix of the
Peierls phases in the skew coupling matrix in the left direction between the unit cells.
96 fazis_mtx_H1_skew_left
97 %> A logical value. True if the
Hamiltonians were created, false otherwise.
99 %> A logical value. True if the
Hamiltonians were decimated, false otherwise.
100 HamiltoniansDecimated
101 %> A logical value. True if the overlap integrals were applied, false otherwise.
103 %> A logical value. True if magnetic field was applied in the
Hamiltonians, false otherwise.
105 %> A logical value. True if a gauge transformation was incorporated into the
Hamiltonians or false otherwise.
106 GaugeTransformationApplied
107 %> list of optional parameters (see http:
112 methods ( Access = public )
113 %% constructorof the class
114 %> @brief Constructor of the class.
117 %> @
param varargin Cell array of optional parameters. See
#InputParsing for details. 118 %> @
return An instance of the
class 122 obj.varargin = varargin;
131 %% ApplyOverlapMatrices
132 %> @brief Applies the overlap matrices to the
Hamiltonians: K = H-ES
134 function ApplyOverlapMatrices(obj, E)
136 if obj.OverlapApplied
141 if ~isempty( obj.S0 )
142 obj.K0 = obj.H0 - E*obj.S0;
145 obj.K0 = obj.H0 - speye(size(obj.H0))*E;
148 if ~isempty( obj.S1 )
149 obj.K1 = obj.H1 - E*obj.S1;
150 obj.K1adj = obj.H1adj - E*obj.S1';
153 obj.K1adj = obj.H1adj;
157 if ~isempty( obj.S1_transverse )
158 obj.K1_transverse = obj.H1_transverse - E*obj.S1_transverse;
159 elseif ~isempty( obj.H1_transverse )
160 obj.K1_transverse = obj.H1_transverse;
164 if ~isempty( obj.S1_skew_right )
165 obj.K1_skew_right = obj.H1_skew_right - E*obj.S1_skew_right;
166 elseif ~isempty( obj.H1_skew_right )
167 obj.K1_skew_right = obj.H1_skew_right;
171 if ~isempty( obj.S1_skew_left )
172 obj.K1_skew_left = obj.H1_skew_left - E*obj.S1_skew_left;
173 elseif ~isempty( obj.H1_skew_left )
174 obj.K1_skew_left = obj.H1_skew_left;
178 obj.OverlapApplied = true;
183 %> @brief Creates the
Hamiltonians H_0 and H_1 of the lead. The created
Hamiltonians are stored by within the
object.
184 %> @
param varargin Cell array of optional parameters (https:
185 %> @
param 'toSave' Logical value. If true, the created
Hamiltonians are saved into a file 'Hamiltoni_Lead_' + num2str(Hanyadik_Lead) + '.mat'.
186 %> @
param 'CustomHamiltonian' An instance of class
#Custom_Hamiltonians describing external source of Hamiltonians. 190 p.addParameter(
'toSave', 0);
191 p.addParameter(
'CustomHamiltonian', []);
192 p.parse(varargin{:});
194 toSave = p.Results.toSave;
195 CustomHamiltonian = p.Results.CustomHamiltonian;
199 if ~isempty( obj.Opt.custom_Hamiltonians )
200 if isempty( CustomHamiltonian )
204 if ~CustomHamiltonian.Read( 'Hamiltonians_loaded' )
205 CustomHamiltonian.LoadHamiltonians();
208 obj.coordinates = CustomHamiltonian.Read( 'coordinates' );
209 obj.coordinates = obj.coordinates{obj.Hanyadik_Lead};
210 obj.
H0 = CustomHamiltonian.Read(
'H0' );
211 obj.H0 = obj.H0{obj.Hanyadik_Lead};
212 obj.H1 = CustomHamiltonian.Read(
'H1' );
213 obj.H1 = obj.H1{obj.Hanyadik_Lead};
215 obj.H1_transverse = CustomHamiltonian.Read( 'H1_transverse
' ); 216 obj.H1_transverse = obj.H1_transverse{obj.Hanyadik_Lead}; 217 obj.S0 = CustomHamiltonian.Read( 'S0
' ); 219 obj.S0 = obj.S0{obj.Hanyadik_Lead}; 221 obj.S1 = CustomHamiltonian.Read( 'S1
' ); 223 obj.S1 = obj.S1{obj.Hanyadik_Lead}; 226 obj.S1_transverse = CustomHamiltonian.Read(
'S1_transverse' );
227 if iscell( obj.S1_transverse )
228 obj.S1_transverse = obj.S1_transverse{obj.Hanyadik_Lead};
230 obj.M = size(obj.H0,1);
231 %obj.kulso_szabfokok = 1:obj.M;
232 elseif strcmpi(obj.Opt.Lattice_Type,
'Square')
234 [obj.H0,obj.H1,obj.H1_transverse,obj.coordinates] = createH.Square_Hamiltonians(obj.params, obj.M );
236 obj.kulso_szabfokok = 1:obj.M;
237 elseif strcmpi(obj.
Opt.Lattice_Type, 'SSH')
239 [obj.H0,obj.H1,obj.H1_transverse,obj.coordinates] = createH.SSH_Hamiltonians(obj.params );
241 obj.kulso_szabfokok = 1;
242 elseif strcmp(obj.
Opt.Lattice_Type, 'Lieb')
244 [obj.H0,obj.H1,obj.H1_transverse,obj.coordinates] = createH.Lieb_Hamiltonians(obj.params, obj.M );
246 obj.M = size(obj.H0,1);
247 obj.kulso_szabfokok = [];%1:3:3*obj.M-2;
248 elseif strcmp(obj.
Opt.Lattice_Type, 'BiTeI')
250 [obj.H0,obj.H1,obj.H1_transverse,obj.coordinates] = createH.BiTeI_Hamiltonians(obj.params, obj.M );
252 obj.M = size(obj.H0,1);
253 obj.kulso_szabfokok = [];%sort([1:4:2*obj.M-1, 2:4:2*obj.M], 'ascend');%[];
254 elseif strcmp(obj.
Opt.Lattice_Type, 'Graphene') || strcmpi(obj.
Opt.Lattice_Type, 'H')
256 [obj.H0,obj.H1,obj.H1_transverse,obj.coordinates] = createH.Graphene_Hamiltonians(obj.params, obj.M, obj.params.End_Type );
258 obj.kulso_szabfokok = (1:obj.M);
259 elseif strcmp(obj.
Opt.Lattice_Type, 'Graphene_SOC')
261 [obj.H0, obj.H1, obj.H1_transverse, obj.H1_skew_left, obj.H1_skew_right, obj.coordinates] = createH.Graphene_SOC_Hamiltonians(obj.params, obj.M, obj.params.End_Type );
263 if abs(obj.params.ValleyZeeman) > 1e-8 || abs(obj.params.Intrinsic) > 1e-8
266 obj.kulso_szabfokok = [1:obj.M, size(obj.H0,1)/2 + (1:obj.M)];
267 elseif strcmpi(obj.
Opt.Lattice_Type, 'Graphene_Bilayer')
269 [obj.H0,obj.H1,obj.H1_transverse,obj.coordinates] = createH.Graphene_Bilayer_Hamiltonians(obj.params, obj.M, obj.params.End_Type );
271 obj.kulso_szabfokok = [1:obj.M, size(obj.H0,1)/2 + (1:obj.M)];
273 elseif strcmpi(obj.
Opt.Lattice_Type, 'Graphene_Bilayer_2')
275 [obj.H0,obj.H1,obj.H1_transverse,obj.coordinates] = createH.Graphene_Bilayer_Hamiltonians2(obj.params, obj.M, obj.params.End_Type );
277 obj.kulso_szabfokok = [1:obj.M, size(obj.H0,1)/2 + (1:obj.M)];
279 elseif strcmpi(obj.
Opt.Lattice_Type, 'Graphene_Bilayer_3')
281 [obj.H0,obj.H1,obj.H1_transverse,obj.coordinates] = createH.Graphene_Bilayer_Hamiltonians3(obj.params, obj.M, obj.params.End_Type );
283 obj.kulso_szabfokok = [1:obj.M+1, size(obj.H0,1)/2 + (1:obj.M+1)];
285 elseif strcmpi(obj.
Opt.Lattice_Type, 'Silicene')
287 [obj.H0,obj.H1,obj.H1_transverse,obj.coordinates] = createH.Silicene_Hamiltonians(obj.params, obj.M, obj.params.End_Type );
289 obj.kulso_szabfokok = [1:obj.M, size(obj.H0,1)/2 + (1:obj.M)];
291 elseif strcmpi(obj.
Opt.Lattice_Type, 'Triangle')
293 [obj.H0, obj.H1 ,obj.H1_transverse, obj.H1_skew_left, obj.coordinates] = createH.Triangle_Hamiltonians(obj.params, obj.M );
295 obj.kulso_szabfokok = [1:obj.M];
296 elseif strcmpi(obj.
Opt.Lattice_Type, 'TMDC_Monolayer')
298 [obj.H0, obj.H1 ,obj.H1_transverse, obj.H1_skew_left, obj.coordinates] = createH.TMDC_Monolayer_Hamiltonians(obj.params, obj.M );
300 obj.kulso_szabfokok = 1:size(obj.H0,1);
301 obj.M = size(obj.H0,1);
302 elseif strcmpi(obj.
Opt.Lattice_Type, 'TMDC_Monolayer_SOC')
304 [obj.H0, obj.H1 ,obj.H1_transverse, obj.H1_skew_left, obj.coordinates] = createH.TMDC_Monolayer_SOC_Hamiltonians(obj.params, obj.M );
306 obj.kulso_szabfokok = 1:size(obj.H0,1);
307 obj.M = size(obj.H0,1);
308 elseif strcmpi(obj.
Opt.Lattice_Type, 'TMDC_Bilayer_SOC')
310 [obj.H0, obj.H1 ,obj.H1_transverse, obj.H1_skew_left, obj.coordinates] = createH.TMDC_Bilayer_SOC_Hamiltonians(obj.params, obj.M );
312 obj.kulso_szabfokok = 1:size(obj.H0,1);
313 obj.M = size(obj.H0,1);
318 obj.Transform2Spin();
325 obj.HamiltoniansCreated = true;
326 obj.OverlapApplied = false;
327 obj.HamiltoniansDecimated = false;
328 obj.MagneticFieldApplied = false;
329 obj.GaugeTransformationApplied = false;
335 %> @brief Transforms the
Hamiltonians and the overlap matrices to include electron spin.
336 function Transform2Spin( obj )
338 if isempty(obj.
Opt.Spin) || ~obj.
Opt.Spin
342 if ~isempty( obj.coordinates.spinup )
343 % spin is also included in the model
347 fnames = fieldnames( obj.coordinates );
348 for idx = 1:length(fnames)
350 if strcmp(fname,
'a') || strcmp(fname,
'b')
353 obj.coordinates.(fname) = [ obj.coordinates.(fname); obj.coordinates.(fname) ];
356 obj.coordinates.spinup = [ true(size(obj.H0,1),1); false(size(obj.H0,1),1)];
358 obj.kulso_szabfokok = [obj.kulso_szabfokok, obj.kulso_szabfokok+size(obj.H0,1)];
362 obj.H0 = [obj.H0, sparse([],[],[], size(obj.H0,1), size(obj.H0,2)); sparse([],[],[], size(obj.H0,1), size(obj.H0,2)), obj.H0];
363 obj.H1 = [obj.H1, sparse([],[],[], size(obj.H1,1), size(obj.H1,2)); sparse([],[],[], size(obj.H1,1), size(obj.H1,2)), obj.H1];
364 obj.H1adj = [obj.H1adj, sparse([],[],[], size(obj.H1adj,1), size(obj.H1adj,2)); sparse([],[],[], size(obj.H1adj,1), size(obj.H1adj,2)), obj.H1adj];
366 obj.H1_transverse = [obj.H1_transverse, sparse([],[],[], size(obj.H1_transverse,1), size(obj.H1_transverse,2)); ...
367 sparse([],[],[], size(obj.H1_transverse,1), size(obj.H1_transverse,2)), obj.H1_transverse];
369 % transforming th eoverlap integrals
370 if ~isempty( obj.S0 )
371 obj.S0 = [obj.S0, sparse([], [], [], size(obj.S0,1), size(obj.S0,2)); ...
372 sparse([], [], [], size(obj.S0,1), size(obj.S0,2)), obj.S0];
376 obj.S1 = [obj.S1, sparse([], [], [], size(obj.S1,1), size(obj.S1,2)); ...
377 sparse([], [], [], size(obj.S1,1), size(obj.S1,2)), obj.S1];
380 if ~isempty( obj.S1_transverse )
381 obj.S1_transverse = [obj.S1_transverse, sparse([], [], [], size(obj.S1_transverse,1), size(obj.S1_transverse,2)); ...
382 sparse([], [], [], size(obj.S1_transverse,2), size(obj.S1_transverse,1)), obj.S1_transverse];
391 %> @brief Transforms the
Hamiltonians and the overlap matrices into the BdG model in the Nambu space representation according to
393 %> It is assumed, that the Hamiltonian is already transfromed to the grand canonical operator: \f$ \hat{H} \rightarrow \hat{H} - E_F\hat{N}\f$
394 function Transform2BdG( obj )
396 if isempty(obj.Opt.BdG) || ~obj.Opt.BdG
397 obj.display([
'EQuUs:',
class(obj),
':Transform2BdG: BdG option is not set to true in the computational parameters.'])
401 if ~isempty( obj.coordinates.BdG_u )
402 % already transformed into BdG model
403 obj.display([
'EQuUs:',
class(obj),
':Transform2BdG: Hamiltonians already transformed intt the BdG model.'])
408 obj.kulso_szabfokok = [obj.kulso_szabfokok, obj.kulso_szabfokok+size(obj.H0,1)];
411 pair_potential = obj.params.pair_potential;
415 S0 = speye(size(obj.H0));
420 H0_hole = -conj(obj.H0);
421 % apply time reversal symmetry on spins according to Eq (3) of PRB 86 134522 (2012)
422 if ~isempty(obj.coordinates.spinup)
423 H0_hole = [H0_hole(~obj.coordinates.spinup, ~obj.coordinates.spinup), -H0_hole(~obj.coordinates.spinup, obj.coordinates.spinup);
424 -H0_hole(obj.coordinates.spinup, ~obj.coordinates.spinup), H0_hole(obj.coordinates.spinup, obj.coordinates.spinup) ];
427 obj.H0 = [obj.H0, S0*pair_potential; S0*conj(pair_potential), H0_hole];
430 S1 = sparse([],[],[], size(obj.H1,1), size(obj.H1,2));
436 H1_hole = -conj(obj.H1);
437 % apply time reversal symmetry on spins according to Eq (3) of PRB 86 134522 (2012)
438 if ~isempty(obj.coordinates.spinup)
439 H1_hole = [H1_hole(~obj.coordinates.spinup, ~obj.coordinates.spinup), -H1_hole(~obj.coordinates.spinup, obj.coordinates.spinup);
440 -H1_hole(obj.coordinates.spinup, ~obj.coordinates.spinup), H1_hole(obj.coordinates.spinup, obj.coordinates.spinup) ];
442 obj.H1 = [obj.H1, S1*pair_potential; S1*conj(pair_potential), H1_hole];
445 H1adj_hole = -conj(obj.H1adj);
446 % apply time reversal symmetry on spins according to Eq (3) of PRB 86 134522 (2012)
447 if ~isempty(obj.coordinates.spinup)
448 H1adj_hole = [H1adj_hole(~obj.coordinates.spinup, ~obj.coordinates.spinup), -H1adj_hole(~obj.coordinates.spinup, obj.coordinates.spinup);
449 -H1adj_hole(obj.coordinates.spinup, ~obj.coordinates.spinup), H1adj_hole(obj.coordinates.spinup, obj.coordinates.spinup) ];
451 obj.H1adj = [obj.H1adj, S1'*pair_potential; S1'*conj(pair_potential), H1adj_hole];
454 if isempty(obj.S1_transverse)
455 S1_transverse = sparse([],[],[], size(obj.H1_transverse,1), size(obj.H1_transverse,2));
457 S1_transverse = obj.S1_transverse;
460 H1_transverse_hole = -conj(obj.H1_transverse);
461 % apply time reversal symmetry on spins according to Eq (3) of PRB 86 134522 (2012)
462 if ~isempty(obj.coordinates.spinup)
463 H1_transverse_hole = [H1_transverse_hole(~obj.coordinates.spinup, ~obj.coordinates.spinup), -H1_transverse_hole(~obj.coordinates.spinup, obj.coordinates.spinup);
464 -H1_transverse_hole(obj.coordinates.spinup, ~obj.coordinates.spinup), H1_transverse_hole(obj.coordinates.spinup, obj.coordinates.spinup) ];
466 obj.H1_transverse = [obj.H1_transverse, S1_transverse*pair_potential; S1_transverse*conj(pair_potential), H1_transverse_hole];
469 % transforming the overlap integrals
470 if ~isempty( obj.S0 )
471 obj.S0 = [obj.S0, sparse([], [], [], size(obj.S0,1), size(obj.S0,2)); sparse([], [], [], size(obj.S0,1), size(obj.S0,2)), obj.S0];
475 obj.S1 = [obj.S1, sparse([], [], [], size(obj.S1,1), size(obj.S1,2)); sparse([], [], [], size(obj.S1,1), size(obj.S1,2)), obj.S1];
479 if ~isempty( obj.S1_transverse )
480 obj.S1_transverse = [obj.S1_transverse, sparse([], [], [], size(obj.S1_transverse,1), size(obj.S1_transverse,2)); ...
481 sparse([], [], [], size(obj.S1_transverse,2), size(obj.S1_transverse,1)), obj.S1_transverse];
485 if ~isempty(obj.H1_skew_right)
486 H1_skew_right_hole = -conj(obj.H1_skew_right);
487 % apply time reversal symmetry on spins according to Eq (3) of PRB 86 134522 (2012)
488 if ~isempty(obj.coordinates.spinup)
489 H1_skew_right_hole = [H1_skew_right_hole(~obj.coordinates.spinup, ~obj.coordinates.spinup), -H1_skew_right_hole(~obj.coordinates.spinup, obj.coordinates.spinup);
490 -H1_skew_right_hole(obj.coordinates.spinup, ~obj.coordinates.spinup), H1_skew_right_hole(obj.coordinates.spinup, obj.coordinates.spinup) ];
492 obj.H1_skew_right = [obj.H1_skew_right, S1_transverse*pair_potential; S1_transverse*conj(pair_potential), H1_skew_right_hole];
496 if ~isempty(obj.H1_skew_left)
497 H1_skew_left_hole = -conj(obj.H1_skew_left);
498 % apply time reversal symmetry on spins according to Eq (3) of PRB 86 134522 (2012)
499 if ~isempty(obj.coordinates.spinup)
500 H1_skew_left_hole = [H1_skew_left_hole(~obj.coordinates.spinup, ~obj.coordinates.spinup), -H1_skew_left_hole(~obj.coordinates.spinup, obj.coordinates.spinup);
501 -H1_skew_left_hole(obj.coordinates.spinup, ~obj.coordinates.spinup), H1_skew_left_hole(obj.coordinates.spinup, obj.coordinates.spinup) ];
503 obj.H1_skew_left = [obj.H1_skew_left, S1_transverse*pair_potential; S1_transverse*conj(pair_potential), H1_skew_left_hole];
507 % the number of
sites in the cross section becomes twice as many as in the normal case
511 % transforming the coordinates
512 obj.coordinates = obj.coordinates.Transform2BdG();
513 % checking the crated BdG array ---- this is necessary when the structure coordinates was nat filled in with informations, when the
Hamiltonians were created
514 if isempty( obj.coordinates.BdG_u )
515 obj.coordinates.BdG_u = [ true(size(obj.H0,1),1); false(size(obj.H0,1),1)];
524 %> @brief Calculates the band structure of the lead.
525 %> @
param varargin Cell array of optional parameters:
526 %> @
param 'toPlot' Set 1 in order to plot the calculated spectrum, 0 (default) otherwise
527 %> @
param 'ka_min' The lower bound of the wave numbers. (Default is -pi.)
528 %> @
param 'ka_max' The upper bound of the wave numbers. (Default is pi.)
529 %> @
param 'ka_num' The number of wave number points involved in the calculations. (Default is 300.)
530 %> @
param 'ka_vec' One dimensional array of the k-pints. (Overrides previous attributes related to the k-vector array.)
531 %> @
param 'center' The calculated energy eigenvalues are centered around this value. (Default is 0.001.)
532 %> @
param 'db' The number of the calculated eigenvalues.
533 %> @
param 'offset' Offset value to shift the spectrum along the energy axis.
534 %> @
param 'calcWaveFnc' Logical value. Set true to calculate also the wave functions, or false (default) otherwise.
535 %> @return [1] ka_num x 2 array of the calculated spactrum. In the first column are the k-points, whil ein the second columns are the calculated energy points.
536 %> @return [2] The calculated wave functions stored in a structure
#WaveFnc. 537 function [spectrum,
WaveFnc] = CalcSpektrum( obj, varargin )
540 p.addParameter(
'toPlot', 0, @isscalar);
541 p.addParameter(
'ka_min', -pi, @isscalar);
542 p.addParameter(
'ka_max', pi, @isscalar);
543 p.addParameter(
'ka_num', 300, @isscalar);
544 p.addParameter(
'ka_vec', [] );
545 p.addParameter(
'center', 0.001);
546 p.addParameter(
'db', min([10,size(obj.H0,1)]), @isscalar);
547 p.addParameter(
'offset', mean(diag(obj.H0)) ); %Offset value to shift the spectrum along the energy axis
548 p.addParameter(
'calcWaveFnc',
false ); %Logical value. Set
true to calculate also the wave functions, or
false (
default) otherwise.
550 p.parse(varargin{:});
551 toPlot = p.Results.toPlot;
552 ka_min = p.Results.ka_min;
553 ka_max = p.Results.ka_max;
554 ka_num = p.Results.ka_num;
555 ka_vec = p.Results.ka_vec;
556 center = p.Results.center;
558 offset = p.Results.offset;
559 calcWaveFnc = p.Results.calcWaveFnc;
563 if obj.HamiltoniansDecimated
564 obj.display([
'EQuUs:',
class(obj),
':CalcSpektrum: Hamiltonians are decimated. Please recreate Hamiltonians to calculate spectrum.'], 1)
569 % check the number of eigenvalues
570 db = min([ db, size(obj.H0,1)]);
573 obj.display(
'Calculating spectrum')
575 % discrete increment of the wavenumber array
576 deltak = (ka_max-ka_min)/ka_num;
578 % allocating temporary matricest;
581 S1_transverse_loc = obj.S1_transverse;
584 % creating the one-dimensional array
for the wave numbers
if not given
586 ka_vec = ka_min:deltak:ka_max;
589 % allocating arrays
for the results
590 spectrum = cell(length(ka_vec),1);
597 % calculating the spectrum
598 for idx=1:length(ka_vec)
599 % obtaining the k-dependent effective Hamiltonian
600 H = obj.MomentumDependentHamiltonian( ka_vec(idx), obj.q );
601 H = H - eye(size(H))*offset;
603 if isempty( S0_loc ) && isempty( S1_loc )
605 % calculations including the wavefunctions
607 [WaveFnc_tmp, E] = eigs(H, db, center);
609 [WaveFnc_tmp, E] = eig(H);
616 % only eigenvalues are calculated
618 E = eigs(H, db, center);
624 % calculations including the overlap matrices
625 S =
secular_H( S0_loc, S1_loc, S1_transverse_loc, ka_vec(idx));
627 % calculations including the wavefunctions
629 [WaveFnc_tmp, E] = eigs(H, S, db, center);
631 [WaveFnc_tmp, E] = eig(H, S);
638 % only eigenvalues are calculated
640 E = eigs(H, S, db, center);
647 spectrum{idx} = [ones(length(E),1)*ka_vec(idx), E];
650 % reorganize the calculated data
651 spectrum = cell2mat(spectrum);
654 obj.display(
'Spectrum calculated')
656 % check whether to plot the spectrum
661 % plot the calculated spectrum
665 spectrum(:,2) = real(spectrum(:,2));
666 x_lim = [min(spectrum(:,1)) max(spectrum(:,1))];
667 y_lim = [min(spectrum(:,2)) max(spectrum(:,2))];
669 Position = [0.5 0.58 0.33 0.4];
670 axes_spectrum = axes('Parent',figure1, 'Position', Position,...
672 'FontSize', fontsize,...
674 'ylim', y_lim,... 'XTick', XTick,... 'YTick', YTick,...
676 'FontName','Times New Roman');
679 plot(spectrum(:,1), spectrum(:,2),'.', 'MarkerSize', 4, 'Parent', axes_spectrum )
682 xlabel_position = [0 0 0];
683 xlabel('ka','FontSize', fontsize,'FontName','Times New Roman', 'Parent', axes_spectrum);
684 xlabel_handle = get(axes_spectrum,'XLabel');
685 set(xlabel_handle, 'Position', get(xlabel_handle, 'Position') + xlabel_position);
688 ylabel_position = [0 0 0];
689 ylabel('E [eV]','FontSize', fontsize,'FontName','Times New Roman', 'Parent', axes_spectrum);
690 ylabel_handle = get(axes_spectrum,'YLabel');
691 set(ylabel_handle, 'Position', get(ylabel_handle, 'Position') + ylabel_position);
694 % --------------------------------------
696 % Hamiltonian for the secular equation
697 function H =
secular_H(H0,H1, H1_transverse, k)
699 if ~isempty(q) && ~obj.HamiltoniansDecimated
700 H0 = H0 + H1_transverse*diag(exp(-1i*q)) + H1_transverse'*diag(exp(1i*q));
702 H = H0 + H1*exp(1i*k) + H1'*exp(-1i*k);
706 % end nested functions
712 %> @brief Save
Lead Hamiltonians into a file 'Hamiltoni_Lead_' + num2str(Hanyadik_Lead) + '.mat'.
713 function saveLeads( obj )
714 save(['Hamiltoni_Lead_',num2str(obj.Hanyadik_Lead),'.mat'], 'H0', 'H1', 'kulso_szabfokok', 'Lead_Orientation', 'fazis_mtx_H0', 'fazis_mtx_H1', 'params');
718 %> @brief Shifts the coordinates of the
sites by an integer multiple of the lattice vector
#Coordinates.a. 719 %> @
param shift Integer by which the coordinates are shifted.
720 function ShiftCoordinates( obj, shift )
721 if isempty(shift) || shift == 0
725 % shifting the coordinates along the translational invariant direction
726 obj.coordinates = obj.coordinates.Shift( shift*obj.coordinates.a );
733 %> @brief Shifts the on-site energies in the leads by a given energy.
734 %> @
param Energy The enrgy value.
735 function ShiftLead( obj, Energy )
736 obj.H0 = obj.H0 + sparse(1:size(obj.H0,1), 1:size(obj.H0,2),Energy,size(obj.H0,1),size(obj.H0,2));
737 obj.params.epsilon = obj.params.epsilon + Energy;
740 obj.OverlapApplied =
false;
744 %> @brief Adds on-site potential to the Hamiltonian H0.
745 %> @
param V The potential calculated on the
sites.
746 function AddPotential( obj, V )
748 if ( size(V,2) == 1 ) || ( size(V,1) == 1 )
749 if length(V) == size(obj.H0,1)
750 obj.H0 = obj.H0 + sparse(1:size(obj.H0,1), 1:size(obj.H0,2),V,size(obj.H0,1),size(obj.H0,2));
752 obj.OverlapApplied = false;
754 disp(' Wrong dimension of potential: 1')
757 elseif norm(size(V) - size(obj.H0)) < 1e-6
760 obj.OverlapApplied = false;
762 disp(' Wrong dimension of potential: 2')
766 obj.display(' Potential added to lead')
770 %> @brief Test, whether the lead is in the superconducting phase or not.
771 %> @return True if the lead is superconducting, false otherwise.
772 function ret = isSuperconducting( obj )
779 if abs(obj.params.pair_potential) >= 1e-10
791 %% MomentumDependentHamiltonian
792 %> @brief Construct a momentum dependent (Fourier-transformed) Hamiltonian.
793 %> @
param ka The longitudinal momentum times the lattice constant.
794 %> @
param qb The transverse momentum times the transverse lattice constant.
795 %> @return Return with the momentum dependent Hamiltonian.
796 function ret = MomentumDependentHamiltonian( obj, ka, qb )
799 if obj.HamiltoniansDecimated
800 obj.display(['EQuUs:', class(obj), ':MomentumDependentHamiltonian:
Hamiltonians are decimated. Please recreate
Hamiltonians.'], 1)
807 ret = ret + obj.H1*diag(exp(1i*ka)) + obj.H1'*diag(exp(-1i*ka));
814 if ~isempty(obj.H1_transverse)
815 ret = ret + obj.H1_transverse*diag(exp(1i*qb)) + obj.H1_transverse'*diag(exp(-1i*qb));
818 if ~isempty(obj.H1_skew_right)
819 ret = ret + obj.H1_skew_right*diag(exp(1i*(qb-ka))) + obj.H1_skew_right'*diag(exp(-1i*(qb-ka)));
822 if ~isempty(obj.H1_skew_left)
823 ret = ret + obj.H1_skew_left*diag(exp(1i*(qb+ka))) + obj.H1_skew_left'*diag(exp(-1i*(qb+ka)));
833 %% qDependentHamiltonians
834 %> @brief Construct a K0 and K1
Hamiltonians (transformed to the grand canonical potential) for a given subspace of the transverse momentum number
#q. 835 %> @
return [1] the transverse momentum dependent Hamiltonian of the unit cell.
836 %> @
return [2] the transverse momentum dependent Hamiltonian of the coupling boeween the unit cells.
837 %> @
return [3] the transverse momentum dependent Hamiltonian of the coupling boeween the unit cells in the opposite direction.
838 function [K0, K1, K1adj] = qDependentHamiltonians( obj )
844 if obj.HamiltoniansDecimated
850 % applying transverse coupling
851 if ~isempty(obj.q) && ~isempty(obj.K1_transverse)
852 K0 = K0 + obj.K1_transverse*diag(exp(1i*obj.q)) + obj.K1_transverse'*diag(exp(-1i*obj.q));
855 % applying skew_right transverse coupling
856 if ~isempty(obj.q) && ~isempty(obj.K1_skew_right)
857 K1 = K1 + obj.K1_skew_right'*diag(exp(-1i*obj.q));
860 % applying skew_left transverse coupling
861 if ~isempty(obj.q) && ~isempty(obj.K1_skew_left)
862 K1 = K1 + obj.K1_skew_left*diag(exp(1i*obj.q));
875 %% qDependentOverlaps
876 %> @brief Construct a S0 and S1 overlap matrices for a given subspace of the transverse momentum number
#q. 877 %> @
return [1] the transverse momentum dependent overlap matrix of the unit cell.
878 %> @
return [2] the transverse momentum dependent overlap matrix of the coupling between the unit cells.
879 %> @
return [3] the transverse momentum dependent overlap matrix of the coupling boeween the unit cells in the opposite direction.
880 function [S0, S1, S1adj] = qDependentOverlaps( obj )
886 if obj.HamiltoniansDecimated
892 % applying transverse coupling
893 if ~isempty(obj.q) && ~isempty(obj.S1_transverse)
894 S0 = S0 + obj.S1_transverse*diag(exp(1i*obj.q)) + obj.S1_transverse'*diag(exp(-1i*obj.q));
897 % applying skew_right transverse coupling
898 if ~isempty(obj.q) && ~isempty(obj.S1_skew_right)
899 S1 = S1 + obj.S1_skew_right'*diag(exp(-1i*obj.q));
902 % applying skew_left transverse coupling
903 if ~isempty(obj.q) && ~isempty(obj.S1_skew_left)
904 S1 = S1 + obj.S1_skew_left*diag(exp(1i*obj.q));
916 %> @brief Creates a clone of the present class.
917 %> @return Returns with the cloned
object.
918 %> @
param varargin Cell array of optional parameters (https:
919 %> @
param 'empty' Set true to create an empty clone, or false (default) to clone all atributes.
920 function ret = CreateClone( obj, varargin )
923 p.addParameter('empty', false ); %Logical value. Set true for creating an empty class, or false (default) otherwise.
925 p.parse(varargin{:});
926 empty = p.Results.empty;
929 'Hanyadik_Lead', obj.Hanyadik_Lead,...
930 'Lead_Orientation', obj.Lead_Orientation, ...
936 meta_data = metaclass(obj);
938 for idx = 1:length(meta_data.PropertyList)
939 prop_name = meta_data.PropertyList(idx).Name;
940 ret.Write( prop_name, obj.(prop_name));
946 %> @brief Resets all elements in the
object.
947 function Reset( obj )
950 meta_data = metaclass(obj);
952 for idx = 1:length(meta_data.PropertyList)
953 prop_name = meta_data.PropertyList(idx).Name;
954 if strcmp(prop_name, '
Opt') || strcmp( prop_name, '
param') || strcmp(prop_name, 'varargin')
957 obj.Clear( prop_name );
969 %> @brief Sets the value of an attribute in the interface.
970 %> @
param MemberName The name of the attribute to be set.
971 %> @
param input The value to be set.
972 function Write(obj, MemberName, input)
974 if strcmp(MemberName, '
param')
978 elseif strcmpi(MemberName, 'params')
980 if isempty(obj.Hanyadik_Lead)
981 obj.
param.scatter = input;
983 obj.
param.Leads{obj.Hanyadik_Lead} = input;
987 obj.(MemberName) = input;
989 error([
'EQuUs:',
class(obj),
':Read'], [
'No property to write with name: ', MemberName]);
995 %> @brief Query
for the value of an attribute in the interface.
996 %> @
param MemberName The name of the attribute to be set.
997 %> @
return Returns with the value of the attribute.
998 function ret = Read(obj, MemberName)
1001 ret = obj.(MemberName);
1003 error([
'EQuUs:',
class(obj),
':Read'], [
'No property to read with name: ', MemberName]);
1008 %> @brief Clears the value of an attribute in the interface.
1009 %> @
param MemberName The name of the attribute to be cleared.
1010 function Clear(obj, MemberName)
1013 obj.(MemberName) = [];
1015 error([
'EQuUs:',
class(obj),
':Clear'], [
'No property to clear with name: ', MemberName]);
1020 end %
public methods
1023 methods ( Access =
protected )
1026 %> @brief Updates the number of
sites in the cross section.
1027 function setM( obj )
1028 if isempty( obj.Hanyadik_Lead )
1031 obj.M = obj.
param.Leads{obj.Hanyadik_Lead}.M;
1037 %> @brief Initializes
object properties.
1038 function Initialize(obj)
1039 obj.InputParsing( obj.varargin{:});
1042 obj.HamiltoniansCreated =
false;
1043 obj.HamiltoniansDecimated =
false;
1044 obj.OverlapApplied =
false;
1045 obj.MagneticFieldApplied =
false;
1046 obj.GaugeTransformationApplied =
false;
1052 if isempty( obj.Hanyadik_Lead )
1053 obj.params = obj.
param.scatter; %
Lead parameters
1055 obj.params = obj.
param.Leads{obj.Hanyadik_Lead}; %
Lead parameters
1060 end %
protected methods
1063 methods (Access=
protected)
1067 %> @brief Parses the optional parameters
for the
class constructor.
1068 %> @
param varargin Cell array of optional parameters (https:
1069 %> @
param 'Hanyadik_Lead' The ID number of the current lead. Set to empty (
default)
for using parameters of the scatter region.
1070 %> @
param 'Lead_Orientation' Orientation of the lead. Set +1 (
default) is the
"incoming" direction of the propagating states is defined in the +x or +y direction, and
"-1" otherwise.
1071 %> @
param 'q' The transverse momentum. Set to empty (
default)
for computations without transverse momentums.
1072 function InputParsing( obj, varargin )
1074 p.addParameter(
'Hanyadik_Lead', []);
1075 p.addParameter(
'Lead_Orientation', 1);
1076 p.addParameter(
'q', []);
1078 % keeping unmatched attributes that possibly comes from the derived classes
1079 p.KeepUnmatched =
true;
1081 p.parse(varargin{:});
1083 obj.Lead_Orientation = p.Results.Lead_Orientation;
1084 obj.Hanyadik_Lead = p.Results.Hanyadik_Lead;
1085 obj.q = p.Results.q;
1092 end %
private methods
A class to create the Hamiltonian of one unit cell in a translational invariant graphene bilayer lead...
Class to create the Hamiltonian of one unit cell in a translational invariant lead made of Triangle l...
A class containing methodes for displaying several standard messages.
Structure Opt contains the basic computational parameters used in EQuUs.
E
Cell array containing the individual energies.
Structure shape contains data about the geometry of the scattering region.
Class to create and store Hamiltonian of the translational invariant leads.
Class to create the Hamiltonian of one unit cell in a translational invariant lead made of square lat...
function Transport(Energy, B)
Calculates the conductance at a given energy value.
WaveFnc
Cell array containing the individual wave functions.
Class to create the Hamiltonian of one unit cell on a BiTeI lattice.
function Hamiltonians(varargin)
Function to create the custom Hamiltonians for the 1D chain.
A class to import custom Hamiltonians provided by other codes or created manually
function secular_H(H0, H1, k)
Hamiltonian for the secular equation.
Property H0
Cell array of Hamiltonians of one slab in the leads.
A class to calculate the Green functions and self energies of a translational invariant lead The nota...
Class to create the Hamiltonian of one unit cell in a translational invariant lead made of TMDC_Monol...
Structure param contains data structures describing the physical parameters of the scattering center ...
ka
Cell array containing the individual k-pints.
Class to create the Hamiltonian of one unit cell in a translational invariant lead made of TMDC_Monol...
Structure sites contains data to identify the individual sites in a matrix.
A class responsible for the Peierls and gauge transformations.
Structure containg datat on the calculated eigenstate in a translational invariant lead.
A class to create the Hamiltonian of one unit cell in a translational invariant graphene lead,...
A class to create the Hamiltonian of one unit cell in a translational invariant silicene lead.
A class to create the Hamiltonian of one unit cell in a translational invariant lead made of hexagona...
function structures(name)
Class to create the Hamiltonian of one unit cell in a translational invariant lead made of TMDC bilay...
A class to create and store Hamiltonian of the scattering region.