Python library for simulation of quantum mechanical systems. The documentation is available on GitHub pages.
- 1D, 2D, and 3D systems
- Choice of finite difference scheme
- Zero and periodic boundary conditions
- Stationary and temporal solutions
- Plots
- Transfer matrix for transmission ect.
- Proper testing
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.
Examples are provided in the examples/
-folder.
These are enumerated with increasing level of simulation complexity.
To contribute, please open a pull request to the dev
-branch on GitHub.
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
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
- Clone the repo recursively and open the repo in VS Code. If not cloned recursively, initialize the submodules with
git submodule update --init
- Press f1, and run
Python: Create Environment
. Select.venv
- Open a new terminal, which should automatically use the virtual environment. If not, run
.venv\Scripts\activate
on Windows, orsource .venv/bin/activate
on Unix - In the same terminal, run
pip install -e .[test]
to install the current directory in an editable state, and the testing utility Pytest - To run tests, press f1 and run
Python: Configure Tests
. Choosepytest
. Run tests in the testing menu