Giter VIP home page Giter VIP logo

cminject's Introduction

CMInject: A framework for particle injection trajectory simulations

CMInject is a Python framework that can be used to define and run particle trajectory simulations for sample injection. It can run 1D, 2D, and 3D simulations based on the ODE describing Newton's equation of motion, given that all parts in a simulation setup allow this dimensionality.

It is meant to be used by different groups of people and match different needs, and so it is meant to be both:

  • a library that provides a generic way to define and run whole simulation setups, and
  • a collection of standard setups for immediate use.

The minimum required Python version to use it is 3.6.

CMInject is free software, see the licensing conditions for details.

Installation

This section contains a short quickstart-style installation guide. For detailed installation instructions and more, please have a look at the User Guide of the official documentation.

Prerequisites

On some systems, in particular for Python version 3.6, it may be necessary to install the HDF5 libraries before attempting to install CMInject.

Installing CMInject:

Installation of CMInject proceeds through standard Python procedures, i.e., in the code directory run

python setup.py install

A user (non-admin) installation can be performed through

python setup.py install --user

If you plan on developing CMInject you should use

python setup.py develop [--user]

Documentation

The documentation is available on readthedocs. It can also be generated from this repository by running

python setup.py build_sphinx

The generated HTML documentation can then be viewed by opening ./build/sphinx/html/index.html in a browser.

Tests

Tests are located in the tests/ subdirectory. They can be executed via the command pytest. You may need to install pytest first, as it is not an explicit dependency of CMInject:

pip install pytest

You should then be able to just run pytest from your console. Make sure you are in the top-level directory of the CMInject code folder when executing pytest, so that pytest can find the test files.

cminject's People

Contributors

cobalamin avatar jokuha avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

cminject's Issues

Optimizations

  • Some optimizations have already been done
  • Type safety needs to be improved (→ use @code_warntype)
  • Performance can still be improved (→ use @profilehtml and @benchmark)

Boundaries of the (b-type) deflector

  • The deflector has a special shape
  • This should be implemented as a boundary (contrary to just using the NaN values as boundary)
  • For this one needs the analytical description of the boundary of the deflector and then detect whether the molecule is inside this boundary
  • The detector probably is a (3D extended) rectangle minus two ellipses -> the particle hit the boundary if it is outside the rectangle or the ellipses
  • At some point other deflectors (e.g. a-type) should be supported as well

3D plotting

  • The --plot option doesn't seem to work properly in three dimensions
  • The plot should be a plot3d

Errors after run

CMInject installed without errors according to ./cminject/blob/develop/docs/src/userguide.md

when run "./cminject.sh -h" in "cminject" folder

ERROR: System image file failed consistency check: maybe opened the wrong version?
./cminject.sh: line 23: 7687 Segmentation fault: 11 julia -t "$CORES" -J"$SYSIMAGE" --sysimage-native-code yes --project="$SCRIPTPATH" "$SCRIPTPATH/cminject.jl" $@

Error on maxwel

See the error when run:
./cminject.sh
-n 1
-D 3
--x 0
--y 0
--z 0
--vx 0
--vy 0
--vz 1860
--m 1.412436264e-25
--J D[0,0]
--M D[0,0]
-t 0 2e-3
--dt 1e-6
-s test/pyrrole.molecule
-e test/example_field.h5
-o output/pyrrole.h5
--Boundaries S[0,0,0.065,0.0015,0.002]
S[0,0,0.30172,0.00075,0.002]
C[-0.00198571,0.00198571,-0.00398571,0.00198571,0.34572,0.49972,0.002]
-d 0.71247
--Solver RK4

Screenshot 2023-12-18 at 13 42 13

Beta release 2.0

  • Make a relase CMInject version 2.0 beta
  • Merge into master (and solve possible merge conflicts by overriding everything from master with everything from develop)

Sampling limitations

  • Quantum states need to limit each other (e.g. m ≤ j)
  • Possibly do this by repeating sampling of invalid samples until all are valid
  • Suggested argument parsing: --j:m:k [0-10]:[2:7]:[4:6] with j≥m≥k

Devices containing a field

  • Fields should be limitted to a containing device
  • With multiple devices, multiple (different) fields should be supported
  • It should be possible to use both Electric- and flow fields in the same simulation

Problems in saving results

The code seems to be working fine. But after running the script nothing is being saved in the files. The files stay empty afterwards too.

Super particle

  • A particle that supports both flow fields and Stark fields
  • With OOP this would be realized by using interfaces (do those exist in Julia?)

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.