Fix reciprocal basis in lattices2d.c. New ewaldshift test gives results consistent with the legacy code.

Former-commit-id: e8c3ab317136614852749fd65a0c1326158eee5e
This commit is contained in:
Marek Nečada 2018-12-11 22:20:48 +00:00
parent 4695792772
commit 703d09a566
1 changed files with 2 additions and 2 deletions

View File

@ -801,8 +801,8 @@ int l2d_reciprocalBasis1(cart2_t b1, cart2_t b2, cart2_t *rb1, cart2_t *rb2) {
return QPMS_ERROR; // TODO more specific error code
} else {
rb1->x = b2.y / det;
rb1->y = -b1.y / det;
rb2->x = -b2.x / det;
rb1->y = -b2.x / det;
rb2->x = -b1.y / det;
rb2->y = b1.x / det;
return QPMS_SUCCESS;
}