Catalog PyPI
Back to packageRELEASE DETAILS

0.1.0.post1

PyPI

accinv

Python project for inverse modeling of accelerator lattices

acceleratorinverselatticelinear-optics-from-closed-orbitslocomodelingorbit-response-matrixorm
Published5 Dec 2022
Direct dependencies11
Transitive dependenciesNot calculated

README

Version 0.1.0.post1 documentation

Documentation Status PyPI versions PyPI pyversions

(acc)-1

accinv - Python project for inverse modeling of accelerator lattices


Note: This project is in proof-of-concept stage and therefore lacks more advanced features of some of the implemented methods.


In its current state, the package provides functionality for inverse modeling of linear optics via fitting of orbit response matrix (ORM) data, typically referred to as linear optics from closed orbits. It supports cpymad as a backend.

The main class is accinv.loco.Loco which requires one of the models from accinv.model, as well as a method for computing Jacobians, as an argument. Two methods for Jacobian computation are available.

  • AnalyticalJacobianMethod: This method uses an analytical formula to compute the Jacobian of the ORM with respect to quadrupole gradient errors and BPM and steerer gain errors. The data for the analytical formula is obtained from a single Twiss call for the current lattice configuration.
  • NumericalMJacobianMethod: This method uses a finite difference approximation scheme to compute the Jacobian of the ORM with respect to the quadrupole gradient errors. Thus, the number of ORMs that will be computed is proportional to the number of quadrupoles.

The inverse modeling process can be started by creating a Loco object and calling its run method:

from accinv.jacobian import AnalyticalJacobianMethod
from accinv.loco import Loco, OrmMeasurement
from accinv.model import Madx

model = Madx(path='path/to/script.madx')
loco = Loco(
    model_and_jacobian_method=(model, AnalyticalJacobianMethod),
    quadrupoles=[...],  # names of quadrupoles
    hbpms=[...],        # names of horizontal BPMs
    hsteerers=[...],    # names of horizontal steerers
    vbpms=[...],        # names of vertical BPMs
    vsteerers=[...],    # names of vertical steerers
    orm_measurement=OrmMeasurement(
      orm=np.load('path/to/measured_orm.npy'),
      uncertainty=np.load('path/to/orm_uncertainty.npy'),
  ),
)
result = loco.run()

Please consider the documentation of the Loco class for more details.

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Declared dependencies 11

Native requirements
11 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
click
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": "",
  "evaluation": "NOT_EVALUATED"
}
clickruntime
cpymad
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": "",
  "evaluation": "NOT_EVALUATED"
}
cpymadruntime
numpy
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": "",
  "evaluation": "NOT_EVALUATED"
}
numpyruntime
scipy
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": "",
  "evaluation": "NOT_EVALUATED"
}
scipyruntime
typing-extensions
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": "",
  "evaluation": "NOT_EVALUATED"
}
typing-extensions (>=4.0.0)runtime
flake8
Environment
{
  "extras": "",
  "marker": "extra == 'develop'",
  "requires_python": "",
  "evaluation": "NOT_EVALUATED"
}
flake8 ; extra == 'develop'runtime
mypy
Environment
{
  "extras": "",
  "marker": "extra == 'develop'",
  "requires_python": "",
  "evaluation": "NOT_EVALUATED"
}
mypy ; extra == 'develop'runtime
pre-commit
Environment
{
  "extras": "",
  "marker": "extra == 'develop'",
  "requires_python": "",
  "evaluation": "NOT_EVALUATED"
}
pre-commit ; extra == 'develop'runtime
reuse
Environment
{
  "extras": "",
  "marker": "extra == 'develop'",
  "requires_python": "",
  "evaluation": "NOT_EVALUATED"
}
reuse ; extra == 'develop'runtime
sphinx
Environment
{
  "extras": "",
  "marker": "extra == 'docs'",
  "requires_python": "",
  "evaluation": "NOT_EVALUATED"
}
sphinx ; extra == 'docs'runtime
pytest
Environment
{
  "extras": "",
  "marker": "extra == 'tests'",
  "requires_python": "",
  "evaluation": "NOT_EVALUATED"
}
pytest ; extra == 'tests'runtime

Distribution files

2 collected
accinv-0.1.0.post1-py3-none-any.whl

bdist_wheel · 26.31 KB · Python py3

Source file
accinv-0.1.0.post1.tar.gz

sdist · 24.4 KB · Python source

Source file

Repository

ACCESSIBLE
Dominik1123/accinv

Shared repository data · GitLab

License detected in repository
Not collected
Contributor identities
1 · complete API traversal
Contributors · showing 1 of 1 collected
ContributorContributions
Dominik1123130

Default-branch author identities; GitLab commit counts exclude merge commits.

Public sponsor counts have not been collected. These signals belong to the repository owner.

Downloads & popularity

1identities
Gauge · observed snapshots24 Oct 2026
10.50
2026-10-20: 1 · observed 2026-10-20T19:04:11.9100540Z2026-10-21: 1 · observed 2026-10-21T19:04:30.5206576Z2026-10-22: 1 · observed 2026-10-22T19:04:54.1266053Z2026-10-23: 1 · observed 2026-10-23T19:05:44.1326654Z2026-10-24: 1 · observed 2026-10-24T19:06:51.9543804Z
20 Oct24 Oct

gitlab · 5 observations shown. Missing days are unknown.

View observed values
Date / source periodValueObserved at
2026-10-2412026-10-24T19:06:51.9543804Z
2026-10-2312026-10-23T19:05:44.1326654Z
2026-10-2212026-10-22T19:04:54.1266053Z
2026-10-2112026-10-21T19:04:30.5206576Z
2026-10-2012026-10-20T19:04:11.9100540Z

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 17:59 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package_version:a9d1a6d208b1fa6de4aaacae756c5820c80fe2d150c5dade87293af0ca98e578

Other collected versions

View all collected versions →