Skip to main content

A fast general purpose monte carlo particle simulator (photons, electrons and positrons). Written in Cython, Python and C++.

Project description

license pyversion architecture os

MontyCarlo (v0.0.41-pre-alpha)

MontyCarlo is a pyhon framework for setting up simulations and/or developing applications whose basis is the simulation of radiation transport. It simulates the propagation and effects of ionizing radiation (photons, electrons and positrons with energies between 1keV and 1GeV) in matter of homogeneous density, filling CSG models.

As of yet, this is an unstable version. This is a thesis project and, as a student, I am still learning!

This work has a poster presentation in the 3rd European Congress of Medical Physics and has been presented in a workshop organized by the Faculty of Sciences of the University of Porto and the Ludwig Maximilian University of Munich.

Installation

It is highly recommended that you install MontyCarlo v0.0.41-pre-alpha on a conda virtual environment containing one of the following python versions, and nothing else: 3.7, 3.8 or 3.9. To do so, open an anaconda prompt and run the commands:

conda create --name py39 python=3.9
conda activate py39

The installation steps are simple:

pip install MontyCarlo
python -c "import MontyCarlo"

MyCo will detect that it is the first import and will proceed to download all the necessary databases:

  • EADL (*.txt)
  • EPDL (*.txt)
  • EEDL (*.txt)
  • Electron Elastic (*.npy)
  • Positron Elastic (*.npy)

A first run !

Once you've installed MontyCarlo, clone the following repository: https://github.com/RuiFilipeCampos/MyCo-EXAMPLE1

Inside this repository folder simply run:

python main.py

Have fun exploring high energy particle tracks in a 3d environment!

  • White tracks: Photons
  • Blue tracks: electrons
  • Red tracks: positrons

The innermost sphere contains water, the outer sphere contains air and the rest of space is filled with gold.

ex01

Be sure to zoom in on every detail!

ex02

Bugs

This is a very early version of a fairly large code. Bugs are guaranteed! Submitting an issue is a great way to contribute to the project at this stage!

Possible Future Work

  • Sources
  • Tallying
    • Energy Deposition (1d, 2d, 3d, 4d(spatial + temporal) )
    • Flux
    • Others
  • Variance reduction
  • Image Detectors
  • Extension to E < 1keV (e.g. for laser applications)
  • Extension to E > 1GeV
  • Implementation of other particles
    • Protons
    • Neutrons
    • etc...
  • Dedicated graphics engine (w/sphere tracing)
  • An auto-cad like GUI for CSG modeling
  • Geant4 like API
  • GPU accelaration
  • CPU multiprocessing/multithreading
  • Advanced data vizualization (w/ ParaView)
  • Distributed Cloud Computing
  • Dedicated python notebook (like Jupyter)

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

MontyCarlo-0.1a0.dev1-cp39-cp39-win_amd64.whl (16.6 MB view hashes)

Uploaded CPython 3.9 Windows x86-64

MontyCarlo-0.1a0.dev1-cp39-cp39-macosx_10_14_x86_64.whl (21.5 MB view hashes)

Uploaded CPython 3.9 macOS 10.14+ x86-64

MontyCarlo-0.1a0.dev1-cp38-cp38-win_amd64.whl (15.2 MB view hashes)

Uploaded CPython 3.8 Windows x86-64

MontyCarlo-0.1a0.dev1-cp38-cp38-macosx_10_14_x86_64.whl (21.4 MB view hashes)

Uploaded CPython 3.8 macOS 10.14+ x86-64

MontyCarlo-0.1a0.dev1-cp37-cp37m-win_amd64.whl (16.6 MB view hashes)

Uploaded CPython 3.7m Windows x86-64

MontyCarlo-0.1a0.dev1-cp37-cp37m-macosx_10_14_x86_64.whl (21.3 MB view hashes)

Uploaded CPython 3.7m macOS 10.14+ x86-64

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