Code Monkey home page Code Monkey logo

Comments (6)

willrogers avatar willrogers commented on August 21, 2024

From @lfarv on March 21, 2017 12:34

The integrators, ruling on a set on several particles rely on the fact that the 6 coordinates of one particle are consecutive in memory, and the 2nd particle follows the 1st one. With the default ordering of Matlab and Python, this corresponds to
6xN in Matlab and Nx6 in numpy. It should also accept 6xN numpy arrays with Fortran-ordering, but it is probably safer to use the default ordering.

On 21 Mar 2017, at 12:21, Will Rogers [email protected] wrote:

AT requires input of shape (6, x).
pyAT requires input of shape (x, 6).

The difference is confusing. I cannot remember if there is a technical reason why this is, or if it could be corrected to be the same.

Perhaps @lfarv https://github.com/lfarv can remember.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub https://github.com/willrogers/at/issues/27, or mute the thread https://github.com/notifications/unsubscribe-auth/ATHB6UJN_iPC3vqG1jkoHBfjZ1lqDc_Qks5rn7LIgaJpZM4MjqC7.

from at.

willrogers avatar willrogers commented on August 21, 2024

Thanks for explaining this. We have a couple of options here.

  • Switch to using Fortran-aligned arrays. I might prefer this, since the comparability of the output for AT and pyAT improves. The disadvantage is that the user needs to create Fortran-aligned arrays and they won't be expecting to.
  • Keep with C-aligned arrays. The opposite of the above.
  • Don't use atpass directly - use a Python function that checks the arguments and converts if necessary.

Usability and absolute speed may conflict here, but I am finding the differences in algorithms between AT and pyAT (due to the transpose) a little tedious.

from at.

lfarv avatar lfarv commented on August 21, 2024

to @willrogers:

I'm back to the array ordering problem: I successfully installed the last pyat version from Github, and I tried the "physics" functions. find_m44 returns a transfer matrix transposed compared to the usual way we see it in the books... I think we cannot leave it like that. So I go back to your proposals:

  • Don't use atpass directly. This is the case in Matlab, where it's accessed only through ringpass and linepass. Similar functions in python could check and if necessary convert the input coordinates, to enforce Fortran-alignment at the input to atpass. This should be the only point where ordering matters.

  • "physics" functions like find_m44 could build their input to ringpass in the "normal" shape (6 X Nparticles), but specifying explicitly Fortran-ordering, so that they don't loose efficiency. Then, no transposition is necessary and the algorithm should stay the same as in Matlab.

  • The user should use the standard orientation of matrices and not care about ordering, numpy takes care of it.

from at.

willrogers avatar willrogers commented on August 21, 2024

Yes, I agree with this proposal. I'll try to find some time in the next few days to look at doing this.

from at.

lfarv avatar lfarv commented on August 21, 2024

I'll make a trial right now, (branch matrixordering), and we'll see what it implies !

from at.

willrogers avatar willrogers commented on August 21, 2024

Fixed!

from at.

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.