-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
4 changed files
with
96 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
function [ids,ens,U_list] = energy_line(U_LIST) | ||
%% Getting a list of energy values, from directories. | ||
% U_LIST: an array of values for Hubbard interaction U (could be empty!) | ||
% ids: a cell of strings, the QcmPlab names for the pot-energy terms | ||
% ens: a cell of float-arrays, corresponding to the names above | ||
% ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
global ignUlist | ||
if isempty(U_LIST) || ignUlist == true | ||
[U_LIST, ~] = get_list('U'); | ||
else | ||
U_LIST = sort(U_LIST); | ||
end | ||
% Then we can proceed spanning all the U-values | ||
Nu = length(U_LIST); | ||
cellEn = cell(Nu,1); | ||
for iU = 1:length(U_LIST) | ||
U = U_LIST(iU); | ||
UDIR= sprintf('U=%f',U); | ||
if ~isfolder(UDIR) | ||
errstr = 'U_list file appears to be inconsistent: '; | ||
errstr = [errstr,UDIR]; | ||
errstr = [errstr,' folder has not been found.']; | ||
error(errstr); | ||
end | ||
cd(UDIR); | ||
[ids, cellEn{iU}] = get_energies(); | ||
cd('..'); | ||
end | ||
% We need some proper reshaping | ||
Nids = length(ids); | ||
ens = cell(1,Nids); | ||
for jEn = 1:Nids | ||
ens{jEn} = zeros(Nu,1); | ||
for iU = 1:Nu | ||
ens{jEn}(iU) = cellEn{iU}(jEn); | ||
end | ||
end | ||
U_list = U_LIST; | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
function [names, energies] = get_energies() | ||
%% Getting all information from energy_last.ed and energy_info.ed | ||
% names: a cell of strings, the QcmPlab names for the pot-energy terms | ||
% energies: an array of float values, corresponding to the names above | ||
% ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
names = readcell('energy_info.ed','FileType','fixedwidth'); | ||
names(strcmp(names,'#'))=[]; | ||
for i = 1:length(names) | ||
tempstr = names{i}; % Temporary string variable | ||
head = sscanf(tempstr,'%d'); % Extracts the initial integer | ||
head = int2str(head); % Int to Str conversion | ||
names{i} = erase(tempstr,head); % Proper beheading ;D | ||
end | ||
energies = load('energy_last.ed'); | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
function [kins,U_list] = kinetic_line(U_LIST) | ||
%% Getting a list of energy values, from directories. | ||
% U_LIST: an array of values for Hubbard interaction U (could be empty!) | ||
% kins: an array of values for Kinetic energies, forall U | ||
% ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
global ignUlist | ||
if isempty(U_LIST) || ignUlist == true | ||
[U_LIST, ~] = get_list('U'); | ||
else | ||
U_LIST = sort(U_LIST); | ||
end | ||
% Then we can proceed spanning all the U-values | ||
Nu = length(U_LIST); | ||
kins = zeros(Nu,1); | ||
for iU = 1:length(U_LIST) | ||
U = U_LIST(iU); | ||
UDIR= sprintf('U=%f',U); | ||
if ~isfolder(UDIR) | ||
errstr = 'U_list file appears to be inconsistent: '; | ||
errstr = [errstr,UDIR]; | ||
errstr = [errstr,' folder has not been found.']; | ||
error(errstr); | ||
end | ||
cd(UDIR); | ||
|
||
% The dmft_kinetic_energy.dat file has a weird structure... | ||
strCell = readcell('dmft_kinetic_energy.dat'); % cell of strings | ||
tempStr = strCell{1}; % single string | ||
tempVec = sscanf(tempStr,'%f'); % extract all the %f | ||
kins(iU) = tempVec(1); % For sure the 1st value is the total K.E. | ||
|
||
cd('..'); | ||
end | ||
|
||
U_list = U_LIST; | ||
end | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters