Skip to content

Commit

Permalink
add rydberg cluster fn to FnOps
Browse files Browse the repository at this point in the history
  • Loading branch information
nacslab committed Oct 27, 2023
1 parent e899a5b commit 0070be1
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions FnOps.m
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@
end
res = @fn;
end
function res = nn_all(idxs1, idxs2)
function result = fn(logs)
result = transpose(~logs(idxs1)) * ~logs(idxs2);
result = reshape(result, [1, length(idxs1) * length(idxs2)]);
end
res = @fn;
end
function res = zz(i, j)
% evaluates logical(i) on site i
function result = fn(logs)
Expand Down Expand Up @@ -183,6 +190,7 @@
res = @fn;
end
function res = MaxRydCluster(site_idxs, periodic)
% 1D version
function result = fn(logs)
if ~exist('site_idxs', 'var')
site_idxs = 1:length(logs);
Expand Down Expand Up @@ -212,5 +220,18 @@
end
res = @fn;
end
function res = GenMaxRydCluster(coords, blockade_r, sites_to_consider)
function result = fn(logs)
aa = AtomArray.calcArray(coords, blockade_r, ~logs, sites_to_consider);
sets = aa.getConnSets();
szs = cellfun(@(x) length(x), sets);
if isempty(sets)
result = 0;
else
result = max(szs);
end
end
res = @fn;
end
end
end

0 comments on commit 0070be1

Please sign in to comment.