Eötvös Quantum Utilities  v4.9.146
Providing the Horsepowers in the Quantum Realm
Peierls.m
Go to the documentation of this file.
1 %% Eotvos Quantum Transport Utilities - Peierls
2 % Copyright (C) 2009-2015 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 basic Basic Functionalities
18 %> @{
19 %> @file Peierls.m
20 %> @brief A class responsible for the Peierls and gauge transformations.
21 %> @}
22 %> @brief A class responsible for the Peierls and gauge transformations.
23 %%
24 classdef Peierls < handle & Messages
25 
26  properties ( Access = protected )
27  %> String containing the name of the built-in gauge ('LandauX', 'LandauY').
28  gauge
29  %> The strength of the magnetic field for the built-in vector potentials.
30  eta
31  %> Function handle A = f( x,y) of the vector potential to be used in the calculations (A is a N x 2 vector, where N is the number of the points given by the x and y coordinates.)
32  Vectorpotential
33  end
34 
35 
36 
37 methods ( Access = public )
38 
39 %% Contructor of the class
40 %> @brief Constructor of the class.
41 %> @param Opt An instance of the structure #Opt.
42 %> @param varargin Cell array of optional parameters. For details see #InputParsing.
43 %> @return An instance of the class
44  function obj = Peierls(Opt, varargin)
45  obj = obj@Messages( Opt );
46 
47  obj.gauge = []; % 'LandauX', 'LandauY' gauges or [] for load from input files
48  obj.eta = 0; % eta_B = 2*pi/phi0*(rCC)^2*B;
49  obj.Vectorpotential = [];
50 
51  obj.InputParsing( varargin{:} );
52 
53  if isfield( obj.Opt, 'eta' )
54  obj.eta = obj.Opt.eta;
55  else
56  obj.eta = 0;
57  end
58 
59 
60  if isempty( obj.Vectorpotential )
61  if isfield( obj.Opt, 'gauge' )
62  obj.gauge = obj.Opt.gauge;
63  else
64  obj.gauge = [];
65  end
66  obj.Vectorpotential = obj.CreateHandleForVectorpotential();
67  end
68 
69  end
70 
71 %% PeierlsTransformLeads
72 %> @brief Algorithm to perform Peierls transformation in the Hamiltonians of the leads.
73 %> @param Lead An instance of class #CreateLeadHamiltonians (or a derived class)
74 function PeierlsTransformLeads( obj, Lead )
75 
76  if ~strcmpi( class(Lead), 'CreateLeadHamiltonians' )
77  supClasses = superclasses(Lead);
78  if sum( strcmp( supClasses, 'CreateLeadHamiltonians' ) ) == 0
79  error(['EQuUs:', class(obj.junction), ':PeierlsTransformLeads'], 'Input Lead is not valid.');
80  end
81  end
82 
83  if Lead.Read( 'MagneticFieldApplied' )
84  obj.display(['EQuUs:',class(obj),':PeierlsTransformLeads: Magnetic field already applied in the Hamiltonians']);
85  return
86  end
87 
88  if isempty(obj.Vectorpotential)
89  obj.display(['EQuUs:',class(obj),':PeierlsTransformLeads: Vectorpotential is not set.']);
90  return
91  end
92 
93 
94  if ~Lead.Read( 'HamiltoniansCreated' ) || Lead.Read( 'HamiltoniansDecimated' )
95  err = MException(['EQuUs:',class(obj),':PeierlsTransformLeads'], 'Hamiltonians in Lead are not created, or they are decimated. Thus, unable to perform Peierls transformation.');
96  save('Error_Peierls_PeierlsTransformLeads.mat');
97  throw(err);
98  end
99 
100  H0 = Lead.Read( 'H0' );
101  Lead.Clear( 'H0' );
102  H1 = Lead.Read( 'H1' );
103  Lead.Clear( 'H1' );
104  H1_transverse = Lead.Read( 'H1_transverse' );
105  Lead.Clear( 'H1_transverse' );
106 
107  if obj.Opt.BdG
108  H0_size = size(H0,1)/2;
109  mtx_pair_potential = H0( 1:H0_size, H0_size+1:2*H0_size);
110  H0 = H0( 1:H0_size, 1:H0_size);
111  H1 = H1( 1:H0_size, 1:H0_size);
112  if ~isempty(H1_transverse)
113  H1_transverse = H1_transverse( 1:H0_size, 1:H0_size);
114  end
115 
116  if norm(mtx_pair_potential,1) >= 1e-6
117  error( ['EQuUs:',class(obj),':PeierlsTransformLeads'], 'The peierls transformation with nonzero B is forbidden in the superconducting phase. Set the pair potential to zero, or use gauge transformation instead.')
118  mtx_pair_potential = mtx_pair_potential*0;
119  end
120  end
121 
122 
123  coordinates = Lead.Read( 'coordinates' );
124 
125 
126  %Peierls in the unit cell
127  [sor_idx,oszlop_idx,elements] = find(H0);
128 
129  startpoint = [coordinates.x( oszlop_idx ), coordinates.y( oszlop_idx )];
130  endpoint = [coordinates.x( sor_idx ), coordinates.y( sor_idx )];
131  fazis = obj.Peierls_phase(startpoint,endpoint);
132 
133  fazis_mtx_H0 = sparse(sor_idx,oszlop_idx,fazis,size(H0,1), size(H0,2) );
134  elements = exp(1i*fazis).*elements;
135  H0 = sparse(sor_idx,oszlop_idx,elements,size(H0,1), size(H0,2) );
136 
137  Lead.Write( 'fazis_mtx_H0', fazis_mtx_H0);
138 
139 
140  %Peierls in the coupling of unit cells
141  [sor_idx,oszlop_idx,elements] = find(H1);
142  orientation = Lead.Read('Lead_Orientation');
143  Hanyadik_Lead = Lead.Read('Hanyadik_Lead' );
144  if orientation == 1 && ~isempty( Hanyadik_Lead )
145  startpoint = [coordinates.x( oszlop_idx ) , coordinates.y( oszlop_idx )];
146  endpoint = [coordinates.x( sor_idx ) - coordinates.a(1), coordinates.y( sor_idx ) - coordinates.a(2)];
147  else
148  startpoint = [coordinates.x( oszlop_idx ) + coordinates.a(1), coordinates.y( oszlop_idx ) + coordinates.a(2)];
149  endpoint = [coordinates.x( sor_idx ), coordinates.y( sor_idx )];
150  end
151  fazis = obj.Peierls_phase(startpoint,endpoint);
152 
153  fazis_mtx_H1 = sparse(sor_idx,oszlop_idx,fazis,size(H1,1), size(H1,2) );
154  elements = exp(1i*fazis).*elements;
155  H1 = sparse(sor_idx,oszlop_idx,elements,size(H1,1), size(H1,2) );
156 
157  Lead.Write( 'fazis_mtx_H1', fazis_mtx_H1);
158 
159 
160  %Peierls in the transverse coupling of unit cells
161  if ~isempty(H1_transverse)
162  [sor_idx,oszlop_idx,elements] = find(H1_transverse);
163  startpoint = [coordinates.x( oszlop_idx ) + coordinates.b(1), coordinates.y( oszlop_idx ) + coordinates.b(2)];
164  endpoint = [coordinates.x( sor_idx ), coordinates.y( sor_idx )];
165  fazis = obj.Peierls_phase(startpoint,endpoint);
166 
167  fazis_mtx_H1t = sparse(sor_idx,oszlop_idx,fazis,size(H1_transverse,1), size(H1_transverse,2) );
168  elements = exp(1i*fazis).*elements;
169  H1_transverse = sparse(sor_idx,oszlop_idx,elements,size(H1_transverse,1), size(H1_transverse,2) );
170 
171  Lead.Write( 'fazis_mtx_H1t', fazis_mtx_H1t);
172  end
173 
174 
175 
176  if obj.Opt.BdG
177  H0 = [H0, mtx_pair_potential; mtx_pair_potential', -conj(H0)];
178  H1 = [H1, zeros(size(H1)); zeros(size(H1')), -conj(H1)];
179  H1_transverse = [H1_transverse, zeros(size(H1_transverse)); zeros(size(H1_transverse')), -conj(H1_transverse)];
180  end
181 
182 
183  Lead.Write( 'H0', H0 );
184  Lead.Write( 'H1', H1 );
185  Lead.Write( 'H1adj', H1' );
186  Lead.Write( 'H1_transverse', H1_transverse );
187  Lead.Write( 'MagneticFieldApplied', 1 );
188  %Surface_tmp.Write( 'q', q);
189 
190 
191 end
192 
193 %% PeierlsTransform
194 %> @brief Algorithm to perform Peierls transformation in Hamiltonian stored in the #CreateHamiltonians object.
195 %> @param CreateH An instance of class #CreateHamiltonians (or a derived class).
196 function PeierlsTransform( obj, CreateH )
197 
198  if ~strcmpi( class(CreateH), 'CreateHamiltonians' )
199  supClasses = superclasses(CreateH);
200  if sum( strcmp( supClasses, 'CreateHamiltonians' ) ) == 0
201  error(['EQuUs:', class(obj.junction), ':PeierlsTransform'], 'Input CreateH is not valid.');
202  end
203  end
204 
205  if CreateH.Read( 'MagneticFieldApplied' )
206  obj.display(['EQuUs:',class(obj),':PeierlsTransform: Magnetic field already applied in the Hamiltonians'], 1);
207  return
208  end
209 
210  if isempty(obj.Vectorpotential)
211  obj.display(['EQuUs:',class(obj),':PeierlsTransform: Vectorpotential is not set.']);
212  return
213  end
214 
215  if ~CreateH.Read( 'HamiltoniansCreated' ) || CreateH.Read( 'HamiltoniansDecimated' )
216  err = MException(['EQuUs:',class(obj),':PeierlsTransform'], 'Hamiltonians in are not created, or they are decimated. Thus, unable to perform Peierls transformation.');
217  save('Error_Peierls_PeierlsTransform.mat');
218  throw(err);
219  end
220 
221  NameOfH = 'Hscatter';
222  NameOfH_transverse = 'Hscatter_transverse';
223  Hamiltoni = CreateH.Read( NameOfH );
224  Hamiltoni_transverse = CreateH.Read( NameOfH_transverse );
225  CreateH.Clear( NameOfH );
226  CreateH.Clear( NameOfH_transverse );
227  coordinates = CreateH.Read( 'coordinates' );
228 
229  if obj.Opt.BdG
230  mtx_pair_potential = Hamiltoni( ~coordinates.BdG_u, coordinates.BdG_u );
231  Hamiltoni = Hamiltoni( coordinates.BdG_u, coordinates.BdG_u );
232  if ~isempty(Hamiltoni_transverse)
233  Hamiltoni_transverse = Hamiltoni_transverse( coordinates.BdG_u, coordinates.BdG_u );
234  end
235  coordinates.x = coordinates.x( coordinates.BdG_u );
236  coordinates.y = coordinates.y( coordinates.BdG_u );
237 
238  if norm(mtx_pair_potential,1) >= 1e-6
239  error( 'The peierls transformation with nonzero B is forbidden in the superconducting phase. Set the pair potential to zero, or use gauge transformation instead.')
240  mtx_pair_potential = mtx_pair_potential*0;
241  end
242  end
243 
244 
245  %Peierls in the scattering region
246  [sor_idx,oszlop_idx,elements] = find(Hamiltoni);
247  startpoint = [coordinates.x( oszlop_idx ), coordinates.y( oszlop_idx )];
248  endpoint = [coordinates.x( sor_idx ), coordinates.y( sor_idx )];
249  fazis = obj.Peierls_phase(startpoint,endpoint);
250 
251  fazis_mtx = sparse(sor_idx,oszlop_idx,fazis,size(Hamiltoni,1), size(Hamiltoni,2) );
252  elements = exp(1i*fazis).*elements;
253  Hamiltoni = sparse(sor_idx,oszlop_idx,elements,size(Hamiltoni,1), size(Hamiltoni,2) );
254 
255  CreateH.Write( 'fazis_mtx_scatter', fazis_mtx);
256 
257 
258  %Peierls in the transverse coupling of the scattering region
259  if ~isempty(Hamiltoni_transverse)
260  [sor_idx,oszlop_idx,elements] = find(Hamiltoni_transverse);
261  startpoint = [coordinates.x( oszlop_idx ) + coordinates.b(1), coordinates.y( oszlop_idx ) + coordinates.b(2)];
262  endpoint = [coordinates.x( sor_idx ), coordinates.y( sor_idx )];
263  fazis = obj.Peierls_phase(startpoint,endpoint);
264 
265  fazis_mtx_t = sparse(sor_idx,oszlop_idx,fazis,size(Hamiltoni_transverse,1), size(Hamiltoni_transverse,2) );
266  elements = exp(1i*fazis).*elements;
267  Hamiltoni_transverse = sparse(sor_idx,oszlop_idx,elements,size(Hamiltoni_transverse,1), size(Hamiltoni_transverse,2) );
268 
269  CreateH.Write( 'fazis_mtx_scatter_t', fazis_mtx_t);
270  end
271 
272 
273  if obj.Opt.BdG
274  Hamiltoni_tmp = sparse([],[],[], size(Hamiltoni,1)*2, size(Hamiltoni,2)*2 );
275  Hamiltoni_transverse_tmp = sparse([],[],[], size(Hamiltoni_transverse,1)*2, size(Hamiltoni_transverse,2)*2 );
276  Hamiltoni_tmp( coordinates.BdG_u, coordinates.BdG_u ) = Hamiltoni;
277  Hamiltoni_tmp( ~coordinates.BdG_u, ~coordinates.BdG_u ) = -conj(Hamiltoni);
278  Hamiltoni_tmp( ~coordinates.BdG_u, coordinates.BdG_u ) = mtx_pair_potential;
279  Hamiltoni_tmp( coordinates.BdG_u, ~coordinates.BdG_u ) = mtx_pair_potential';
280 
281  if ~isempty(Hamiltoni_transverse)
282  Hamiltoni_transverse_tmp( coordinates.BdG_u, coordinates.BdG_u ) = Hamiltoni_transverse;
283  Hamiltoni_transverse_tmp( ~coordinates.BdG_u, ~coordinates.BdG_u ) = -conj(Hamiltoni_transverse);
284  end
285 
286  Hamiltoni = Hamiltoni_tmp;
287  Hamiltoni_transverse = Hamiltoni_transverse_tmp;
288  end
289 
290  CreateH.Write( NameOfH, Hamiltoni );
291  CreateH.Write( NameOfH_transverse, Hamiltoni_transverse );
292  CreateH.Write( 'MagneticFieldApplied', 1 );
293  %Way2Hamiltonian.Write( 'q', q);
294 end
295 
296 %% gaugeTransformation
297 %> @brief Algorithm to perform gauge transformation on Green's function and/or on Hamiltonian.
298 %> @param mtx The matrix of the Green's function or the Hamiltonian.
299 %> @param coordinates An instance of structure #coordinates containing the site coordinates
300 %> @param gauge_field Function handle S = f( x,y) of the gauge transformation. (S is a N x 1 vector, where N is the number of the points given by the x and y coordinates.)
301 %> @return Returns with the transformaed matrix.
302  function ret = gaugeTransformation( obj, mtx, coordinates, gauge_field )
303  if isempty( gauge_field )
304  ret = mtx;
305  return
306  end
307  % for Landau_y = Landau_x + grad( gauge_field )
308  %gauge_field = @(x,y)( eta*x.*y);
309 
310  mtx_size = size(mtx,1);
311  if length( coordinates.x ) ~= mtx_size
312  warning( ['EQuUs:', class(obj.junction), ':gaugeTransformation'], 'The coordinates and matrix elements do not correspond to each other.' )
313  return
314  end
315 
316  % "u" and "v" like components must be transformed differently in BdG theory
317  if isprop( coordinates, 'BdG_u' ) && ~isempty(coordinates.BdG_u)
318  fact = -(-1).^coordinates.BdG_u;
319  else
320  fact = ones( size(coordinates.x) );
321  end
322 
323 
324  if issparse( mtx )
325  Umtx = sparse( 1:mtx_size, 1:mtx_size, exp(1i*fact.*gauge_field( coordinates.x, coordinates.y )), mtx_size, mtx_size);
326  else
327  Umtx = diag( exp(1i*fact.*gauge_field( coordinates.x, coordinates.y )) );
328  end
329 
330  ret = Umtx * mtx * Umtx';
331 
332  end
333 
334 %% gaugeTransformationOnLead
335 %> @brief Algorithm to perform gauge transformation in the Hamiltonians of a lead. The transformed matrices are stored within the input class.
336 %> @param Lead An instance of class #CreateLeadHamiltonians (or a derived class)
337 %> @param gauge_field Function handle S = f( x,y) of the gauge transformation. (S is a N x 1 vector, where N is the number of the points given by the x and y coordinates.)
338  function gaugeTransformationOnLead( obj, Lead, gauge_field )
339 
340  if ~strcmpi( class(Lead), 'CreateLeadHamiltonians' )
341  supClasses = superclasses(Lead);
342  if sum( strcmp( supClasses, 'CreateLeadHamiltonians' ) ) == 0
343  error(['EQuUs:', class(obj.junction), ':gaugeTransformationOnLead'], 'Input Lead is not valid.');
344  end
345  end
346 
347  if isempty( gauge_field )
348  return
349  end
350 
352  obj.display('Gauge transformation already applied in the Hamiltonians');
353  return
354  end
355 
356  H0 = Lead.Read('H0');
357  H1 = Lead.Read('H1');
358  H1adj = Lead.Read('H1adj');
359  orientation = Lead.Read('Lead_Orientation');
360  Hanyadik_Lead = Lead.Read('Hanyadik_Lead' );
362  coordinates_tmp = structures( 'coordinates');
363  if orientation == 1 && ~isempty( Hanyadik_Lead )
364  coordinates_tmp.x = [coordinates.x-coordinates.a(1); coordinates.x];
365  coordinates_tmp.y = [coordinates.y-coordinates.a(2); coordinates.y];
366  else
367  coordinates_tmp.x = [coordinates.x; coordinates.x+coordinates.a(1)];
368  coordinates_tmp.y = [coordinates.y; coordinates.y+coordinates.a(2)];
369  end
370 
371 
372 
373  H0size = size(H0, 1);
374 
375  if isprop( coordinates, 'BdG_u' )
376  coordinates_tmp.BdG_u = [coordinates.BdG_u; coordinates.BdG_u];
377  end
378 
379  H_tmp = [H0,H1;H1adj,H0];%
380  H_tmp = obj.gaugeTransformation( H_tmp, coordinates_tmp, gauge_field );
381 
382 
383  H0 = H_tmp(1:H0size,1:H0size);
384  H1 = H_tmp(1:H0size,H0size+1:end);
385  H1adj = H_tmp(H0size+1:end,1:H0size);
386 
387  Lead.Write( 'H0', H0);
388  Lead.Write( 'H1', H1);
389  Lead.Write( 'H1adj', H1adj);
390 
391  % gauge transformation of the transverse H1
392  H1_transverse = Lead.Read('H1_transverse');
393  if ~isempty(H1_transverse) && ~Lead.Read('HamiltoniansDecimated')
394  coordinates_tmp.x = [coordinates.x; coordinates.x+coordinates.b(1)];
395  coordinates_tmp.y = [coordinates.y; coordinates.y+coordinates.b(2)];
396 
397  H_tmp = [sparse([],[],[],size(H1_transverse,2), size(H1_transverse,1)), H1_transverse; ...
398  H1_transverse', sparse([],[],[],size(H1_transverse,1), size(H1_transverse,2))];
399 
400  H_tmp = obj.gaugeTransformation( H_tmp, coordinates_tmp, gauge_field );
401  H1_transverse = H_tmp( 1:size(H1_transverse,2), size(H1_transverse,1)+1:end );
402  Lead.Write( 'H1_transverse', H1_transverse);
403  end
404 
405 
406  %gauge transformation of the transverse momentum
407 % q = Surface_tmp.Read('q');
408 % identity_mtx = sparse(1:size(H1_transverse,1),1:size(H1_transverse,1),1, size(H1_transverse,1), size(H1_transverse,2) );
409 % if ~isempty(q) && ~Surface_tmp.Read('HamiltoniansDecimated')
410 % coordinates_tmp.x = [coordinates.x+coordinates.b(1); coordinates.x];
411 % coordinates_tmp.y = [coordinates.y+coordinates.b(2); coordinates.y];
412 %
413 % H_tmp = [sparse([],[],[],size(identity_mtx,2), size(identity_mtx,1)), identity_mtx; ...
414 % identity_mtx', sparse([],[],[],size(identity_mtx,1), size(identity_mtx,2))];
415 %
416 % H_tmp = gaugeTransformation( H_tmp, coordinates_tmp, gauge_field );
417 % identity_mtx = H_tmp( 1:size(H1_transverse,2), size(H1_transverse,1)+1:end );
418 % q = q - angle( diag(identity_mtx) );
419 % %Surface_tmp.Write( 'q', q);
420 % end
421 
422 
424 
425 
426  end
427 
428 %% CreateClone
429 %> @brief Creates a clone of the present object.
430 %> @return Returns with the cloned object.
431  function ret = CreateClone( obj )
432  ret = Peierls(obj.Opt, ...
433  'Vectorpotential', obj.Vectorpotential);
434 
435  end
436 
437 %% setVectorPotential
438 %> @brief Use to set the handle for the vector potential.
439 %> @param vectorpot Function handle A = f( x,y) of the vector potential to be used in the calculations (A is a N x 2 vector, where N is the number of the points given by the x and y coordinates.)
440 function setVectorPotential( obj, vectorpot )
441  obj.Vectorpotential = vectorpot;
442 end
443 
444 
445 end % methods public
446 
447 
448 methods ( Access = protected )
449 
450 %% Peierls_phase
451 %> @brief Calculates the Peierls phase along bonds.
452 %> @param startpoint Coordinates ([x,y]) of the starting points.
453 %> @param endpoint Coordinates ([x,y]) of the end points.
454 %> @return Returns with the peierls phases
455 function fazis = Peierls_phase(obj, startpoint, endpoint)
456 
457 if obj.Opt.Linear_Regression_in_B
458  A1 = obj.Vectorpotential(startpoint(:,1),startpoint(:,2));
459  A2 = obj.Vectorpotential(endpoint(:,1),endpoint(:,2));
460  fazis = 0.5*(A1(:,1)+A2(:,1)).*(endpoint(:,1)-startpoint(:,1)) + 0.5*(A1(:,2)+A2(:,2)).*(endpoint(:,2)-startpoint(:,2));
461  return
462 end
463 
464 % the following is not vectorized, and is obsolete !!!! TODO
465 fazis = zeros( size(startpoint,1), 1);
466 for idx = 1:length(fazis)
467  if ~(startpoint(1) == endpoint(1))
468  dx = (endpoint(idx,1)-startpoint(idx,1))/100;
469  int_array = startpoint(idx,1):dx:endpoint(idx,1);
470  Ind = max(size(int_array));
471  iidx = 1;
472  A = zeros(1,Ind);
473  while iidx <= Ind
474  x = int_array(iidx);
475  A_temp = obj.Vectorpotential(x, y_temp(x,startpoint(idx,:),endpoint(idx,:)));
476  A(iidx) = A_temp(1);
477  iidx = iidx + 1;
478  end
479  fazis(idx) = trapz(int_array,A);
480  end
481 end
482 
483 if obj.Opt.my_own_potential
484  fazis = zeros( size(startpoint,1), 1);
485  for idx = 1:length(fazis)
486  if ~(startpoint(idx,2) == endpoint(idx,2) )
487  dy = (endpoint(idx,2)-startpoint(idx,2))/100;
488  int_array = startpoint(idx,2):dy:endpoint(idx,2);
489  Ind = max(size(int_array));
490  iidx = 1;
491  A = zeros(1,Ind);
492  while iidx <= Ind
493  y = int_array(iidx);
494  A_temp = obj.Vectorpotential(x_temp(y,startpoint(idx,:),endpoint(idx,:)), y);
495  A(iidx) = A_temp(2);
496  iidx = iidx + 1;
497  end
498  fazis(idx) = fazis(idx) + trapz(int_array,A);
499  end
500  end
501 end
502 
503  function x = x_temp(y,startpoint,endpoint)
504  x = endpoint(1) + (startpoint(1)-endpoint(1))/(endpoint(2)-startpoint(2))*(endpoint(2)-y);
505  end
506  function y = y_temp(x,startpoint,endpoint)
507  y = endpoint(2) + (startpoint(2)-endpoint(2))/(endpoint(1)-startpoint(1))*(endpoint(1)-x);
508  end
509 end
510 
511 %% CreateHandleForVectorpotential
512 %> @brief Creates function handles for in-built Vector potentials in a gauge given by attribute #Opt.gauge.
513 %> @return Returns A function handle
514 function HandleForA = CreateHandleForVectorpotential( obj )
515 
516 
517  if ~isempty( obj.gauge )
518  if strcmpi( obj.gauge, 'LandauX' )
519  HandleForA = @(x,y)([-obj.eta*y;0]);
520  elseif strcmpi( obj.gauge, 'LandauY' )
521  HandleForA = @(x,y)([0;obj.eta*x]);
522  else
523  HandleForA = [];
524  end
525  else
526  HandleForA = [];
527  end
528 
529 end
530 
531 
532 end % methods protected
533 
534 
535 
536 methods ( Access = protected )
537 
538 
539 %% InputParsing
540 %> @brief Parses the optional parameters for the class constructor.
541 %> @param varargin Cell array of optional parameters (https://www.mathworks.com/help/matlab/ref/varargin.html):
542 %> @param 'Vectorpotential' Function handle A = f( x,y) of the vector potential to be used in the calculations (A is a N x 2 vector, where N is the number of the points given by the x and y coordinates.)
544  p_validating = inputParser;
545  p_validating.addParameter('Vectorpotential', []);
546  p_validating.parse(varargin{:});
547 
548  obj.Vectorpotential = p_validating.Results.Vectorpotential;
549 
550 
551 end
552 
553 end % methods private
554 
555 end %Global end
556 
557 
558 
559 
560 
function InputParsing(varargin)
Parses the optional parameters for the class constructor.
function CreateClone(varargin)
Creates a clone of the present class.
Property HamiltoniansCreated
A logical value. True if the Hamiltonian was created, false otherwise.
A class containing methodes for displaying several standard messages.
Definition: Messages.m:24
function Write(MemberName, input)
Sets the value of an attribute in the class.
Structure Opt contains the basic computational parameters used in EQuUs.
Definition: structures.m:60
Class to create and store Hamiltonian of the translational invariant leads.
Property MagneticFieldApplied
A logical value. True if the vector potential was incorporated into the Hamiltonian or false otherwis...
function display(message, nosilent)
Displays output messages on the screen.
Property coordinates
An instance of the structure coordinates.
function Transport(Energy, B)
Calculates the conductance at a given energy value.
function Hamiltonians(varargin)
Function to create the custom Hamiltonians for the 1D chain.
Property q
A transverse momentum.
Property fazis_mtx_scatter
The matrix of the Peierls phases.
function Clear(MemberName)
Clears the value of an attribute in the class.
A class to calculate the Green functions and self energies of a translational invariant lead The nota...
Definition: Lead.m:29
Property varargin
list of optional parameters (see http://www.mathworks.com/help/matlab/ref/varargin....
function()
Structure param contains data structures describing the physical parameters of the scattering center ...
Definition: structures.m:45
Property Hscatter_transverse
The matrix of the Hamiltonian corresponding to the transverse coupling.
Property Hscatter
The matrix of the Hamiltonian.
A class responsible for the Peierls and gauge transformations.
Definition: Peierls.m:24
Property GaugeTransformationApplied
A logical value. True if a gauge transformation was applied on the Hamiltonians, or false otherwise.
Property HamiltoniansDecimated
A logical value. True if the Hamiltonian was decimated, or false otherwise.
function gauge_field(x, y, eta_B, Aconst, height, lattice_constant)
Scalar gauge field connecting Landaux and Landauy gauges.
Property fazis_mtx_scatter_t
The matrix of the Peierls phases for the transverse coupling.
Structure containing the coordinates and other quantum number identifiers of the sites in the Hamilto...
Definition: Coordinates.m:24
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.