Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6088767
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T12:01:25+00:00 2026-05-23T12:01:25+00:00

Basically I’m trying to find the eigenvalues for matrix, and it takes about 12

  • 0

Basically I’m trying to find the eigenvalues for matrix, and it takes about 12 hours. When it finishes, it says it couldn’t find all the eigenvectors (actually barely any), and I’m skeptical about the ones it did find. All I can really do is post my code, and I’m hoping that someone might be able to make some suggestions to me. I’m not very experienced with mathematica and maybe the slow run time and the bad results has something to do with me and not mathematica’s abilities. Thanks to anyone that replies, I really appreciate it.

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 *)

There is a bit more of my code, but this is the point where it is really slowing down. Something I should definitely mention, is that if I set both m1 and m2 to be zero, I don’t really have any issues, but setting m1 to a constant makes everything go to hell.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T12:01:26+00:00Added an answer on May 23, 2026 at 12:01 pm

    Your problem is that the constant mS remains symbolic. This means that Mathematica is trying to analytically solve for the eigenvalues instead of numerically. If your problem allows you to choose a numerical value for mS you should do so.

    The other, unrelated, problem you have is that you are using a recursive formula and you want to use, e.g., memoization in the following line

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

    The extra v[n, m] = stores the value for a given n and m so you don’t have to recurse all the way to v[0,0] every time h[n, m] is called in Table[].

    With those two things taken care of my old core 2 duo takes less than a minute to do the eigenvalues.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Basically, what I am trying to do is to find last section of PE
Basically, something better than this: <input type=file name=myfile size=50> First of all, the browse
Basically I am trying to restart a service from a php web page. Here
Basically, I'm trying to tap into the Soap pipeline in .NET 2.0 - I
Basically I'm trying to accomplish the same thing that mailto:bgates@microsoft.com does in Internet Explorer
Basically, what I'm trying to create is a page of div tags, each has
Basically what I'm trying to do is make a very simple vertical bullet projectile
Basically I'm trying to improve on the Ghosts in a Pacman game I'm making.
Basically i'm trying to build a comment system. The user looks at a photo
Basically, I've seen this used all to often: public event MyEventHandler MyEvent; private void

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.