Skip to content

Commit

Permalink
Fix complex hoppings with translational symmetry
Browse files Browse the repository at this point in the history
This commit fixes a bug that was showcased by the tests added in the
previous commit.

The issue was that, before this commit, translational symmetry was only
being considered in one direction. It was assumed that the opposite
direction was taken care of by adding the both conjugates of the
hoppings, however the values were added without actually doing a complex
conjugate.

The fix in this commit reverses the logic: translational symmetry is
considered in all unique directions, even opposite ones, but the only
half the hoppings are added (non-conjugate). This works out naturally
as the Hermicity of the Hamiltonian matrix will take care of the
conjugates later.
  • Loading branch information
dean0x7d committed Aug 29, 2020
1 parent e04c979 commit 71c686b
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 3 deletions.
3 changes: 3 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
* Fixed reversed order of `Lattice.reciprocal_vectors()`: it should be `a_n * b_n = 2pi` but it was
accidentally `a_n * b_{N-n} = 2pi`.

* Fixed incorrect Hamiltonian construction in cases where complex hoppings were used together
with translational symmetry.


## v0.9.4 | 2017-07-13

Expand Down
2 changes: 1 addition & 1 deletion cppcore/src/system/Symmetry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ std::vector<Translation> TranslationalSymmetry::translations(Foundation const& f

// check if the direction already exists
for (auto const& t : translations) {
if (t.direction == direction || t.direction == -direction) {
if (t.direction == direction) {
return;
}
}
Expand Down
4 changes: 3 additions & 1 deletion cppcore/src/system/System.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,9 @@ void populate_boundaries(System& system, Foundation const& foundation,
auto const neighbor_index = finalized_indices[neighbor];
if (neighbor_index < 0) { return; }

boundary.hopping_blocks.add(hopping.family_id, index, neighbor_index);
if (!hopping.is_conjugate) {
boundary.hopping_blocks.add(hopping.family_id, index, neighbor_index);
}
});
}

Expand Down
3 changes: 2 additions & 1 deletion docs/examples/lattice/trestle.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@ def trestle(d=0.2, t1=0.8 + 0.6j, t2=2):
)
lat.add_hoppings(
(0, 'A', 'B', t1),
(1, 'A', 'B', t1),
(1, 'A', 'B', t1.conjugate()),
(1, 'A', 'A', t2),
(1, 'B', 'B', t2)
)
return lat


lattice = trestle()
lattice.plot()
plt.show()
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 comments on commit 71c686b

Please sign in to comment.