Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
K
kwant
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Michael Wimmer
kwant
Commits
0b702110
Commit
0b702110
authored
12 years ago
by
Christoph Groth
Browse files
Options
Downloads
Plain Diff
merge 0.2.4 into 0.3 devel
parents
c1027524
972ffd13
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
kwant/lattice.py
+5
-3
5 additions, 3 deletions
kwant/lattice.py
with
5 additions
and
3 deletions
kwant/lattice.py
+
5
−
3
View file @
0b702110
...
...
@@ -281,6 +281,7 @@ class TranslationalSymmetry(builder.Symmetry):
"""
def
__init__
(
self
,
*
periods
):
self
.
periods
=
ta
.
array
(
periods
)
self
.
_periods
=
self
.
periods
if
self
.
periods
.
ndim
!=
2
:
# TODO: remove the second part of the following message once
# everybody got used to it.
...
...
@@ -322,11 +323,11 @@ class TranslationalSymmetry(builder.Symmetry):
raise
KeyError
(
'
Group already processed, delete it from
'
'
site_group_data first.
'
)
inv
=
np
.
linalg
.
pinv
(
gr
.
prim_vecs
)
bravais_periods
=
[
np
.
dot
(
i
,
inv
)
for
i
in
self
.
periods
]
bravais_periods
=
[
np
.
dot
(
i
,
inv
)
for
i
in
self
.
_
periods
]
if
not
np
.
allclose
(
bravais_periods
,
np
.
round
(
bravais_periods
),
rtol
=
0
,
atol
=
1e-8
)
or
\
not
np
.
allclose
([
gr
.
vec
(
i
)
for
i
in
bravais_periods
],
self
.
periods
):
self
.
_
periods
):
msg
=
'
Site group {0} does not have commensurate periods with
'
+
\
'
symmetry {1}.
'
raise
ValueError
(
msg
.
format
(
gr
,
self
))
...
...
@@ -414,9 +415,10 @@ class TranslationalSymmetry(builder.Symmetry):
The resulting symmetry has all the period vectors opposite to the
original and an identical fundamental domain.
"""
result
=
TranslationalSymmetry
(
*
self
.
periods
)
result
=
TranslationalSymmetry
(
*
self
.
_
periods
)
result
.
site_group_data
=
self
.
site_group_data
result
.
is_reversed
=
not
self
.
is_reversed
result
.
periods
=
-
self
.
periods
return
result
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment