Comments (6)
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.
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.
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 throughringpass
andlinepass
. Similar functions in python could check and if necessary convert the input coordinates, to enforce Fortran-alignment at the input toatpass
. This should be the only point where ordering matters. -
"physics" functions like
find_m44
could build their input toringpass
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.
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.
I'll make a trial right now, (branch matrixordering), and we'll see what it implies !
from at.
Fixed!
from at.
Related Issues (20)
- pyAT Distinguish between a sector bending magnet and a rectangular bending magnet HOT 2
- Reduce behaves differently in Matlab and python
- B0 added twice in exactkickrad HOT 2
- python: ringparam not well identified by lattice_load HOT 6
- bug is saving lattice HOT 4
- Bug: atwiggler HOT 13
- problem with display of correctly initialised VariableMultipole element HOT 1
- Change Legend Labels for plot_trajectory() function HOT 12
- fast_ring when having harmonic cavities in the lattice HOT 4
- AT_2_Elegant uses deprecated N_KICKS
- Factor 4 missing in Touschek scattering B2 expression HOT 5
- pyAT Error when calculating damping ring HOT 3
- Rotation of dipoles HOT 18
- matlab atlinopt4 check on 6d is disabled
- Severe bug introduced by #766 HOT 2
- Bug in Lattice.avlinopt HOT 7
- ring.get_lifetime fails if list of reference indexes has only one valid element HOT 1
- Compilation error when building from repository HOT 27
- VariableMultipole Usage HOT 7
- Inherited fields don't exist unless first explictly set HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from at.