-
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.
> this poses the problem of the naming convention... we may want to generalize everywhere <DMFT> to something else, maybe a reference to @QcmPlab as a whole? QcmP.mat.Lab sounds quite bad for sure.
- Loading branch information
1 parent
785196a
commit 153e87a
Showing
2 changed files
with
66 additions
and
0 deletions.
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,27 @@ | ||
function [names, order_parameters] = get_order_parameters() | ||
%% Getting all information from order_parameters_[].dat | ||
% names: a cell of strings, the names of the order parameters (from []) | ||
% order_parameters: an array of floats, corresponding to the names above | ||
% ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
pattern = 'order_parameters_'; | ||
files = dir('.'); | ||
N = length(files); | ||
for i = 1:N | ||
temp_name = getfield(files,{i},'name'); | ||
found = strfind(temp_name,pattern); | ||
if found | ||
full_name = temp_name; | ||
end | ||
end | ||
beheaded = erase(full_name,pattern); % Removes 'order_parameter_' | ||
detailed = erase(beheaded,'.dat'); % Removes '.dat' | ||
names = strsplit(detailed,'_'); % Reads the names separated by '_' | ||
order_parameters = load(full_name); | ||
if length(names) ~= length(order_parameters) | ||
error('Something went wrong reading order parameters!'); | ||
end | ||
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 [ids,ordpms,U_list] = order_parameter_line(U_LIST) | ||
%% Getting a list of variable values, from directories. | ||
% U_LIST: an array of values for Hubbard interaction U (could be empty!) | ||
% ids: a cell of strings, the names of the order parameters | ||
% ordpms: a cell of arrays, corresponding to the names above, for all 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); | ||
cellordpms = 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, cellordpms{iU}] = get_order_parameters(); | ||
cd('..'); | ||
end | ||
% We need some proper reshaping | ||
Nordpms = length(ids); | ||
ordpms = cell(1,Nordpms); | ||
for jORDPMS = 1:Nordpms | ||
ordpms{jORDPMS} = zeros(Nu,1); | ||
for iU = 1:Nu | ||
ordpms{jORDPMS}(iU) = cellordpms{iU}(jORDPMS); | ||
end | ||
end | ||
U_list = U_LIST; | ||
end |