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 9216623
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T02:27:28+00:00 2026-06-18T02:27:28+00:00

Not sure whether this is a bug in the package or due to some

  • 0

Not sure whether this is a bug in the package or due to some other cause, but here we go.

I’m using the following package to find the largest eigenvalue and its corresponding eigenvector over a symmetric matrix of similarity scores (10×10 in size):

scipy.sparse.linalg.eigen.arpack.eigsh

, like so:

scipy.sparse.linalg.eigen.arpack.eigsh(mymatrix, 1, which='LM')

Now the question I have is that when I run it several times (using same matrix, settings etc.), sometimes the values in the eigenvectors are positive, and sometimes negative (see Run 3).

Does anyone know why this might be, or is it a bug? There doesn’t seem to be a pattern to it, but it only happens when I run the code without closing Python after each iteration (i.e hitting F5 after each run).

### Run 1: ###
[[-0.31056873]
[-0.31913092]
[-0.3149287 ]
[-0.32262921]
[-0.32190688]
[-0.31292658]
[-0.32424732]
[-0.31885208]
[-0.31808024]
[-0.298174  ]]

### Run 2: ###
[[-0.31056873]
[-0.31913092]
[-0.3149287 ]
[-0.32262921]
[-0.32190688]
[-0.31292658]
[-0.32424732]
[-0.31885208]
[-0.31808024]
[-0.298174  ]]

### Run 3:###
[[ 0.31056873]
[ 0.31913092]
[ 0.3149287 ]
[ 0.32262921]
[ 0.32190688]
[ 0.31292658]
[ 0.32424732]
[ 0.31885208]
[ 0.31808024]
[ 0.298174  ]]

### Run 4: ###
[[-0.31056873]
[-0.31913092]
[-0.3149287 ]
[-0.32262921]
[-0.32190688]
[-0.31292658]
[-0.32424732]
[-0.31885208]
[-0.31808024]
[-0.298174  ]]

It’s not a major problem, but I don’t like the uncertainty in my code 😉

Many thanks in advance,

Martyn

  • 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-06-18T02:27:29+00:00Added an answer on June 18, 2026 at 2:27 am

    This is actually a math question.

    But the reason is that there’s an arbitrary phase when you calculate eigenvectors. You’re solving Ax = bx for x. The equation is invariant under multiplication by a (possibly ocmplex) phase.

    As to why it happens in a (seemingly) random fashion, I don’t know. But I’m pretty sure it’s not a bug.

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

Sidebar

Related Questions

I'm not sure whether this question belongs on StackOverflow or SuperUser, but here goes
I'm not sure whether this is the origin of the bug I'm trying to
I think I've encountered a bug in Params::Validate , but I'm not sure whether
I am not sure whether this is a feature or a bug on the
Not sure whether this is the right place, but I have a question related
I'm not sure whether this is necessary, but I don't see any csrf tokens
I am not sure whether this is expected or it is bug. I am
i'm not sure this problem whether is the bug or it's just this,before i
I'm not sure whether I'm running into a bug in the Android tools here,
I'm not sure whether this is just a bug or an intended feature. Basically,

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.