From af9963b283913b92be3fa6c5c099dc7565ee69f0 Mon Sep 17 00:00:00 2001 From: Johanna <johanna@zijderveld.de> Date: Mon, 15 Apr 2024 14:23:58 +0200 Subject: [PATCH] change the tb_to_khamvector such that it works with all dimensions --- codes/tb/transforms.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codes/tb/transforms.py b/codes/tb/transforms.py index 683f503..3069681 100644 --- a/codes/tb/transforms.py +++ b/codes/tb/transforms.py @@ -25,7 +25,7 @@ def tb_to_khamvector(tb, nk, ndim): ks = np.linspace(-np.pi, np.pi, nk, endpoint=False) ks = np.concatenate((ks[nk // 2 :], ks[: nk // 2]), axis=0) # shift for ifft - kgrid = np.meshgrid(ks, ks, indexing="ij") + kgrid = np.meshgrid(*([ks] * ndim), indexing="ij") num_keys = len(list(tb.keys())) tb_array = np.array(list(tb.values())) -- GitLab