n> is ketn and <n| is bran

1 commentaire

Florian Rössing
Florian Rössing le 10 Jan 2023
Hay, you might want to elaborate what ket and bra are for the non informed.

Connectez-vous pour commenter.

 Réponse acceptée

Florian Rössing
Florian Rössing le 10 Jan 2023

0 votes

Like this?
ket0 = [1; 0; 0];
ket1 = [0; 1; 0];
ket2 = [0; 0; 1];
bra0 = [1 0 0];
bra1 = [0 1 0];
bra2 = [0 0 1];
Ans = ket0*bra0 + ket1*bra1 + ket2*bra2;
Else you would need to elaborate on your problem so we can understand better, what you intend to do

5 commentaires

Idrees Muhammad
Idrees Muhammad le 10 Jan 2023
Hi help me to write this in summation form
ket0*bra0 + ket1*bra1 + ket2*bra2;
Florian Rössing
Florian Rössing le 10 Jan 2023
thats what i did. see above. You want a function that takes a number of bras and ket? Please give a detailed description of what you want to achieve.
Idrees Muhammad
Idrees Muhammad le 10 Jan 2023
Notatation can written fro ket is > and for bra is <| ,so how its define in matlab.
Florian Rössing
Florian Rössing le 10 Jan 2023
Bra and Ket are only alternative notations for vectors, so a bra is a row vector and ket is a culomn vector. I have had lectures in quantum mechanics, so bras and kets are not unknown to me, just what you want to do with them in matlab does not become clear in your question.
Could you write more than just one sentence on the matter amd deliver a full description of what your problem is and what you want to achieve?
Florian Rössing
Florian Rössing le 10 Jan 2023
Ok, Matlab has no notation for bra and ket. You can define vectors (as nx1 or 1xn Arrays) and then do standard vector operation on those.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Get Started with MATLAB dans Centre d'aide et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by