concurrence calculation of qubit system

9 ビュー (過去 30 日間)
AVM
AVM 2020 年 1 月 24 日
回答済み: Ibrahim Issah 2021 年 3 月 18 日
I need to calcualte the concurrenec for the given density matrix. Pl somebody see my code and solve my issue.
clc
close all
function c=concurrence(rho)
rho=1/2*[0 0 0 0;0 1 -1 0;0 -1 1 0;0 0 0 0];
y=[0 -1i; 1i 0];
R=rho*kron(y,y)*conj(rho)*kron(y,y);
% Real is needed since MATLAB always adds a small imaginary part ...
e=real(sqrt(eig(R)));
e=-sort(-e);
c=max(e(1)-e(2)-e(3)-e(4),0)
end
The concurrenec is not coming. Pl help me to get that.
  1 件のコメント
Mohammad Sami
Mohammad Sami 2020 年 1 月 26 日
What seems to be the problem ?

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

回答 (1 件)

Ibrahim Issah
Ibrahim Issah 2021 年 3 月 18 日
%% intialize %%
clc
close all
clear
%%%%%%%%%%%%%
%% density matrix%%%%
rho=1/2*[0 0 0 0;0 1 -1 0;0 -1 1 0;0 0 0 0];
%%%%%%% pauli matrix%%%%%%%%%%
y=[0 -1i; 1i 0];
%%% p and ptilda %%%%%%%
R=rho*kron(y,y)*conj(rho)*kron(y,y);
% Real is needed since MATLAB always adds a small imaginary part ...
e=real(sqrt(eig(R)));
e=-sort(-e);
c=max(e(1)-e(2)-e(3)-e(4),0);
disp(c);
%% Apparently you don't need any function for this since your density matrix is already defined. Thank you.

カテゴリ

Help Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by