README.md 4.11 KB
Newer Older
1
# semicon - k·p simulations made easy
Rafal Skolasinski's avatar
Rafal Skolasinski committed
2 3 4

Note: this is work in progress, comments and ideas are more than welcomed!

Rafal Skolasinski's avatar
Rafal Skolasinski committed
5
The goal of this package is to provide easy to use framwerok for performing k·p simulations.
Rafal Skolasinski's avatar
Rafal Skolasinski committed
6

Rafal Skolasinski's avatar
Rafal Skolasinski committed
7 8
This package is suppose to remove an overhead and a boiler plate that appears when doing the k·p simulations.
It is suppose to make things easier, therefore userfriendly interface is a priority.
Rafal Skolasinski's avatar
Rafal Skolasinski committed
9 10 11 12


# Models

Rafal Skolasinski's avatar
Rafal Skolasinski committed
13 14
Models are based on the k·p Kane Hamiltonian, symmetrized following Burt-Foreman approach.
Users should be able to choose which components (Zeeman, Dresselhaus, strain, ...) and which bands ('gamma_6c', 'gamma_8v', ...) shall be included.
Rafal Skolasinski's avatar
Rafal Skolasinski committed
15 16 17 18


# Parameters

Rafal Skolasinski's avatar
Rafal Skolasinski committed
19
Parameters bank should include most common semiconducting materials.
Rafal Skolasinski's avatar
Rafal Skolasinski committed
20
Helper methods should handle parameter renormalization based on included bands and way to avoid spurious solutions.
Rafal Skolasinski's avatar
Rafal Skolasinski committed
21 22 23 24


# Helper functions

Rafal Skolasinski's avatar
Rafal Skolasinski committed
25 26
Goal of this framework is to make k.p simulations easy.
However, building the actual Kwant system and peforming the simulation should be done by user and this library only provide helper tools that are specific to problems encountered in k.p simulations
Rafal Skolasinski's avatar
Rafal Skolasinski committed
27 28 29 30


# Requirements

Rafal Skolasinski's avatar
Rafal Skolasinski committed
31 32 33
* This package is suppose to work with latest stable release of ``Kwant``.
* This package depends on recently released ``SciPy 1.2`` for some of its optional functionality. It will work with earlier release but appropriate warning will be rendered.
* Because project is based on discretizer sympy is required, however, due to compatibility [issue](https://gitlab.kwant-project.org/kwant/kwant/issues/225) it must be in version lower than 1.2. For now on the recommended version is 1.1.1.
34 35


Rafal Skolasinski's avatar
Rafal Skolasinski committed
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
# Installation (from pip into conda environment)
The easiest way to install ``semicon`` is to create fresh conda environment

    conda env create --name semicon kwant=1.3.3 sympy=1.1.1

and install ``semicon`` using ``pip``

    conda activate semicon
    pip install semicon


to test your installation do

    python -c 'import semicon; semicon.test()'


Optionally, install Scipy 1.2 to benefit from ``rotation`` functionality.

    pip install scipy==1.2


# Building from sources

Rafal Skolasinski's avatar
Rafal Skolasinski committed
59 60 61 62 63
As this package is pure python standard python installation from sources with
```
python setup.py build
python setup.py install
```
Rafal Skolasinski's avatar
Rafal Skolasinski committed
64
should be working without problems.
Rafal Skolasinski's avatar
Rafal Skolasinski committed
65
The only non-trivial dependency, Kwant, that could cause problems if not installed beforehand can be either obtained via ``conda`` or any other installation means explained on its [homepage](https://kwant-project.org/).
Rafal Skolasinski's avatar
Rafal Skolasinski committed
66

Rafal Skolasinski's avatar
Rafal Skolasinski committed
67
Direct installation from git is also possible (and favoured as long as conda
Rafal Skolasinski's avatar
Rafal Skolasinski committed
68 69
package is not out there):
```
Rafal Skolasinski's avatar
Rafal Skolasinski committed
70 71 72 73 74 75
pip install git+https://gitlab.kwant-project.org/semicon/semicon.git
```

Note that due to active development master branch may not be stable.
To install version that has been already used in research project use
```
Rafal Skolasinski's avatar
Rafal Skolasinski committed
76
pip install git+https://gitlab.kwant-project.org/semicon/semicon.git@v0.2.0
Rafal Skolasinski's avatar
Rafal Skolasinski committed
77 78
```

Bas Nijholt's avatar
Bas Nijholt committed
79 80 81 82 83 84 85 86 87
# Development

We use [`pre-commit`](https://pre-commit.com) to keep a consistent code style, so ``pip install pre_commit`` and run
```bash
pre-commit install
```
to install the hooks.
These will then automatically run upon each commit.

88 89 90

# Tips about developing inside docker container

Rafal Skolasinski's avatar
Rafal Skolasinski committed
91
One can easily use a [rafalskolasinski/science](https://github.com/RafalSkolasinski/science-docker)
92
Docker container for a development of this project.
Rafal Skolasinski's avatar
Rafal Skolasinski committed
93
Assuming that ``semicon`` folder is ``~/work/semicon`` do:
94
```
Rafal Skolasinski's avatar
Rafal Skolasinski committed
95
docker pull rafalskolasinski/science:semicon
96
docker run -d -p 8888:8888 --name semicon \
97
    -v ~/work/semicon:/src -v ~/work/semicon/notebooks:/home/jovyan/work \
Rafal Skolasinski's avatar
Rafal Skolasinski committed
98
    rafalskolasinski/science:semicon
99 100
```

101
This will mount source code in ``/src`` and project notebooks in ``~/work``
102
inside the containier. It will also start ``jupyter notebook`` server running
Rafal Skolasinski's avatar
Rafal Skolasinski committed
103
at ``localhost:8888``. You will need to read jupyter's server token with
104
``docker logs semicon`` to access the server.
105 106 107 108 109 110 111 112

You can now use ``docker exec semicon build`` and ``docker exec semicon test``
to build the package or run the tests respectively.

You can enter bash inside the container by running
```
docker exec -it semicon bash
```
113 114 115 116 117

Nicely formatted output of tests (colors):
```
docker exec -it semicon test -v
```