mathematica를 사용하여 고유 값 계산 문제

기본적으로 행렬의 고유 값을 찾으려고하는데 약 12 ​​개가 걸립니다. 시간. 완료되면 모든 고유 벡터 (실제로는 거의 없음)를 찾을 수 없다고 말하고 발견 한 것에 대해 회의적입니다. 내가 할 수있는 일은 내 코드를 게시하는 것 뿐이며 누군가가 나에게 몇 가지 제안을 할 수 있기를 바랍니다. 나는 mathematica에 대한 경험이 많지 않으며 느린 실행 시간과 나쁜 결과는 mathematica의 능력이 아닌 나와 관련이 있습니다. 답장 해주신 분들 덕분에 정말 감사합니다.

cutoff = 500; (* set a cutoff for the infinite series *)
numStates = cutoff + 1; (* set the number of excited states to be printed *)
If[numStates > 10, numStates = 10];

    $RecursionLimit = cutoff + 256; (* Increase the recursion limit to allow for the specified cutoff *)
(* set the mass of the constituent quarks *)
m1 := mS; (* just supposed to be a constant *)
m2 := 0;

(* construct the hamiltonian *)
h0[n_,m_] := 4 Min[n,m] * ((-1)^(n+m) * m1^2 + m2^2);

v[0,m_] := 0;
v[n_,0] := 0;
v[n_,1] := (8/n) * ((1 + (-1)^(n + 1)) / 2);
v[n_,m_] := v[n - 1, m - 1] * (m/(m - 1)) + (8 m/(n + m - 1))*((1 + (-1)^(n + m))/2);

h[n_,m_] := h0[n,m] + v[n,m];

(* construct the matrix from the hamiltonian *)
mat = Table[h[n,m], {n, 0, cutoff}, {m, 0, cutoff}] // FullSimplify;

(* find the eigenvalues and eigenvectors, then reverse the order *)
PrintTemporary["Finding the eigenvalues"];
{vals, vecs} = Eigensystem[N[mat]] // FullSimplify;

$RecursionLimit = 256; (* Put the recursion limit back to the default *)

내 코드가 조금 더 있지만, 이것이 정말 느려지는 지점입니다. 내가 확실히 언급해야 할 것은 m1과 m2를 모두 0으로 설정하면 아무런 문제가 없지만 m1을 상수로 설정하면 모든 것이 지옥에 빠진다는 것입니다.

5
задан Jim Lewis 28 June 2011 в 17:58
поделиться