Coder Social home page Coder Social logo

mcml-py's Introduction

MCML Python

Port of MCML (Monte Carlo Multi-Layered) to Python.

Requires Python 3.10 or above, numba, and tqdm.

Getting started

  1. Clone the repo (or download the zip file and extract).

  2. Create a virtual environment. Use Miniconda if you don't know what that means. After installing miniconda, open "Anaconda Powershell Prompt" and run

    conda create -y -n mcml python=3.10 numba tqdm
    

    This command creates a new virtual environment named mcml, and installs Python 3.10 along with numba and tqdm.

  3. Activate the mcml virtual environment:

    conda activate mcml
    
  4. cd into the working directory. Replace <path> with the directory containing the file main.py.

    cd <path>
    
  5. Run the MCML main program with a sample input file. The output will be written to text files specified in the input file. For the example input file, this will be sample.mco and sample2.mco.

    python main.py sample.mci
    

Accuracy

The program is checked against the original MCML program. Errors should be <1%.

Speed

Most of this program is JIT compiled with numba, hence the speed is reasonable. Simulating 1,000,000 photons in a 3 layer medium takes <20s on my laptop.

mcml-py's People

Contributors

kwsp avatar

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.