フィルターのクリア

How do I create a density plot?

2 ビュー (過去 30 日間)
JJH
JJH 2017 年 8 月 4 日
コメント済み: JJH 2017 年 8 月 4 日
Hi, I'm trying to make a density plot using pcolor that shows we1 on one axis, t on the other and the colour map as the trace distance between the matrices I've defined. I just want to produce a list of values for varying we1 and t but I get the error:
Error using * Inner matrix dimensions must agree.
Error in Untitled8 (line 16) H1=we1*kron(PauliX,eye(2))+A1*(kron(PauliX,PauliX)+kron(PauliY,PauliY)+kron(PauliZ,PauliZ));
How should I do this differently?
n=0.1;
we1=0:0.001:n;
m=500;
t=0:m;
A1=0.00448;
PauliX=[0 1; 1 0];
PauliY=[0 -1i; 1i 0];
PauliZ=[1 0; 0 -1];
rhoE=[0.5 + 0.115047 0.564418 - 0.0959956*1i; 0.564418 + 0.0959956*1i 0.5 - 0.115047];
rhoN=[0.5 0; 0 0.5];
rhoEN=kron(rhoE,rhoN);
SWAP=[1 0 0 0; 0 0 1 0; 0 1 0 0; 0 0 0 1];
for i=1:length(t)
for j=0:length(we1)
H1=we1.*kron(PauliX,eye(2))+A1*(kron(PauliX,PauliX)+kron(PauliY,PauliY)+kron(PauliZ,PauliZ));
U1=expm(-1i*H1*t);
rhoENout=U1*rhoEN*U1';
USWAP=expm(-1i*SWAP*t);
SWAPout=USWAP*rhoEN*USWAP';
tdSWAPEN1=(rhoENout-SWAPout)^2;
tdSWAPEN2=sqrt(sum(tdSWAPEN1(:)));
end
end
X=we1;
Y=t;
C=tdSWAPEN2;
pcolor(X,Y,C)
axis equal tight
  2 件のコメント
Dan Gianotti
Dan Gianotti 2017 年 8 月 4 日
編集済み: Dan Gianotti 2017 年 8 月 4 日
I haven't looked too closely at what you're trying to do, but at least one problem is in this part:
we1.*kron(PauliX,eye(2))
since size(we1) is [1,101] and size(kron(...)) is [4,4].
JJH
JJH 2017 年 8 月 4 日
So is there a way to times each iteration by a different value of we and keep them all?

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeContour Plots についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by