Skip to content
Snippets Groups Projects
Commit a7520f38 authored by Johanna Zijderveld's avatar Johanna Zijderveld
Browse files

another tiny rename

parent e76da563
No related branches found
No related tags found
1 merge request!4Interface refactoring
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:
......
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)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment