Skip to main content

Quantum mechanics simulation library

Project description

QM_sim

Python library for simulation of quantum mechanical systems. The documentation is available on GitHub pages.

Build docs

Features

  • 1D, 2D, and 3D systems
  • Choice of finite difference scheme
  • Zero and periodic boundary conditions
  • Stationary and temporal solutions
  • Plots

Planned features

  • Transfer matrix for transmission ect.
  • Proper testing

Installation

pip install qm-sim

To be able to use the PyTorch backend for eigenvalue calculations, run the following command:

pip install qm-sim[torch]

This will install the cpu-version of the package. To run GPU calculations, install the version for your system at the PyTorch website instead.

Usage

Examples are provided in the examples/-folder. These are enumerated with increasing level of simulation complexity.

Contribution

To contribute, please open a pull request to the dev-branch on GitHub.

Linting

When opening a PR, a linting check is performed. To ensure your contribution passes the checks, you can run the following

$ pip install .[linting]
$ black src/qm_sim
$ isort src -m 3 --trailing-comma
$ pylint src --fail-under=7

Setup

The following is an example of how to set up VS Code for development, adapt to your IDE of choice.

TL;DR:

  • pip install -e . to install in an editable state

Requirements

  • VS Code
    • Python extension
  • Python 3.10 or above

Steps

  1. Clone the repo recursively and open the repo in VS Code. If not cloned recursively, initialize the submodules with git submodule update --init
  2. Press f1, and run Python: Create Environment. Select .venv
  3. Open a new terminal, which should automatically use the virtual environment. If not, run .venv\Scripts\activate on Windows, or source .venv/bin/activate on Unix
  4. In the same terminal, run pip install -e .[test] to install the current directory in an editable state, and the testing utility Pytest
  5. To run tests, press f1 and run Python: Configure Tests. Choose pytest. Run tests in the testing menu

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

qm-sim-0.1.2.tar.gz (28.2 kB view hashes)

Uploaded Source

Built Distribution

qm_sim-0.1.2-cp310-cp310-manylinux_2_35_x86_64.whl (26.7 kB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.35+ 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