Coder Social home page Coder Social logo

Comments (4)

GoogleCodeExporter avatar GoogleCodeExporter commented on July 25, 2024
Indeed, the values are exactly transposed (up to spurious numerical differences 
and the sign of one eigenvector (which is irrelevant)):

  >>> pa = numpy.array([[-0.67825811, -0.20538766, -0.70553656] ,[-0.51792553, -0.54748404,  0.657278  ], [-0.5212668,   0.81121954,  0.26495998]])
  >>> sv = numpy.array([[ 0.67825812  0.5179255   0.52126682] [-0.20538768 -0.54748404  0.81121951] [-0.70553654  0.657278    0.26495996]])
  >>> sv[0] *= - 1    # flip sign of first ev 
  >>> pa - sv.T       # difference
  array([[  9.99999994e-09,  -2.99999999e-08,   2.00000000e-08],
         [  2.00000000e-08,   0.00000000e+00,   2.99999999e-08],
         [ -2.00000000e-08,   0.00000000e+00,   2.00000000e-08]])  

The first eigenvector from principleAxes is pa[:,0]; this implementation 
followed the numpy philosophy of having the coordinates in individual columns 
so that one can pass them separately around.

Is this too confusing? 

Right now I am changing the docs to make this clear at least.

Many thanks for checking!

Original comment by orbeckst on 29 Jun 2010 at 9:55

  • Changed state: Started

from mdanalysis.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 25, 2024
I agree that this is confusing.

In r335 I added principalAxes() (correct spelling!) which does what you would 
expect:

  e1,e2,e3 = selection.principalAxes()

The old function principleAxes() with the old behaviour is kept but deprecated.

Original comment by orbeckst on 29 Jun 2010 at 10:20

  • Changed state: Fixed

from mdanalysis.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 25, 2024
I've compared the behaviour of the new principalAxes() and my results using svd 
using the python code in my original post and they are identical (to within a 
factor of -1)

Original comment by [email protected] on 29 Jun 2010 at 10:37

from mdanalysis.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 25, 2024
That's good – many thanks for checking.

Original comment by orbeckst on 29 Jun 2010 at 10:54

  • Changed state: Verified

from mdanalysis.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.