diff --git a/codes/params/matrixShaping.py b/codes/params/matrixShaping.py index 4dfec57f143e21ad7bb971d8c1a8f1f970c43bda..b681de8617a2c044664cba7437f040ea4efa8225 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 74c50887209d1f5514cd966681c68dc586bfa857..ffb770e23e8fbd8cd7c1481fb6f588ee65001ea2 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)