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 %> The Hamiltonian of a unit cell.
59 %> The coupling Hamiltonian between the unit cells.
61 %> The coupling Hamiltonian between the unit cells in the opposite direction as H1. (For complex energies they differ from each other.)
65 %> The transverse coupling between the slabs for transverse calculations.
67 %> The skew upward (in the negative direction) coupling between
Hamiltonians H0 for transverse calculations.
69 %> The skew coupling (in the positive direction) between
Hamiltonians H0 for transverse calculations.
71 %> The overlap integrals of a unit cell.
73 %> The overlap integrals between the unit cells.
75 %> The adjungate of the overlap integrals between the unit cells.
77 %> The overlap integrals between the slabs for transverse calculations.
79 %> The matrix of the
Peierls phases in the unit cell.
81 %> The matrix of the
Peierls phases in the coupling matrix between the unit cells.
83 %> The matrix of the
Peierls phases in the transverse coupling matrix between the unit cells.
85 %> A logical value. True if the
Hamiltonians were created, false otherwise.
87 %> A logical value. True if the
Hamiltonians were decimated, false otherwise.
89 %> A logical value. True if the overlap integrals were applied, false otherwise.
91 %> A logical value. True if magnetic field was applied in the
Hamiltonians, false otherwise.
93 %> A logical value. True if a gauge transformation was incorporated into the
Hamiltonians or false otherwise.
94 GaugeTransformationApplied
95 %> list of optional parameters (see http:
100 methods ( Access = public )
101 %% constructorof the class
102 %> @brief Constructor of the class.
105 %> @
param varargin Cell array of optional parameters. See
#InputParsing for details. 106 %> @
return An instance of the
class 110 obj.varargin = varargin;
119 %% ApplyOverlapMatrices
120 %> @brief Applies the overlap matrices to the
Hamiltonians: K = H-ES
122 function ApplyOverlapMatrices(obj, E)
124 if obj.OverlapApplied
129 if ~isempty( obj.S0 )
130 obj.K0 = obj.H0 - E*obj.S0;
133 obj.K0 = obj.H0 - speye(size(obj.H0))*E;
136 if ~isempty( obj.S1 )
137 obj.K1 = obj.H1 - E*obj.S1;
138 obj.K1adj = obj.H1adj - E*obj.S1';
141 obj.K1adj = obj.H1adj;
145 if ~isempty( obj.S1_transverse )
146 obj.K1_transverse = obj.H1_transverse - E*obj.S1_transverse;
147 elseif ~isempty( obj.H1_transverse )
148 obj.K1_transverse = obj.H1_transverse;
151 obj.OverlapApplied = true;
156 %> @brief Creates the
Hamiltonians H_0 and H_1 of the lead. The created
Hamiltonians are stored by within the
object.
157 %> @
param varargin Cell array of optional parameters (https:
158 %> @
param 'toSave' Logical value. If true, the created
Hamiltonians are saved into a file 'Hamiltoni_Lead_' + num2str(Hanyadik_Lead) + '.mat'.
159 %> @
param 'CustomHamiltonian' An instance of class
#Custom_Hamiltonians describing external source of Hamiltonians. 163 p.addParameter(
'toSave', 0);
164 p.addParameter(
'CustomHamiltonian', []);
165 p.parse(varargin{:});
167 toSave = p.Results.toSave;
168 CustomHamiltonian = p.Results.CustomHamiltonian;
172 if ~isempty( obj.Opt.custom_Hamiltonians )
173 if isempty( CustomHamiltonian )
177 if ~CustomHamiltonian.Read( 'Hamiltonians_loaded' )
178 CustomHamiltonian.LoadHamiltonians();
181 obj.coordinates = CustomHamiltonian.Read( 'coordinates' );
182 obj.coordinates = obj.coordinates{obj.Hanyadik_Lead};
183 obj.
H0 = CustomHamiltonian.Read(
'H0' );
184 obj.H0 = obj.H0{obj.Hanyadik_Lead};
185 obj.H1 = CustomHamiltonian.Read(
'H1' );
186 obj.H1 = obj.H1{obj.Hanyadik_Lead};
188 obj.H1_transverse = CustomHamiltonian.Read( 'H1_transverse
' ); 189 obj.H1_transverse = obj.H1_transverse{obj.Hanyadik_Lead}; 190 obj.S0 = CustomHamiltonian.Read( 'S0
' ); 192 obj.S0 = obj.S0{obj.Hanyadik_Lead}; 194 obj.S1 = CustomHamiltonian.Read( 'S1
' ); 196 obj.S1 = obj.S1{obj.Hanyadik_Lead}; 199 obj.S1_transverse = CustomHamiltonian.Read(
'S1_transverse' );
200 if iscell( obj.S1_transverse )
201 obj.S1_transverse = obj.S1_transverse{obj.Hanyadik_Lead};
203 obj.M = size(obj.H0,1);
204 %obj.kulso_szabfokok = 1:obj.M;
205 elseif strcmpi(obj.Opt.Lattice_Type,
'Square')
207 [obj.H0,obj.H1,obj.H1_transverse,obj.coordinates] = createH.SquareLattice_Lead_Hamiltonians(obj.params, obj.M );
209 obj.kulso_szabfokok = 1:obj.M;
210 elseif strcmpi(obj.
Opt.Lattice_Type, 'SSH')
212 [obj.H0,obj.H1,obj.H1_transverse,obj.coordinates] = createH.SSH_Lead_Hamiltonians(obj.params );
214 obj.kulso_szabfokok = 1;
215 elseif strcmp(obj.
Opt.Lattice_Type, 'Lieb')
217 [obj.H0,obj.H1,obj.H1_transverse,obj.coordinates] = createH.Lieb_Lead_Hamiltonians(obj.params, obj.M );
219 obj.M = size(obj.H0,1);
220 obj.kulso_szabfokok = [];%1:3:3*obj.M-2;
221 elseif strcmp(obj.
Opt.Lattice_Type, 'BiTeI')
223 [obj.H0,obj.H1,obj.H1_transverse,obj.coordinates] = createH.BiTeILattice_Lead_Hamiltonians(obj.params, obj.M );
225 obj.M = size(obj.H0,1);
226 obj.kulso_szabfokok = [];%sort([1:4:2*obj.M-1, 2:4:2*obj.M], 'ascend');%[];
227 elseif strcmp(obj.
Opt.Lattice_Type, 'Graphene') || strcmpi(obj.
Opt.Lattice_Type, 'H')
229 [obj.H0,obj.H1,obj.H1_transverse,obj.coordinates] = createH.Graphene_Lead_Hamiltonians(obj.params, obj.M, obj.params.End_Type );
231 obj.kulso_szabfokok = (1:obj.M);
232 elseif strcmpi(obj.
Opt.Lattice_Type, 'Graphene_Bilayer')
234 [obj.H0,obj.H1,obj.H1_transverse,obj.coordinates] = createH.Graphene_Bilayer_Lead_Hamiltonians(obj.params, obj.M, obj.params.End_Type );
236 obj.kulso_szabfokok = [1:obj.M, size(obj.H0,1)/2 + (1:obj.M)];
238 elseif strcmpi(obj.
Opt.Lattice_Type, 'Graphene_Bilayer_2')
240 [obj.H0,obj.H1,obj.H1_transverse,obj.coordinates] = createH.Graphene_Bilayer_Lead_Hamiltonians2(obj.params, obj.M, obj.params.End_Type );
242 obj.kulso_szabfokok = [1:obj.M, size(obj.H0,1)/2 + (1:obj.M)];
244 elseif strcmpi(obj.
Opt.Lattice_Type, 'Graphene_Bilayer_3')
246 [obj.H0,obj.H1,obj.H1_transverse,obj.coordinates] = createH.Graphene_Bilayer_Lead_Hamiltonians3(obj.params, obj.M, obj.params.End_Type );
248 obj.kulso_szabfokok = [1:obj.M+1, size(obj.H0,1)/2 + (1:obj.M+1)];
250 elseif strcmpi(obj.
Opt.Lattice_Type, 'Silicene')
252 [obj.H0,obj.H1,obj.H1_transverse,obj.coordinates] = createH.Silicene_Lead_Hamiltonians(obj.params, obj.M, obj.params.End_Type );
254 obj.kulso_szabfokok = [1:obj.M, size(obj.H0,1)/2 + (1:obj.M)];
256 elseif strcmpi(obj.
Opt.Lattice_Type, 'Triangle')
258 [obj.H0, obj.H1 ,obj.H1_transverse, obj.H1_skew_left, obj.coordinates] = createH.Triangle_Hamiltonians(obj.params, obj.M );
260 obj.kulso_szabfokok = [1:obj.M];
261 elseif strcmpi(obj.
Opt.Lattice_Type, 'TMDC_Monolayer')
263 [obj.H0, obj.H1 ,obj.H1_transverse, obj.H1_skew_left, obj.coordinates] = createH.TMDC_Monolayer_Hamiltonians(obj.params, obj.M );
265 obj.kulso_szabfokok = 1:size(obj.H0,1);
266 obj.M = size(obj.H0,1);
267 elseif strcmpi(obj.
Opt.Lattice_Type, 'TMDC_Monolayer_SOC')
269 [obj.H0, obj.H1 ,obj.H1_transverse, obj.H1_skew_left, obj.coordinates] = createH.TMDC_Monolayer_SOC_Hamiltonians(obj.params, obj.M );
271 obj.kulso_szabfokok = 1:size(obj.H0,1);
272 obj.M = size(obj.H0,1);
273 elseif strcmpi(obj.
Opt.Lattice_Type, 'TMDC_Bilayer_SOC')
275 [obj.H0, obj.H1 ,obj.H1_transverse, obj.H1_skew_left, obj.coordinates] = createH.TMDC_Bilayer_SOC_Hamiltonians(obj.params, obj.M );
277 obj.kulso_szabfokok = 1:size(obj.H0,1);
278 obj.M = size(obj.H0,1);
283 obj.Transform2Spin();
290 obj.HamiltoniansCreated = true;
291 obj.OverlapApplied = false;
292 obj.HamiltoniansDecimated = false;
293 obj.MagneticFieldApplied = false;
294 obj.GaugeTransformationApplied = false;
300 %> @brief Transforms the
Hamiltonians and the overlap matrices to include electron spin.
303 if isempty(obj.
Opt.Spin) || ~obj.
Opt.Spin
307 if ~isempty( obj.coordinates.spinup )
308 % spin is also included in the model
312 fnames = fieldnames( obj.coordinates );
313 for idx = 1:length(fnames)
315 if strcmp(fname,
'a') || strcmp(fname,
'b')
318 obj.coordinates.(fname) = [ obj.coordinates.(fname); obj.coordinates.(fname) ];
321 obj.coordinates.spinup = [ true(size(obj.H0,1),1); false(size(obj.H0,1),1)];
323 obj.kulso_szabfokok = [obj.kulso_szabfokok, obj.kulso_szabfokok+size(obj.H0,1)];
327 obj.H0 = [obj.H0, sparse([],[],[], size(obj.H0,1), size(obj.H0,2)); sparse([],[],[], size(obj.H0,1), size(obj.H0,2)), obj.H0];
328 obj.H1 = [obj.H1, sparse([],[],[], size(obj.H1,1), size(obj.H1,2)); sparse([],[],[], size(obj.H1,1), size(obj.H1,2)), obj.H1];
329 obj.H1adj = [obj.H1adj, sparse([],[],[], size(obj.H1adj,1), size(obj.H1adj,2)); sparse([],[],[], size(obj.H1adj,1), size(obj.H1adj,2)), obj.H1adj];
331 obj.H1_transverse = [obj.H1_transverse, sparse([],[],[], size(obj.H1_transverse,1), size(obj.H1_transverse,2)); ...
332 sparse([],[],[], size(obj.H1_transverse,1), size(obj.H1_transverse,2)), obj.H1_transverse];
334 % transforming th eoverlap integrals
335 if ~isempty( obj.S0 )
336 obj.S0 = [obj.S0, sparse([], [], [], size(obj.S0,1), size(obj.S0,2)); ...
337 sparse([], [], [], size(obj.S0,1), size(obj.S0,2)), obj.S0];
341 obj.S1 = [obj.S1, sparse([], [], [], size(obj.S1,1), size(obj.S1,2)); ...
342 sparse([], [], [], size(obj.S1,1), size(obj.S1,2)), obj.S1];
345 if ~isempty( obj.S1_transverse )
346 obj.S1_transverse = [obj.S1_transverse, sparse([], [], [], size(obj.S1_transverse,1), size(obj.S1_transverse,2)); ...
347 sparse([], [], [], size(obj.S1_transverse,2), size(obj.S1_transverse,1)), obj.S1_transverse];
356 %> @brief Transforms the
Hamiltonians and the overlap matrices into the BdG model in the Nambu space representation according to
358 %> 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$
359 function Transform2BdG( obj )
361 if isempty(obj.Opt.BdG) || ~obj.Opt.BdG
362 obj.display([
'EQuUs:',
class(obj),
':Transform2BdG: BdG option is not set to true in the computational parameters.'])
366 if ~isempty( obj.coordinates.BdG_u )
367 % already transformed into BdG model
368 obj.display([
'EQuUs:',
class(obj),
':Transform2BdG: Hamiltonians already transformed intt the BdG model.'])
372 % transforming the coordinates
373 obj.coordinates = obj.coordinates.Transform2BdG();
374 % checking the crated BdG array ----
this is necessary when the structure coordinates was nat filled in with informations, when the
Hamiltonians were created
375 if isempty( obj.coordinates.BdG_u )
376 obj.coordinates.BdG_u = [ true(size(obj.H0,1),1); false(size(obj.H0,1),1)];
379 obj.kulso_szabfokok = [obj.kulso_szabfokok, obj.kulso_szabfokok+size(obj.H0,1)];
381 pair_potential = obj.params.pair_potential;
385 S0 = speye(size(obj.H0));
390 obj.H0 = [obj.H0, S0*pair_potential; S0*conj(pair_potential), -conj(obj.H0)];
393 S1 = sparse([],[],[], size(obj.H1,1), size(obj.H1,2));
398 obj.H1 = [obj.H1, S1*pair_potential; S1*conj(pair_potential), -conj(obj.H1)];
399 obj.H1adj = [obj.H1adj, S1'*pair_potential; S1'*conj(pair_potential), -conj(obj.H1adj)];
401 if isempty(obj.S1_transverse)
402 S1_transverse = sparse([],[],[], size(obj.H1_transverse,1), size(obj.H1_transverse,2));
404 S1_transverse = obj.S1_transverse;
407 obj.H1_transverse = [obj.H1_transverse, S1_transverse*pair_potential; S1_transverse*conj(pair_potential), -conj(obj.H1_transverse)];
409 % transforming the overlap integrals
410 if ~isempty( obj.S0 )
411 obj.S0 = [obj.S0, sparse([], [], [], size(obj.S0,1), size(obj.S0,2)); sparse([], [], [], size(obj.S0,1), size(obj.S0,2)), obj.S0];
415 obj.S1 = [obj.S1, sparse([], [], [], size(obj.S1,1), size(obj.S1,2)); sparse([], [], [], size(obj.S1,1), size(obj.S1,2)), obj.S1];
419 if ~isempty( obj.S1_transverse )
420 obj.S1_transverse = [obj.S1_transverse, sparse([], [], [], size(obj.S1_transverse,1), size(obj.S1_transverse,2)); ...
421 sparse([], [], [], size(obj.S1_transverse,2), size(obj.S1_transverse,1)), obj.S1_transverse];
424 % the number of
sites in the cross section becomes twice as many as in the normal case
430 %> @brief Calculates the band structure of the lead.
431 %> @
param varargin Cell array of optional parameters:
432 %> @
param 'toPlot' Set 1 in order to plot the calculated spectrum, 0 (default) otherwise
433 %> @
param 'ka_min' The lower bound of the wave numbers. (Default is -pi.)
434 %> @
param 'ka_max' The upper bound of the wave numbers. (Default is pi.)
435 %> @
param 'ka_num' The number of wave number points involved in the calculations. (Default is 300.)
436 %> @
param 'ka_vec' One dimensional array of the k-pints. (Overrides previous attributes related to the k-vector array.)
437 %> @
param 'center' The calculated energy eigenvalues are centered around this value. (Default is 0.001.)
438 %> @
param 'db' The number of the calculated eigenvalues.
439 %> @
param 'offset' Offset value to shift the spectrum along the energy axis.
440 %> @
param 'calcWaveFnc' Logical value. Set true to calculate also the wave functions, or false (default) otherwise.
441 %> @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.
442 %> @return [2] The calculated wave functions stored in a structure
#WaveFnc. 443 function [spectrum,
WaveFnc] = CalcSpektrum( obj, varargin )
446 p.addParameter(
'toPlot', 0, @isscalar);
447 p.addParameter(
'ka_min', -pi, @isscalar);
448 p.addParameter(
'ka_max', pi, @isscalar);
449 p.addParameter(
'ka_num', 300, @isscalar);
450 p.addParameter(
'ka_vec', [] );
451 p.addParameter(
'center', 0.001);
452 p.addParameter(
'db', min([10,size(obj.H0,1)]), @isscalar);
453 p.addParameter(
'offset', mean(diag(obj.H0)) ); %Offset value to shift the spectrum along the energy axis
454 p.addParameter(
'calcWaveFnc',
false ); %Logical value. Set
true to calculate also the wave functions, or
false (
default) otherwise.
456 p.parse(varargin{:});
457 toPlot = p.Results.toPlot;
458 ka_min = p.Results.ka_min;
459 ka_max = p.Results.ka_max;
460 ka_num = p.Results.ka_num;
461 ka_vec = p.Results.ka_vec;
462 center = p.Results.center;
464 offset = p.Results.offset;
465 calcWaveFnc = p.Results.calcWaveFnc;
469 if obj.HamiltoniansDecimated
470 obj.display([
'EQuUs:',
class(obj),
':CalcSpektrum: Hamiltonians are decimated. Please recreate Hamiltonians to calculate spectrum.'], 1)
475 % check the number of eigenvalues
476 db = min([ db, size(obj.H0,1)]);
479 obj.display(
'Calculating spectrum')
481 % discrete increment of the wavenumber array
482 deltak = (ka_max-ka_min)/ka_num;
484 % allocating temporary matricest;
487 S1_transverse_loc = obj.S1_transverse;
490 % creating the one-dimensional array
for the wave numbers
if not given
492 ka_vec = ka_min:deltak:ka_max;
495 % allocating arrays
for the results
496 spectrum = cell(length(ka_vec),1);
503 % calculating the spectrum
504 for idx=1:length(ka_vec)
505 % obtaining the k-dependent effective Hamiltonian
506 H = obj.MomentumDependentHamiltonian( ka_vec(idx), obj.q );
507 H = H - eye(size(H))*offset;
509 if isempty( S0_loc ) && isempty( S1_loc )
511 % calculations including the wavefunctions
513 [WaveFnc_tmp, E] = eigs(H, db, center);
515 [WaveFnc_tmp, E] = eig(H);
522 % only eigenvalues are calculated
524 E = eigs(H, db, center);
530 % calculations including the overlap matrices
531 S =
secular_H( S0_loc, S1_loc, S1_transverse_loc, ka_vec(idx));
533 % calculations including the wavefunctions
535 [WaveFnc_tmp, E] = eigs(H, S, db, center);
537 [WaveFnc_tmp, E] = eig(H, S);
544 % only eigenvalues are calculated
546 E = eigs(H, S, db, center);
553 spectrum{idx} = [ones(length(E),1)*ka_vec(idx), E];
556 % reorganize the calculated data
557 spectrum = cell2mat(spectrum);
560 obj.display(
'Spectrum calculated')
562 % check whether to plot the spectrum
567 % plot the calculated spectrum
571 spectrum(:,2) = real(spectrum(:,2));
572 x_lim = [min(spectrum(:,1)) max(spectrum(:,1))];
573 y_lim = [min(spectrum(:,2)) max(spectrum(:,2))];
575 Position = [0.5 0.58 0.33 0.4];
576 axes_spectrum = axes('Parent',figure1, 'Position', Position,...
578 'FontSize', fontsize,...
580 'ylim', y_lim,... 'XTick', XTick,... 'YTick', YTick,...
582 'FontName','Times New Roman');
585 plot(spectrum(:,1), spectrum(:,2),'.', 'MarkerSize', 4, 'Parent', axes_spectrum )
588 xlabel_position = [0 0 0];
589 xlabel('ka','FontSize', fontsize,'FontName','Times New Roman', 'Parent', axes_spectrum);
590 xlabel_handle = get(axes_spectrum,'XLabel');
591 set(xlabel_handle, 'Position', get(xlabel_handle, 'Position') + xlabel_position);
594 ylabel_position = [0 0 0];
595 ylabel('E [eV]','FontSize', fontsize,'FontName','Times New Roman', 'Parent', axes_spectrum);
596 ylabel_handle = get(axes_spectrum,'YLabel');
597 set(ylabel_handle, 'Position', get(ylabel_handle, 'Position') + ylabel_position);
600 % --------------------------------------
602 % Hamiltonian for the secular equation
605 if ~isempty(q) && ~obj.HamiltoniansDecimated
606 H0 = H0 + H1_transverse*diag(exp(-1i*q)) + H1_transverse'*diag(exp(1i*q));
608 H = H0 + H1*exp(1i*k) + H1'*exp(-1i*k);
612 % end nested functions
618 %> @brief Save
Lead Hamiltonians into a file 'Hamiltoni_Lead_' + num2str(Hanyadik_Lead) + '.mat'.
620 save(['Hamiltoni_Lead_',num2str(obj.Hanyadik_Lead),'.mat'], 'H0', 'H1', 'kulso_szabfokok', 'Lead_Orientation', 'fazis_mtx_H0', 'fazis_mtx_H1', 'params');
624 %> @brief Shifts the coordinates of the
sites by an integer multiple of the lattice vector
#Coordinates.a. 625 %> @
param shift Integer by which the coordinates are shifted.
626 function ShiftCoordinates( obj, shift )
627 if isempty(shift) || shift == 0
631 % shifting the coordinates along the translational invariant direction
632 obj.coordinates = obj.coordinates.Shift( shift*obj.coordinates.a );
639 %> @brief Shifts the on-site energies in the leads by a given energy.
640 %> @
param Energy The enrgy value.
641 function ShiftLead( obj, Energy )
642 obj.H0 = obj.H0 + sparse(1:size(obj.H0,1), 1:size(obj.H0,2),Energy,size(obj.H0,1),size(obj.H0,2));
643 obj.params.epsilon = obj.params.epsilon + Energy;
646 obj.OverlapApplied =
false;
650 %> @brief Adds on-site potential to the Hamiltonian H0.
651 %> @
param V The potential calculated on the
sites.
652 function AddPotential( obj, V )
654 if ( size(V,2) == 1 ) || ( size(V,1) == 1 )
655 if length(V) == size(obj.H0,1)
656 obj.H0 = obj.H0 + sparse(1:size(obj.H0,1), 1:size(obj.H0,2),V,size(obj.H0,1),size(obj.H0,2));
658 obj.OverlapApplied = false;
660 disp(' Wrong dimension of potential: 1')
663 elseif norm(size(V) - size(obj.H0)) < 1e-6
666 obj.OverlapApplied = false;
668 disp(' Wrong dimension of potential: 2')
672 obj.display(' Potential added to lead')
676 %> @brief Test, whether the lead is in the superconducting phase or not.
677 %> @return True if the lead is superconducting, false otherwise.
678 function ret = isSuperconducting( obj )
685 if abs(obj.params.pair_potential) >= 1e-10
697 %% MomentumDependentHamiltonian
698 %> @brief Construct a momentum dependent (Fourier-transformed) Hamiltonian.
699 %> @
param k The longitudinal momentum times the lattice constant.
700 %> @
param q The transverse momentum times the lattice constant.
701 %> @return Return with the momentum dependent Hamiltonian.
702 function ret = MomentumDependentHamiltonian( obj, k, q )
705 if obj.HamiltoniansDecimated
706 obj.display(['EQuUs:', class(obj), ':MomentumDependentHamiltonian:
Hamiltonians are decimated. Please recreate
Hamiltonians to calculate spectrum.'], 1)
713 ret = ret + obj.H1*diag(exp(1i*k)) + obj.H1'*diag(exp(-1i*k));
715 if ~isempty(obj.H1_transverse) && ~isempty(q)
716 ret = ret + obj.H1_transverse*diag(exp(1i*q)) + obj.H1_transverse'*diag(exp(-1i*q));
719 if ~isempty(obj.H1_skew_right) && ~isempty(q)
720 ret = ret + obj.H1_skew_right*diag(exp(1i*(q-k))) + obj.H1_skew_right'*diag(exp(-1i*(q-k)));
723 if ~isempty(obj.H1_skew_left) && ~isempty(q)
724 ret = ret + obj.H1_skew_left*diag(exp(1i*(q+k))) + obj.H1_skew_left'*diag(exp(-1i*(q+k)));
734 %> @brief Creates a clone of the present class.
735 %> @return Returns with the cloned
object.
736 %> @
param varargin Cell array of optional parameters (https:
737 %> @
param 'empty' Set true to create an empty clone, or false (default) to clone all atributes.
738 function ret = CreateClone( obj, varargin )
741 p.addParameter('empty', false ); %Logical value. Set true for creating an empty class, or false (default) otherwise.
743 p.parse(varargin{:});
744 empty = p.Results.empty;
747 'Hanyadik_Lead', obj.Hanyadik_Lead,...
748 'Lead_Orientation', obj.Lead_Orientation, ...
754 meta_data = metaclass(obj);
756 for idx = 1:length(meta_data.PropertyList)
757 prop_name = meta_data.PropertyList(idx).Name;
758 ret.Write( prop_name, obj.(prop_name));
764 %> @brief Resets all elements in the
object.
768 meta_data = metaclass(obj);
770 for idx = 1:length(meta_data.PropertyList)
771 prop_name = meta_data.PropertyList(idx).Name;
772 if strcmp(prop_name, '
Opt') || strcmp( prop_name, '
param') || strcmp(prop_name, 'varargin')
775 obj.Clear( prop_name );
787 %> @brief Sets the value of an attribute in the interface.
788 %> @
param MemberName The name of the attribute to be set.
789 %> @
param input The value to be set.
790 function Write(obj, MemberName, input)
792 if strcmp(MemberName, '
param')
796 elseif strcmpi(MemberName, 'params')
798 if isempty(obj.Hanyadik_Lead)
799 obj.
param.scatter = input;
801 obj.
param.Leads{obj.Hanyadik_Lead} = input;
805 obj.(MemberName) = input;
807 error([
'EQuUs:',
class(obj),
':Read'], [
'No property to write with name: ', MemberName]);
813 %> @brief Query
for the value of an attribute in the interface.
814 %> @
param MemberName The name of the attribute to be set.
815 %> @
return Returns with the value of the attribute.
816 function ret = Read(obj, MemberName)
819 ret = obj.(MemberName);
821 error([
'EQuUs:',
class(obj),
':Read'], [
'No property to read with name: ', MemberName]);
826 %> @brief Clears the value of an attribute in the interface.
827 %> @
param MemberName The name of the attribute to be cleared.
828 function Clear(obj, MemberName)
831 obj.(MemberName) = [];
833 error([
'EQuUs:',
class(obj),
':Clear'], [
'No property to clear with name: ', MemberName]);
841 methods ( Access =
protected )
844 %> @brief Updates the number of
sites in the cross section.
846 if isempty( obj.Hanyadik_Lead )
849 obj.M = obj.
param.Leads{obj.Hanyadik_Lead}.M;
855 %> @brief Initializes
object properties.
856 function Initialize(obj)
857 obj.InputParsing( obj.varargin{:});
860 obj.HamiltoniansCreated =
false;
861 obj.HamiltoniansDecimated =
false;
862 obj.OverlapApplied =
false;
863 obj.MagneticFieldApplied =
false;
864 obj.GaugeTransformationApplied =
false;
870 if isempty( obj.Hanyadik_Lead )
871 obj.params = obj.
param.scatter; %
Lead parameters
873 obj.params = obj.
param.Leads{obj.Hanyadik_Lead}; %
Lead parameters
878 end %
protected methods
881 methods (Access=
protected)
885 %> @brief Parses the optional parameters
for the
class constructor.
886 %> @
param varargin Cell array of optional parameters (https:
887 %> @
param 'Hanyadik_Lead' The ID number of the current lead. Set to empty (
default)
for using parameters of the scatter region.
888 %> @
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.
889 %> @
param 'q' The transverse momentum. Set to empty (
default)
for computations without transverse momentums.
890 function InputParsing( obj, varargin )
892 p.addParameter(
'Hanyadik_Lead', []);
893 p.addParameter(
'Lead_Orientation', 1);
894 p.addParameter(
'q', []);
896 % keeping unmatched attributes that possibly comes from the derived classes
897 p.KeepUnmatched =
true;
899 p.parse(varargin{:});
901 obj.Lead_Orientation = p.Results.Lead_Orientation;
902 obj.Hanyadik_Lead = p.Results.Hanyadik_Lead;
910 end %
private methods
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 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.