-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathgridNetPlot.m
More file actions
48 lines (38 loc) · 826 Bytes
/
gridNetPlot.m
File metadata and controls
48 lines (38 loc) · 826 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
function n = gridNetPlot( net, grid_resolution )
nVectors = {}; gVectors = {};
for k=1:length(net)
nVectors{k} = unitaryTo4Vector(net{k});
end
SU2g = SU2Grid(grid_resolution);
for k=1:length(SU2g)
gVectors{k} = unitaryTo4Vector(SU2g{k});
end
x1n=[];y1n=[]; x2n=[];y2n=[];
for k=1:length(nVectors)
x1n(k) = nVectors{k}(1);
x2n(k) = nVectors{k}(3);
end
for k=1:length(nVectors)
y1n(k) = nVectors{k}(2);
y2n(k) = nVectors{k}(4);
end
x1g=[];y1g=[]; x2g=[];y2g=[];
for k=1:length(gVectors)
x1g(k) = gVectors{k}(1);
x2g(k) = gVectors{k}(3);
end
for k=1:length(gVectors)
y1g(k) = gVectors{k}(2);
y2g(k) = gVectors{k}(4);
end
figure(1);
clf;
scatter(x1g,y1g,4,'red','.');
hold on;
scatter(x1n,y1n,20,'s','blue','fill');
figure(2);
clf;
scatter(x2g,y2g,4,'red','fill');
hold on;
scatter(x2n,y2n,20,'s','blue', 'fill');
end