Skip to main content

Differential Algebra Normal Forms for symplectic maps

Project description

DANF

Differential Algebra Normal Forms for symplectic maps, built on DACEyPy.

Computes amplitude-dependent tune shifts (detuning coefficients) of nonlinear symplectic maps via order-by-order normal form transformation in the complex eigenvector basis.

Installation

pip install danf

Quick Start

import numpy as np
from daceypy import DA
from danf import NormalForm
from danf.elements import rotation, thin_sext, compose

# Initialize DA engine: order 7, 2 variables (x, px)
DA.init(7, 2)

# Build a one-turn map: rotation (tune 0.31) + sextupole kick (k2L = 1.0)
one_turn = compose(rotation(0.31), thin_sext(1.0))

# Compute the normal form
nf = NormalForm(one_turn)
nf.compute()

print(f"Tune: {nf.tunes[0]:.6f}")
print(f"dnu/dJ: {nf.detuning['dnux_dJx']:.8f}")

API

NormalForm(da_map)

Main class. Takes a list of DA objects (the symplectic map components) and computes the nonlinear normal form.

  • nf.compute() - run the full computation
  • nf.tunes - linear tunes
  • nf.detuning - dict of amplitude-dependent tune shift coefficients

danf.elements

Convenience functions for building DA maps: rotation, thin_sext, thin_quad, thin_oct, drift, compose.

compute_detuning_1d(da_x, da_px, tune)

Low-level function for 1D normal form computation. Takes map components in normalized (Floquet) coordinates.

Cross-Validation

Results verified against COSY INFINITY v10.2 (DANF procedure) to 10 significant figures:

Quantity DANF (Python) COSY INFINITY
dnu/dJ +0.0121104226 +0.0121104226

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

danf-0.2.3.tar.gz (14.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

danf-0.2.3-py3-none-any.whl (11.9 kB view details)

Uploaded Python 3

File details

Details for the file danf-0.2.3.tar.gz.

File metadata

  • Download URL: danf-0.2.3.tar.gz
  • Upload date:
  • Size: 14.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for danf-0.2.3.tar.gz
Algorithm Hash digest
SHA256 a0946fb1cf3b8dc1eed6b90deb887539659e4f9c1c5279b990d1002adc46e028
MD5 b934ecabfaac195786f6bc46de03ffd6
BLAKE2b-256 0f566b651c5a14d9e7194b3cf268a13ebc785707edc5441fb50e9b88fabc1e02

See more details on using hashes here.

File details

Details for the file danf-0.2.3-py3-none-any.whl.

File metadata

  • Download URL: danf-0.2.3-py3-none-any.whl
  • Upload date:
  • Size: 11.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for danf-0.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 a410f5d0c47ead800e0ac2d3f503f7714dae12fbd15cc44fa287a2a8cc1a4fcb
MD5 d6341b4635cc2158fc073075b4851ee9
BLAKE2b-256 25e1935fb15a3d0d1d38d5b1a90c9eafba7e6bb0839190da672dbe7a91759cb6

See more details on using hashes here.

Supported by

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