Skip to main content

Another Particle Accelerator Code

Project description

apace

Python Version PyPI CI Docs License: GPL v3

apace is yet another particle accelerator code designed for the optimization of beam optics. It is available as Python package and aims to provide a convenient and straightforward API to make use of Python's numerous scientific libraries.

Installing

Install and update using pip:

pip install -U apace

Requirements

  • Python 3.6 or higher (CPython or PyPy)
  • CFFI 1.0.0 or higher
  • NumPy/SciPy
  • Matplotlib

Quick Start

Import apace:

import apace as ap

Create a ring consisting out of 8 FODO cells:

d1 = ap.Drift('D1', length=0.55)
b1 = ap.Dipole('B1', length=1.5, angle=0.392701, e1=0.1963505, e2=0.1963505)
q1 = ap.Quadrupole('Q1', length=0.2, k1=1.2)
q2 = ap.Quadrupole('Q2', length=0.4, k1=-1.2)
fodo_cell = ap.Lattice('FODO', [q1, d1, b1, d1, q2, d1, b1, d1, q1])
fodo_ring = ap.Lattice('RING', [fodo_cell] * 8)

Calculate the Twiss parameters:

twiss = ap.Twiss(fodo_ring)

Plot horizontal and vertical beta functions using matplotlib:

import matplotlib.pyplot as plt
plt.plot(twiss.s, twiss.beta_x, twiss.s, twiss.beta_y)

Links

License

GNU General Public License v3.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

apace-0.0.5.tar.gz (51.0 kB view details)

Uploaded Source

File details

Details for the file apace-0.0.5.tar.gz.

File metadata

  • Download URL: apace-0.0.5.tar.gz
  • Upload date:
  • Size: 51.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.0 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.7.9

File hashes

Hashes for apace-0.0.5.tar.gz
Algorithm Hash digest
SHA256 a01dcb2a1332fa3ff17cd8371f32536b8b3d5832d93215abb8ce1907ea21337e
MD5 021cb4901d1452b60a98b966c84b2d5b
BLAKE2b-256 2d4bc18670442e55bf3c3dc1be6e8a0ff141e4c7428bb7da36eaf7ecf63c9d24

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page