Added comments to explain the code.
This commit is contained in:
parent
988df2b5f3
commit
db398fe775
@ -1,6 +1,6 @@
|
|||||||
function [evals, modes] = solveBogoliubovdeGennesIn2D(psi, Params, VDk, VParams, Transf, muchem)
|
function [evals, modes] = solveBogoliubovdeGennesIn2D(psi, Params, VDk, VParams, Transf, muchem)
|
||||||
|
% 2-D matrix will be unravelled to a single column vector and the corresponding BdG matrix of (N^2)^2 elements solved for.
|
||||||
Size = length(psi(:)); % 2-D matrix will be unwrapped and the corresponding matrix of (N^2)^2 elements solved for.
|
Size = length(psi(:));
|
||||||
Neigs = length(psi(:));
|
Neigs = length(psi(:));
|
||||||
opts.tol = 1e-16;
|
opts.tol = 1e-16;
|
||||||
opts.disp = 1;
|
opts.disp = 1;
|
||||||
@ -8,8 +8,8 @@ opts.issym = 0;
|
|||||||
opts.isreal = 1;
|
opts.isreal = 1;
|
||||||
opts.maxit = 1e4;
|
opts.maxit = 1e4;
|
||||||
|
|
||||||
BdGVec = @(g) BdGSolver2D.BdGMatrix(g, psi, Params, VDk, VParams, Transf, muchem);
|
BdGVec = @(g) BdGSolver2D.BdGMatrix(g, psi, Params, VDk, VParams, Transf, muchem); % This function takes a column vector as input and returns a
|
||||||
|
% matrix-vector product which is also a column vector
|
||||||
[g,D] = eigs(BdGVec,Size,Neigs,'sr',opts);
|
[g,D] = eigs(BdGVec,Size,Neigs,'sr',opts);
|
||||||
evals = diag(D);
|
evals = diag(D);
|
||||||
clear D;
|
clear D;
|
||||||
|
Loading…
Reference in New Issue
Block a user