Coder Social home page Coder Social logo

pysixtrack's Introduction

pysixtrack

Reference sixtrack tracking engine in pure python

pysixtrack's People

Contributors

aoeftiger avatar giadarol avatar hannes-bartosik avatar kparasch avatar martinschwinzerl avatar rdemaria avatar roman-martin avatar

Stargazers

 avatar

Watchers

 avatar  avatar

pysixtrack's Issues

p0c setter gives an error

Here an example:

In [7]: ps_part.p0c = 7000*1e9
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-7-6b6e194dff1d> in <module>()
----> 1 ps_part.p0c = 7000*1e9

~/Desktop/WeakStrongDevelopment/pysixtrack/pysixtrack/particles.py in p0c(self, p0c)
    282         new = self._f1(self.mass0, p0c)
    283         self._update_ref(*new)
--> 284         self._update_particles(*new)
    285 
    286     energy0 = property(lambda self: self._energy0)

~/Desktop/WeakStrongDevelopment/pysixtrack/pysixtrack/particles.py in _update_particles(self, mass0, beta0, gamma0, p0c, energy0)
    328             Energy = self.Energy
    329             Pc = self.Pc
--> 330             mratio = mass / mass0
    331             self._mratio = mratio
    332             self._chi = self._qratio / mratio

NameError: name 'mass' is not defined

Issue with Line constructor and defaults

In [2]: import pysixtrack

In [3]: pysixtrack.Line()
Out[3]: Line(elements=[])

In [4]: l1 = pysixtrack.Line()

In [5]: l1.elements.append('hello')

In [6]: l2 = pysixtrack.Line()

In [7]: l2
Out[7]: Line(elements=['hello'])

loader_mad: collimator, kicker, elseparator

For now, loader_mad knows about rcollimator but in general (at least in recent MAD-X versions) it should be collimator. Let's also add kicker and elseparator (at least they are present in the SIS100 lattice, could be useful to translate them to hkicker and vkicker resp. a zero drift!).

improved error handling

To be improved before merging:

  1. integrate error handling for PySixTrack already into loader_madx functionality -- by reading out errors via new cpymad functionality, e.g.:
>>> seq = madx.sequence.XYZ
>>> multipole = seq.expanded_elements[0]
>>> multipole.align_errors
AlignError(dx=-2.1754812916408347e-05, dy=-6.556356908596416e-06, 
ds=0.0, dphi=0.0, dtheta=0.0, dpsi=0.0, mrex=0.0, mrey=0.0, mredx=0.0, 
mredy=0.0, arex=0.0, arey=0.0, mscalx=0.0, mscaly=0.0)

>>> multipole.field_errors.dkn
[0.0,
 1.1472076071601915e-06,
 5.002980147857331e-06,
 0.013090083041168831,
 -0.19713806015162913,
 -73.91912412030126,
 -9.796705181638819,
 0.0,
(...)
 0.0]
  1. possibly remove current approach with error table read out (more cumbersome approach, bloated functionality in PySixTrack)

Originally posted by @aoeftiger in #28 (comment)

Multipole knl & ksl extensibility

For an instantiated elements.Multipole, it'd be really useful to assign higher-order magnet strengths even if they were not declared at instantiation.

e.g.

m = pysixtrack.elements.Multipole(knl=[0])
m.knl[1] = 1e-2 # currently raises an IndexError

This could be implemented based on abc.Sequence similarly to the cpymad.madx.ArrayAttribute approach -- which comes in really handy in cpymad.

This feature would be useful for manipulation of Multipoles in particular in view of adding error components to an existing lattice.

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.