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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T05:33:24+00:00 2026-06-18T05:33:24+00:00

I have a very simple question. It is related to the computational tolerance error.

  • 0

I have a very simple question. It is related to the computational tolerance error.

Let me do (see at the end) the eigendecomposition of a matrix A in eigenvector V and diagonal eigenvalues D, and build it again by multiplication V^-1*D*V.

The obtained value is far from being A, the error is quite big.

I would like to know if I am using incorrect functions to do this task or, at least, how can I reduce this error. Thank you in advance

in[1]:import numpy
      from scipy import linalg
      A=matrix([[16,-9,0],[-9,20,-11],[0,-11,11]])
      D,V=linalg.eig(A)
      D=diagflat(D)
      matrix(linalg.inv(V))*matrix(D)*matrix(V)


out[1]:matrix([[ 15.52275377,   9.37603361,   0.79257097],  
       [9.37603361,  21.12538282, -10.23535271],  
       [0.79257097, -10.23535271,  10.35186341]])
  • 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-18T05:33:26+00:00Added an answer on June 18, 2026 at 5:33 am

    Isn’t that backwards? A*V = V*D from the definition, so A = V*D*V^(-1).

    >>> import numpy as np
    >>> from scipy import linalg
    >>> A = np.matrix([[16,-9,0],[-9,20,-11],[0,-11,11]])
    >>> D, V = linalg.eig(A)
    >>> D = np.diagflat(D)
    >>> 
    >>> b = np.matrix(linalg.inv(V))*np.matrix(D)*np.matrix(V)
    >>> b
    matrix([[ 15.52275377+0.j,   9.37603361+0.j,   0.79257097+0.j],
            [  9.37603361+0.j,  21.12538282+0.j, -10.23535271+0.j],
            [  0.79257097+0.j, -10.23535271+0.j,  10.35186341+0.j]])
    >>> np.allclose(A, b)
    False
    

    but

    >>> f = np.matrix(V)*np.matrix(D)*np.matrix(linalg.inv(V))
    >>> f
    matrix([[  1.60000000e+01+0.j,  -9.00000000e+00+0.j,  -9.54791801e-15+0.j],
            [ -9.00000000e+00+0.j,   2.00000000e+01+0.j,  -1.10000000e+01+0.j],
            [ -1.55431223e-15+0.j,  -1.10000000e+01+0.j,   1.10000000e+01+0.j]])
    >>> np.allclose(A, f)
    True
    

    Aside: there are recipes for using np.dot to avoid all these conversions to matrix, like

    >>> dotm = lambda *args: reduce(np.dot, args)
    >>> dotm(V, D, inv(V))
    array([[  1.60000000e+01+0.j,  -9.00000000e+00+0.j,  -9.54791801e-15+0.j],
           [ -9.00000000e+00+0.j,   2.00000000e+01+0.j,  -1.10000000e+01+0.j],
           [ -1.55431223e-15+0.j,  -1.10000000e+01+0.j,   1.10000000e+01+0.j]])
    

    which I often find cleaner, but YMMV.

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

Sidebar

Related Questions

I have what is probably a very simple terminal related question. I'm running Ubuntu
I have a java threads related question. To take a very simple example, lets
I have a very simple CSS related question on iPad. I have a set
I have what I think is a very simple question related to the use
I have a very simple question, How can I get the POST values from
I have a very simple question. In FB tutorial https://developers.facebook.com/docs/mobile/ios/build/ it starts to login
I have a very simple question. Trying to figure out what is the simplest
I have a very simple question. I have a program that accepts an integer
I have a very simple question: Is it possible to change the price of
I have a very simple question for which I can't seem to find an

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.