Commit bbcafaf7 authored by Joseph Weston's avatar Joseph Weston

Merge branch 'qsymm' into 'master'

add kwant.qsymm module for working with Qsymm

Closes #256

See merge request kwant/kwant!261
parents 438201d9 31686edc
Pipeline #15169 failed with stages
in 43 minutes and 7 seconds
......@@ -105,6 +105,7 @@ build-env:default:
before_script:
- source deactivate
- source activate kwant-latest
- pip install qsymm
- unset CFLAGS # https://github.com/conda-forge/toolchain-feedstock/issues/41
.bleeding-edge-env: &bleeding_edge_env
......@@ -112,13 +113,17 @@ build-env:default:
- source deactivate
- conda env update -f /kwant-latest.yml
- source activate kwant-latest
- pip install qsymm
.ubuntu-env: &ubuntu_env
image: gitlab.kwant-project.org:5005/kwant/kwant/ubuntu
before_script:
- pip3 install qsymm
.debian-env: &debian_env
image: gitlab.kwant-project.org:5005/kwant/kwant/debian
before_script:
- pip3 install qsymm
## Build Jobs
......
# Copyright 2011-2017 Kwant authors.
# Copyright 2011-2018 Kwant authors.
#
# This file is part of Kwant. It is subject to the license terms in the file
# LICENSE.rst found in the top-level directory of this distribution and at
......@@ -17,7 +17,8 @@ import importlib
# map from subpackage to sequence of dependency module names
subpackage_dependencies = {
'kwant/continuum': ['sympy']
'kwant/continuum': ['sympy'],
'kwant/tests/test_qsymm': ['qsymm', 'sympy'],
}
......
......@@ -6,6 +6,39 @@ See also the `full list of changes up to the most recent bugfix
release of the 1.4 series
<https://gitlab.kwant-project.org/kwant/kwant/compare/v1.4.0...latest-1.4>`_.
Integration with Qsymm package
------------------------------
Kwant now contains an integration with the Qsymm library for analysing
model symmetries. This functionality is available under ``kwant.qsymm``.
Here is an example for extracting the symmetry group of a graphene system::
import numpy as np
import kwant
import kwant.qsymm
s_0 = np.eye(2)
lat = kwant.lattice.honeycomb(norbs=[1, 1])
sym = kwant.TranslationalSymmetry(lat.vec((1, 0)), lat.vec((0, 1)))
graphene = kwant.Builder(sym)
graphene[[lat.a(0, 0), lat.b(0, 0)]] = 0
graphene[lat.neighbors()] = 1
symmetry_generators = kwant.qsymm.find_builder_symmetries(graphene)
# Let's find what the chiral symmetry looks like
def is_chiral(g):
return g.antisymmetry and not g.conjugate and np.allclose(g.R, s_0)
print(next(g for g in symmetry_generators if is_chiral(g)))
``kwant.qsymm`` also contains functionality for converting Qsymm models to Kwant Builders,
and vice versa, and for working with continuum Hamiltonians (such as would be used with
``kwant.continuum``)
Automatic Peierls phase calculation
-----------------------------------
When defining systems with orbital magnetic fields it is often cumbersome to
......
This diff is collapsed.
This diff is collapsed.
#!/usr/bin/env python3
# Copyright 2011-2017 Kwant authors.
# Copyright 2011-2018 Kwant authors.
#
# This file is part of Kwant. It is subject to the license terms in the file
# LICENSE.rst found in the top-level directory of this distribution and at
......@@ -586,6 +586,8 @@ def main():
# The oldest versions between: Debian stable, Ubuntu LTS
'plotting': 'matplotlib >= 1.5.1',
'continuum': 'sympy >= 0.7.6',
# qsymm is only packaged on PyPI
'qsymm': 'qsymm >= 1.1.2',
},
classifiers=[c.strip() for c in classifiers.split('\n')])
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment