From a7520f38a74109108304703d51f8fcbdebf2e29c Mon Sep 17 00:00:00 2001 From: Johanna <johanna@zijderveld.de> Date: Fri, 12 Apr 2024 15:33:34 +0200 Subject: [PATCH] another tiny rename --- codes/params/matrixShaping.py | 6 +++--- codes/params/rparams.py | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/codes/params/matrixShaping.py b/codes/params/matrixShaping.py index 4dfec57..b681de8 100644 --- a/codes/params/matrixShaping.py +++ b/codes/params/matrixShaping.py @@ -1,7 +1,7 @@ import numpy as np -def hop_dict_to_flat(hop_dict): +def tb_to_flat(hop_dict): """ Convert a hermitian tight-binding dictionary to flat complex matrix. @@ -22,9 +22,9 @@ def hop_dict_to_flat(hop_dict): return sorted_vals[:N].flatten() -def flat_to_hop_dict(flat, shape, hop_dict_keys): +def flat_to_tb(flat, shape, hop_dict_keys): """ - Reverse operation to `hop_dict_to_flat` that takes a flat complex 1d array + Reverse operation to `tb_to_flat` that takes a flat complex 1d array and return the tight-binding dictionary. Parameters: diff --git a/codes/params/rparams.py b/codes/params/rparams.py index 74c5088..ffb770e 100644 --- a/codes/params/rparams.py +++ b/codes/params/rparams.py @@ -1,8 +1,8 @@ from codes.params.matrixShaping import ( complex_to_real, - hop_dict_to_flat, + tb_to_flat, real_to_complex, - flat_to_hop_dict, + flat_to_tb, ) @@ -20,7 +20,7 @@ def mf_to_rparams(mf_model): dict Real parameters. """ - return complex_to_real(hop_dict_to_flat(mf_model)) # placeholder for now + return complex_to_real(tb_to_flat(mf_model)) # placeholder for now def rparams_to_mf(rParams, key_list, size): @@ -41,4 +41,4 @@ def rparams_to_mf(rParams, key_list, size): """ flat_matrix = real_to_complex(rParams) - return flat_to_hop_dict(flat_matrix, (len(key_list), size, size), key_list) + return flat_to_tb(flat_matrix, (len(key_list), size, size), key_list) -- GitLab