フィルターのクリア

MATLAB codes for Quantum physics state with given values?

2 ビュー (過去 30 日間)
Zar
Zar 2023 年 2 月 8 日
回答済み: Edoardo_a 2023 年 3 月 7 日

回答 (1 件)

Edoardo_a
Edoardo_a 2023 年 3 月 7 日
I wrote this function, you just have to indicate the value for alpha (alpha_val) and n (n_val).
I hope it helps.
function [Alpha] = alp(alpha_val,n_val)
Alpha = zeros(1);
for i = 0 : 1 : n_val
Alpha = Alpha + (exp(-.5*abs(alpha_val)^2)/alpha_val^i)/sqrt(factorial(i));
end
sprintf('%c ', 945, '=', Alpha, '|n>')
end
alp(0.1,30)
ans =
'α = 1.320248e+14 | n > '
alp(0.2,30)
ans =
'α = 1.007363e+06 | n > '
alp(0.3,30)
ans =
'α = 1.004035e+03 | n > '
alp(0.4,30)
ans =
'α = 73.3975 | n > '
alp(0.5,30)
ans =
'α = 20.1727 | n > '

カテゴリ

Help Center および File ExchangeQuantum Mechanics についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by