How this result get in MATLAB?
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Idrees Muhammad
le 10 Jan 2023
Commenté : Florian Rössing
le 10 Jan 2023

1 commentaire
Florian Rössing
le 10 Jan 2023
Hay, you might want to elaborate what ket and bra are for the non informed.
Réponse acceptée
Florian Rössing
le 10 Jan 2023
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
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.
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Logical dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!