From 703d09a566fab0d93f52e352fa859f3f0db44106 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ne=C4=8Dada?= Date: Tue, 11 Dec 2018 22:20:48 +0000 Subject: [PATCH] Fix reciprocal basis in lattices2d.c. New ewaldshift test gives results consistent with the legacy code. Former-commit-id: e8c3ab317136614852749fd65a0c1326158eee5e --- qpms/lattices2d.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qpms/lattices2d.c b/qpms/lattices2d.c index d939471..370c99f 100644 --- a/qpms/lattices2d.c +++ b/qpms/lattices2d.c @@ -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; }