이 질문을 팔로우합니다.
- 팔로우하는 게시물 피드에서 업데이트를 확인할 수 있습니다.
- 정보 수신 기본 설정에 따라 이메일을 받을 수 있습니다.
How introduce column vector in M-file?
조회 수: 3 (최근 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일
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1300180/image.png)
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)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1300260/image.png)
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개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Gate-Based Quantum Computing에 대해 자세히 알아보기
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 (한국어)