필터 지우기
필터 지우기

Second Element is not 1 but It is coming as 1

조회 수: 3 (최근 30일)
Gözde Üstün
Gözde Üstün 2020년 6월 25일
댓글: Gözde Üstün 2020년 6월 26일
Hello,
I have this matrix:
I saved this matrix in a list like : projectors_of_sigma_x_minus_sigma_z = [[(sqrt(2)-1);1],[(-sqrt(2)-1);1]];
and this is my code :
function B = CHSHmeasurement
B=zeros(2,2,2,2);
projectors_of_sigma_x_minus_sigma_z = [[(sqrt(2)-1);1],[(-sqrt(2)-1);1]];
B(:,:,2,1) = projectors_of_sigma_x_minus_sigma_z(1);
B(:,:,2,2) = projectors_of_sigma_x_minus_sigma_z(2);
end
But I have this result:
However I have not 1 as the second element of projectors_of_sigma_x_minus_sigma_z. I have [(-sqrt(2)-1);1] for the second element of projectors_of_sigma_x_minus_sigma_z(2); Where am I wrong ?

채택된 답변

madhan ravi
madhan ravi 2020년 6월 25일
편집: madhan ravi 2020년 6월 25일
>> B=zeros(2,2,2,2);
projectors_of_sigma_x_minus_sigma_z = [[(sqrt(2)-1);1],[(-sqrt(2)-1);1]]
B(:,:,2,1) = projectors_of_sigma_x_minus_sigma_z(1)
B(:,:,2,2) = projectors_of_sigma_x_minus_sigma_z(2)
projectors_of_sigma_x_minus_sigma_z =
0.4142 -2.4142
1.0000 1.0000
B(:,:,1,1) =
0 0
0 0
B(:,:,2,1) =
0.4142 0.4142
0.4142 0.4142
B(:,:,1,2) =
0 0
0 0
B(:,:,2,2) =
0 0
0 0
B(:,:,1,1) =
0 0
0 0
B(:,:,2,1) =
0.4142 0.4142
0.4142 0.4142
B(:,:,1,2) =
0 0
0 0
B(:,:,2,2) =
1 1
1 1
>>
You're copying a scalar to that entire page.
  댓글 수: 9
Gözde Üstün
Gözde Üstün 2020년 6월 26일
And Sorry I missed your previous answer
projectors_of_sigma_x_minus_sigma_z(:, 1)
This is for what ?
Gözde Üstün
Gözde Üstün 2020년 6월 26일
Sorry I just saw your answer now Thank you very much :)

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 MATLAB에 대해 자세히 알아보기

제품


릴리스

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by