How introduce column vector in M-file?
1 次查看(过去 30 天)
显示 更早的评论
how I improved my file to get { temp1<<1}, I am stuck here.
i gto sugestion to introduce column vector for temp0 but i am fail in this stage
7 个评论
Walter Roberson
2023-2-19
ket = sum(tmpI(:,2:D),2);
The sum over the second dimension of a 2d array is going to be a column vector.
temp0 = symsum(exp(-abs(alpha(k))^2 * alpha(k)^n / sqrt(factorial(n)) ), n, 0, 14)*ket;
symsum of a scalar expression is going to give a scalar result. You then multiply by the column vector, and that will give you a column vector result.
It therefore appears that your temp0 is already a column vector.
Abu Zar
2023-2-19
temp1 is also expression,i also want to get some value,then Hope i will get temp1'*temp1<<1
Abu Zar
2023-2-19
编辑:Abu Zar
2023-2-19
modify this?thanks
disp(temp1)
0
- (9*exp(-(94143178827*479001600^(1/2))/1203125000000000000000000000000))/50 - (9*exp(-(3486784401*3628800^(1/2))/10937500000000000000000000))/50 - (9*exp(-(1594323*120^(1/2))/31250000000000))/50 - (9*exp(-(7625597484987*87178291200^(1/2))/547421875000000000000000000000000000))/50 - (9*exp(-(6561*2^(1/2))/12500000))/50 - (9*exp(-(177147*24^(1/2))/125000000000))/50 - (9*exp(-(19683*6^(1/2))/625000000))/50 - (9*exp(-81/2500))/50 - (9*exp(-729/125000))/50 - (9*exp(-(387420489*362880^(1/2))/21875000000000000000000))/50 - (9*exp(-(43046721*5040^(1/2))/1093750000000000000))/50 - (9*exp(-(847288609443*6227020800^(1/2))/782031250000000000000000000000000))/50 - (9*exp(-(387420489*40320^(1/2))/437500000000000000000))/50 - (9*exp(-(31381059609*39916800^(1/2))/6015625000000000000000000000))/50 - (9*exp(-(4782969*720^(1/2))/3125000000000000))/50
2^(1/2)*(exp(-(94143178827*479001600^(1/2))/1203125000000000000000000000000) + exp(-(3486784401*3628800^(1/2))/10937500000000000000000000) + exp(-(1594323*120^(1/2))/31250000000000) + exp(-(7625597484987*87178291200^(1/2))/547421875000000000000000000000000000) + exp(-(6561*2^(1/2))/12500000) + exp(-(177147*24^(1/2))/125000000000) + exp(-(19683*6^(1/2))/625000000) + exp(-81/2500) + exp(-729/125000) + exp(-(387420489*362880^(1/2))/21875000000000000000000) + exp(-(43046721*5040^(1/2))/1093750000000000000) + exp(-(847288609443*6227020800^(1/2))/782031250000000000000000000000000) + exp(-(387420489*40320^(1/2))/437500000000000000000) + exp(-(31381059609*39916800^(1/2))/6015625000000000000000000000) + exp(-(4782969*720^(1/2))/3125000000000000)) - (9*exp(-(3486784401*3628800^(1/2))/10937500000000000000000000))/50 - (9*exp(-(1594323*120^(1/2))/31250000000000))/50 - (9*exp(-(7625597484987*87178291200^(1/2))/547421875000000000000000000000000000))/50 - (9*exp(-(6561*2^(1/2))/12500000))/50 - (9*exp(-(177147*24^(1/2))/125000000000))/50 - (9*exp(-(19683*6^(1/2))/625000000))/50 - (9*exp(-81/2500))/50 - (9*exp(-729/125000))/50 - (9*exp(-(387420489*362880^(1/2))/21875000000000000000000))/50 - (9*exp(-(43046721*5040^(1/2))/1093750000000000000))/50 - (9*exp(-(847288609443*6227020800^(1/2))/782031250000000000000000000000000))/50 - (9*exp(-(387420489*40320^(1/2))/437500000000000000000))/50 - (9*exp(-(31381059609*39916800^(1/2))/6015625000000000000000000000))/50 - (9*exp(-(4782969*720^(1/2))/3125000000000000))/50 - (9*exp(-(94143178827*479001600^(1/2))/1203125000000000000000000000000))/50
3^(1/2)*(exp(-(94143178827*479001600^(1/2))/1203125000000000000000000000000) + exp(-(3486784401*3628800^(1/2))/10937500000000000000000000) + exp(-(1594323*120^(1/2))/31250000000000) + exp(-(7625597484987*87178291200^(1/2))/547421875000000000000000000000000000) + exp(-(6561*2^(1/2))/12500000) + exp(-(177147*24^(1/2))/125000000000) + exp(-(19683*6^(1/2))/625000000) + exp(-81/2500) + exp(-729/125000) + exp(-(387420489*362880^(1/2))/21875000000000000000000) + exp(-(43046721*5040^(1/2))/1093750000000000000) + exp(-(847288609443*6227020800^(1/2))/782031250000000000000000000000000) + exp(-(387420489*40320^(1/2))/437500000000000000000) + exp(-(31381059609*39916800^(1/2))/6015625000000000000000000000) + exp(-(4782969*720^(1/2))/3125000000000000)) - (9*exp(-(3486784401*3628800^(1/2))/10937500000000000000000000))/50 - (9*exp(-(1594323*120^(1/2))/31250000000000))/50 - (9*exp(-(7625597484987*87178291200^(1/2))/547421875000000000000000000000000000))/50 - (9*exp(-(6561*2^(1/2))/12500000))/50 - (9*exp(-(177147*24^(1/2))/125000000000))/50 - (9*exp(-(19683*6^(1/2))/625000000))/50 - (9*exp(-81/2500))/50 - (9*exp(-729/125000))/50 - (9*exp(-(387420489*362880^(1/2))/21875000000000000000000))/50 - (9*exp(-(43046721*5040^(1/2))/1093750000000000000))/50 - (9*exp(-(847288609443*6227020800^(1/2))/782031250000000000000000000000000))/50 - (9*exp(-(387420489*40320^(1/2))/437500000000000000000))/50 - (9*exp(-(31381059609*39916800^(1/2))/6015625000000000000000000000))/50 - (9*exp(-(4782969*720^(1/2))/3125000000000000))/50 - (9*exp(-(94143178827*479001600^(1/2))/1203125000000000000000000000000))/50
(91*exp(-(94143178827*479001600^(1/2))/1203125000000000000000000000000))/50 + (91*exp(-(3486784401*3628800^(1/2))/10937500000000000000000000))/50 + (91*exp(-(1594323*120^(1/2))/31250000000000))/50 + (91*exp(-(7625597484987*87178291200^(1/2))/547421875000000000000000000000000000))/50 + (91*exp(-(6561*2^(1/2))/12500000))/50 + (91*exp(-(177147*24^(1/2))/125000000000))/50 + (91*exp(-(19683*6^(1/2))/625000000))/50 + (91*exp(-81/2500))/50 + (91*exp(-729/125000))/50 + (91*exp(-(387420489*362880^(1/2))/21875000000000000000000))/50 + (91*exp(-(43046721*5040^(1/2))/1093750000000000000))/50 + (91*exp(-(847288609443*6227020800^(1/2))/782031250000000000000000000000000))/50 + (91*exp(-(387420489*40320^(1/2))/437500000000000000000))/50 + (91*exp(-(31381059609*39916800^(1/2))/6015625000000000000000000000))/50 + (91*exp(-(4782969*720^(1/2))/3125000000000000))/50
5^(1/2)*(exp(-(94143178827*479001600^(1/2))/1203125000000000000000000000000) + exp(-(3486784401*3628800^(1/2))/10937500000000000000000000) + exp(-(1594323*120^(1/2))/31250000000000) + exp(-(7625597484987*87178291200^(1/2))/547421875000000000000000000000000000) + exp(-(6561*2^(1/2))/12500000) + exp(-(177147*24^(1/2))/125000000000) + exp(-(19683*6^(1/2))/625000000) + exp(-81/2500) + exp(-729/125000) + exp(-(387420489*362880^(1/2))/21875000000000000000000) + exp(-(43046721*5040^(1/2))/1093750000000000000) + exp(-(847288609443*6227020800^(1/2))/782031250000000000000000000000000) + exp(-(387420489*40320^(1/2))/437500000000000000000) + exp(-(31381059609*39916800^(1/2))/6015625000000000000000000000) + exp(-(4782969*720^(1/2))/3125000000000000)) - (9*exp(-(3486784401*3628800^(1/2))/10937500000000000000000000))/50 - (9*exp(-(1594323*120^(1/2))/31250000000000))/50 - (9*exp(-(7625597484987*87178291200^(1/2))/547421875000000000000000000000000000))/50 - (9*exp(-(6561*2^(1/2))/12500000))/50 - (9*exp(-(177147*24^(1/2))/125000000000))/50 - (9*exp(-(19683*6^(1/2))/625000000))/50 - (9*exp(-81/2500))/50 - (9*exp(-729/125000))/50 - (9*exp(-(387420489*362880^(1/2))/21875000000000000000000))/50 - (9*exp(-(43046721*5040^(1/2))/1093750000000000000))/50 - (9*exp(-(847288609443*6227020800^(1/2))/782031250000000000000000000000000))/50 - (9*exp(-(387420489*40320^(1/2))/437500000000000000000))/50 - (9*exp(-(31381059609*39916800^(1/2))/6015625000000000000000000000))/50 - (9*exp(-(4782969*720^(1/2))/3125000000000000))/50 - (9*exp(-(94143178827*479001600^(1/2))/1203125000000000000000000000000))/50
6^(1/2)*(exp(-(94143178827*479001600^(1/2))/1203125000000000000000000000000) + exp(-(3486784401*3628800^(1/2))/10937500000000000000000000) + exp(-(1594323*120^(1/2))/31250000000000) + exp(-(7625597484987*87178291200^(1/2))/547421875000000000000000000000000000) + exp(-(6561*2^(1/2))/12500000) + exp(-(177147*24^(1/2))/125000000000) + exp(-(19683*6^(1/2))/625000000) + exp(-81/2500) + exp(-729/125000) + exp(-(387420489*362880^(1/2))/21875000000000000000000) + exp(-(43046721*5040^(1/2))/1093750000000000000) + exp(-(847288609443*6227020800^(1/2))/782031250000000000000000000000000) + exp(-(387420489*40320^(1/2))/437500000000000000000) + exp(-(31381059609*39916800^(1/2))/6015625000000000000000000000) + exp(-(4782969*720^(1/2))/3125000000000000)) - (9*exp(-(3486784401*3628800^(1/2))/10937500000000000000000000))/50 - (9*exp(-(1594323*120^(1/2))/31250000000000))/50 - (9*exp(-(7625597484987*87178291200^(1/2))/547421875000000000000000000000000000))/50 - (9*exp(-(6561*2^(1/2))/12500000))/50 - (9*exp(-(177147*24^(1/2))/125000000000))/50 - (9*exp(-(19683*6^(1/2))/625000000))/50 - (9*exp(-81/2500))/50 - (9*exp(-729/125000))/50 - (9*exp(-(387420489*362880^(1/2))/21875000000000000000000))/50 - (9*exp(-(43046721*5040^(1/2))/1093750000000000000))/50 - (9*exp(-(847288609443*6227020800^(1/2))/782031250000000000000000000000000))/50 - (9*exp(-(387420489*40320^(1/2))/437500000000000000000))/50 - (9*exp(-(31381059609*39916800^(1/2))/6015625000000000000000000000))/50 - (9*exp(-(4782969*720^(1/2))/3125000000000000))/50 - (9*exp(-(94143178827*479001600^(1/2))/1203125000000000000000000000000))/50
7^(1/2)*(exp(-(94143178827*479001600^(1/2))/1203125000000000000000000000000) + exp(-(3486784401*3628800^(1/2))/10937500000000000000000000) + exp(-(1594323*120^(1/2))/31250000000000) + exp(-(7625597484987*87178291200^(1/2))/547421875000000000000000000000000000) + exp(-(6561*2^(1/2))/12500000) + exp(-(177147*24^(1/2))/125000000000) + exp(-(19683*6^(1/2))/625000000) + exp(-81/2500) + exp(-729/125000) + exp(-(387420489*362880^(1/2))/21875000000000000000000) + exp(-(43046721*5040^(1/2))/1093750000000000000) + exp(-(847288609443*6227020800^(1/2))/782031250000000000000000000000000) + exp(-(387420489*40320^(1/2))/437500000000000000000) + exp(-(31381059609*39916800^(1/2))/6015625000000000000000000000) + exp(-(4782969*720^(1/2))/3125000000000000)) - (9*exp(-(3486784401*3628800^(1/2))/10937500000000000000000000))/50 - (9*exp(-(1594323*120^(1/2))/31250000000000))/50 - (9*exp(-(7625597484987*87178291200^(1/2))/547421875000000000000000000000000000))/50 - (9*exp(-(6561*2^(1/2))/12500000))/50 - (9*exp(-(177147*24^(1/2))/125000000000))/50 - (9*exp(-(19683*6^(1/2))/625000000))/50 - (9*exp(-81/2500))/50 - (9*exp(-729/125000))/50 - (9*exp(-(387420489*362880^(1/2))/21875000000000000000000))/50 - (9*exp(-(43046721*5040^(1/2))/1093750000000000000))/50 - (9*exp(-(847288609443*6227020800^(1/2))/782031250000000000000000000000000))/50 - (9*exp(-(387420489*40320^(1/2))/437500000000000000000))/50 - (9*exp(-(31381059609*39916800^(1/2))/6015625000000000000000000000))/50 - (9*exp(-(4782969*720^(1/2))/3125000000000000))/50 - (9*exp(-(94143178827*479001600^(1/2))/1203125000000000000000000000000))/50
2*2^(1/2)*(exp(-(94143178827*479001600^(1/2))/1203125000000000000000000000000) + exp(-(3486784401*3628800^(1/2))/10937500000000000000000000) + exp(-(1594323*120^(1/2))/31250000000000) + exp(-(7625597484987*87178291200^(1/2))/547421875000000000000000000000000000) + exp(-(6561*2^(1/2))/12500000) + exp(-(177147*24^(1/2))/125000000000) + exp(-(19683*6^(1/2))/625000000) + exp(-81/2500) + exp(-729/125000) + exp(-(387420489*362880^(1/2))/21875000000000000000000) + exp(-(43046721*5040^(1/2))/1093750000000000000) + exp(-(847288609443*6227020800^(1/2))/782031250000000000000000000000000) + exp(-(387420489*40320^(1/2))/437500000000000000000) + exp(-(31381059609*39916800^(1/2))/6015625000000000000000000000) + exp(-(4782969*720^(1/2))/3125000000000000)) - (9*exp(-(3486784401*3628800^(1/2))/10937500000000000000000000))/50 - (9*exp(-(1594323*120^(1/2))/31250000000000))/50 - (9*exp(-(7625597484987*87178291200^(1/2))/547421875000000000000000000000000000))/50 - (9*exp(-(6561*2^(1/2))/12500000))/50 - (9*exp(-(177147*24^(1/2))/125000000000))/50 - (9*exp(-(19683*6^(1/2))/625000000))/50 - (9*exp(-81/2500))/50 - (9*exp(-729/125000))/50 - (9*exp(-(387420489*362880^(1/2))/21875000000000000000000))/50 - (9*exp(-(43046721*5040^(1/2))/1093750000000000000))/50 - (9*exp(-(847288609443*6227020800^(1/2))/782031250000000000000000000000000))/50 - (9*exp(-(387420489*40320^(1/2))/437500000000000000000))/50 - (9*exp(-(31381059609*39916800^(1/2))/6015625000000000000000000000))/50 - (9*exp(-(4782969*720^(1/2))/3125000000000000))/50 - (9*exp(-(94143178827*479001600^(1/2))/1203125000000000000000000000000))/50
(141*exp(-(94143178827*479001600^(1/2))/1203125000000000000000000000000))/50 + (141*exp(-(3486784401*3628800^(1/2))/10937500000000000000000000))/50 + (141*exp(-(1594323*120^(1/2))/31250000000000))/50 + (141*exp(-(7625597484987*87178291200^(1/2))/547421875000000000000000000000000000))/50 + (141*exp(-(6561*2^(1/2))/12500000))/50 + (141*exp(-(177147*24^(1/2))/125000000000))/50 + (141*exp(-(19683*6^(1/2))/625000000))/50 + (141*exp(-81/2500))/50 + (141*exp(-729/125000))/50 + (141*exp(-(387420489*362880^(1/2))/21875000000000000000000))/50 + (141*exp(-(43046721*5040^(1/2))/1093750000000000000))/50 + (141*exp(-(847288609443*6227020800^(1/2))/782031250000000000000000000000000))/50 + (141*exp(-(387420489*40320^(1/2))/437500000000000000000))/50 + (141*exp(-(31381059609*39916800^(1/2))/6015625000000000000000000000))/50 + (141*exp(-(4782969*720^(1/2))/3125000000000000))/50
10^(1/2)*(exp(-(94143178827*479001600^(1/2))/1203125000000000000000000000000) + exp(-(3486784401*3628800^(1/2))/10937500000000000000000000) + exp(-(1594323*120^(1/2))/31250000000000) + exp(-(7625597484987*87178291200^(1/2))/547421875000000000000000000000000000) + exp(-(6561*2^(1/2))/12500000) + exp(-(177147*24^(1/2))/125000000000) + exp(-(19683*6^(1/2))/625000000) + exp(-81/2500) + exp(-729/125000) + exp(-(387420489*362880^(1/2))/21875000000000000000000) + exp(-(43046721*5040^(1/2))/1093750000000000000) + exp(-(847288609443*6227020800^(1/2))/782031250000000000000000000000000) + exp(-(387420489*40320^(1/2))/437500000000000000000) + exp(-(31381059609*39916800^(1/2))/6015625000000000000000000000) + exp(-(4782969*720^(1/2))/3125000000000000)) - (9*exp(-(3486784401*3628800^(1/2))/10937500000000000000000000))/50 - (9*exp(-(1594323*120^(1/2))/31250000000000))/50 - (9*exp(-(7625597484987*87178291200^(1/2))/547421875000000000000000000000000000))/50 - (9*exp(-(6561*2^(1/2))/12500000))/50 - (9*exp(-(177147*24^(1/2))/125000000000))/50 - (9*exp(-(19683*6^(1/2))/625000000))/50 - (9*exp(-81/2500))/50 - (9*exp(-729/125000))/50 - (9*exp(-(387420489*362880^(1/2))/21875000000000000000000))/50 - (9*exp(-(43046721*5040^(1/2))/1093750000000000000))/50 - (9*exp(-(847288609443*6227020800^(1/2))/782031250000000000000000000000000))/50 - (9*exp(-(387420489*40320^(1/2))/437500000000000000000))/50 - (9*exp(-(31381059609*39916800^(1/2))/6015625000000000000000000000))/50 - (9*exp(-(4782969*720^(1/2))/3125000000000000))/50 - (9*exp(-(94143178827*479001600^(1/2))/1203125000000000000000000000000))/50
11^(1/2)*(exp(-(94143178827*479001600^(1/2))/1203125000000000000000000000000) + exp(-(3486784401*3628800^(1/2))/10937500000000000000000000) + exp(-(1594323*120^(1/2))/31250000000000) + exp(-(7625597484987*87178291200^(1/2))/547421875000000000000000000000000000) + exp(-(6561*2^(1/2))/12500000) + exp(-(177147*24^(1/2))/125000000000) + exp(-(19683*6^(1/2))/625000000) + exp(-81/2500) + exp(-729/125000) + exp(-(387420489*362880^(1/2))/21875000000000000000000) + exp(-(43046721*5040^(1/2))/1093750000000000000) + exp(-(847288609443*6227020800^(1/2))/782031250000000000000000000000000) + exp(-(387420489*40320^(1/2))/437500000000000000000) + exp(-(31381059609*39916800^(1/2))/6015625000000000000000000000) + exp(-(4782969*720^(1/2))/3125000000000000)) - (9*exp(-(3486784401*3628800^(1/2))/10937500000000000000000000))/50 - (9*exp(-(1594323*120^(1/2))/31250000000000))/50 - (9*exp(-(7625597484987*87178291200^(1/2))/547421875000000000000000000000000000))/50 - (9*exp(-(6561*2^(1/2))/12500000))/50 - (9*exp(-(177147*24^(1/2))/125000000000))/50 - (9*exp(-(19683*6^(1/2))/625000000))/50 - (9*exp(-81/2500))/50 - (9*exp(-729/125000))/50 - (9*exp(-(387420489*362880^(1/2))/21875000000000000000000))/50 - (9*exp(-(43046721*5040^(1/2))/1093750000000000000))/50 - (9*exp(-(847288609443*6227020800^(1/2))/782031250000000000000000000000000))/50 - (9*exp(-(387420489*40320^(1/2))/437500000000000000000))/50 - (9*exp(-(31381059609*39916800^(1/2))/6015625000000000000000000000))/50 - (9*exp(-(4782969*720^(1/2))/3125000000000000))/50 - (9*exp(-(94143178827*479001600^(1/2))/1203125000000000000000000000000))/50
2*3^(1/2)*(exp(-(94143178827*479001600^(1/2))/1203125000000000000000000000000) + exp(-(3486784401*3628800^(1/2))/10937500000000000000000000) + exp(-(1594323*120^(1/2))/31250000000000) + exp(-(7625597484987*87178291200^(1/2))/547421875000000000000000000000000000) + exp(-(6561*2^(1/2))/12500000) + exp(-(177147*24^(1/2))/125000000000) + exp(-(19683*6^(1/2))/625000000) + exp(-81/2500) + exp(-729/125000) + exp(-(387420489*362880^(1/2))/21875000000000000000000) + exp(-(43046721*5040^(1/2))/1093750000000000000) + exp(-(847288609443*6227020800^(1/2))/782031250000000000000000000000000) + exp(-(387420489*40320^(1/2))/437500000000000000000) + exp(-(31381059609*39916800^(1/2))/6015625000000000000000000000) + exp(-(4782969*720^(1/2))/3125000000000000)) - (9*exp(-(3486784401*3628800^(1/2))/10937500000000000000000000))/50 - (9*exp(-(1594323*120^(1/2))/31250000000000))/50 - (9*exp(-(7625597484987*87178291200^(1/2))/547421875000000000000000000000000000))/50 - (9*exp(-(6561*2^(1/2))/12500000))/50 - (9*exp(-(177147*24^(1/2))/125000000000))/50 - (9*exp(-(19683*6^(1/2))/625000000))/50 - (9*exp(-81/2500))/50 - (9*exp(-729/125000))/50 - (9*exp(-(387420489*362880^(1/2))/21875000000000000000000))/50 - (9*exp(-(43046721*5040^(1/2))/1093750000000000000))/50 - (9*exp(-(847288609443*6227020800^(1/2))/782031250000000000000000000000000))/50 - (9*exp(-(387420489*40320^(1/2))/437500000000000000000))/50 - (9*exp(-(31381059609*39916800^(1/2))/6015625000000000000000000000))/50 - (9*exp(-(4782969*720^(1/2))/3125000000000000))/50 - (9*exp(-(94143178827*479001600^(1/2))/1203125000000000000000000000000))/50
13^(1/2)*(exp(-(94143178827*479001600^(1/2))/1203125000000000000000000000000) + exp(-(3486784401*3628800^(1/2))/10937500000000000000000000) + exp(-(1594323*120^(1/2))/31250000000000) + exp(-(7625597484987*87178291200^(1/2))/547421875000000000000000000000000000) + exp(-(6561*2^(1/2))/12500000) + exp(-(177147*24^(1/2))/125000000000) + exp(-(19683*6^(1/2))/625000000) + exp(-81/2500) + exp(-729/125000) + exp(-(387420489*362880^(1/2))/21875000000000000000000) + exp(-(43046721*5040^(1/2))/1093750000000000000) + exp(-(847288609443*6227020800^(1/2))/782031250000000000000000000000000) + exp(-(387420489*40320^(1/2))/437500000000000000000) + exp(-(31381059609*39916800^(1/2))/6015625000000000000000000000) + exp(-(4782969*720^(1/2))/3125000000000000)) - (9*exp(-(3486784401*3628800^(1/2))/10937500000000000000000000))/50 - (9*exp(-(1594323*120^(1/2))/31250000000000))/50 - (9*exp(-(7625597484987*87178291200^(1/2))/547421875000000000000000000000000000))/50 - (9*exp(-(6561*2^(1/2))/12500000))/50 - (9*exp(-(177147*24^(1/2))/125000000000))/50 - (9*exp(-(19683*6^(1/2))/625000000))/50 - (9*exp(-81/2500))/50 - (9*exp(-729/125000))/50 - (9*exp(-(387420489*362880^(1/2))/21875000000000000000000))/50 - (9*exp(-(43046721*5040^(1/2))/1093750000000000000))/50 - (9*exp(-(847288609443*6227020800^(1/2))/782031250000000000000000000000000))/50 - (9*exp(-(387420489*40320^(1/2))/437500000000000000000))/50 - (9*exp(-(31381059609*39916800^(1/2))/6015625000000000000000000000))/50 - (9*exp(-(4782969*720^(1/2))/3125000000000000))/50 - (9*exp(-(94143178827*479001600^(1/2))/1203125000000000000000000000000))/50
14^(1/2)*(exp(-(94143178827*479001600^(1/2))/1203125000000000000000000000000) + exp(-(3486784401*3628800^(1/2))/10937500000000000000000000) + exp(-(1594323*120^(1/2))/31250000000000) + exp(-(7625597484987*87178291200^(1/2))/547421875000000000000000000000000000) + exp(-(6561*2^(1/2))/12500000) + exp(-(177147*24^(1/2))/125000000000) + exp(-(19683*6^(1/2))/625000000) + exp(-81/2500) + exp(-729/125000) + exp(-(387420489*362880^(1/2))/21875000000000000000000) + exp(-(43046721*5040^(1/2))/1093750000000000000) + exp(-(847288609443*6227020800^(1/2))/782031250000000000000000000000000) + exp(-(387420489*40320^(1/2))/437500000000000000000) + exp(-(31381059609*39916800^(1/2))/6015625000000000000000000000) + exp(-(4782969*720^(1/2))/3125000000000000)) - (9*exp(-(3486784401*3628800^(1/2))/10937500000000000000000000))/50 - (9*exp(-(1594323*120^(1/2))/31250000000000))/50 - (9*exp(-(7625597484987*87178291200^(1/2))/547421875000000000000000000000000000))/50 - (9*exp(-(6561*2^(1/2))/12500000))/50 - (9*exp(-(177147*24^(1/2))/125000000000))/50 - (9*exp(-(19683*6^(1/2))/625000000))/50 - (9*exp(-81/2500))/50 - (9*exp(-729/125000))/50 - (9*exp(-(387420489*362880^(1/2))/21875000000000000000000))/50 - (9*exp(-(43046721*5040^(1/2))/1093750000000000000))/50 - (9*exp(-(847288609443*6227020800^(1/2))/782031250000000000000000000000000))/50 - (9*exp(-(387420489*40320^(1/2))/437500000000000000000))/50 - (9*exp(-(31381059609*39916800^(1/2))/6015625000000000000000000000))/50 - (9*exp(-(4782969*720^(1/2))/3125000000000000))/50 - (9*exp(-(94143178827*479001600^(1/2))/1203125000000000000000000000000))/50
Walter Roberson
2023-2-19
double() or vpa()
The exp() terms I tested were exp(-1e-9) to exp(-1e-15). Precision is low in that range but the values should be distinguishable from 1.
采纳的回答
Sulaymon Eshkabilov
2023-2-19
Here is the corrected code:
D = 15;
tmpI = eye(D);
ket = sum(tmpI(:,2:D),2);
syms n
ct = 6;
creation = circshift(diag(sqrt(0:1:(D-1))),-1);
annihilation = creation';
Vnorm = zeros(1,ct);
alpha = 0.03*(1:ct);
%loop for calculation
for k = 1:ct
temp0 = double(symsum(exp(-abs(alpha(k))^2 * alpha(k)^n / sqrt(factorial(n)) ), n, 0, 14)*ket);
ketalpha(k,:) = temp0; % Data from each iteration is stored
temp1 = annihilation*temp0 - alpha(k)*temp0;
V(k,:) = temp1; % Data from each iteration is stored
Vnorm(k) = temp1'*temp1;
end
plot(alpha,Vnorm, '-*k')
xlim([0 0.21])
xlabel('$\alpha$', 'Interpreter', 'latex', 'Color', 'b', 'FontSize', 15)
ylabel('Vnorm', 'Color', 'b', 'FontSize', 15)
whos temp0 ketalpha temp1 V Vnorm
Name Size Bytes Class Attributes
V 6x15 720 double
Vnorm 1x6 48 double
ketalpha 6x15 720 double
temp0 15x1 120 double
temp1 15x1 120 double
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!发生错误
由于页面发生更改,无法完成操作。请重新加载页面以查看其更新后的状态。
您也可以从以下列表中选择网站:
如何获得最佳网站性能
选择中国网站(中文或英文)以获得最佳网站性能。其他 MathWorks 国家/地区网站并未针对您所在位置的访问进行优化。
美洲
- América Latina (Español)
- Canada (English)
- United States (English)
欧洲
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom(English)
亚太
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)