@@ -0,0 +1,700 @@
+import numpy as np%0Aimport scipy.linalg as la%0A%0Afrom fsc.export import export%0Afrom fsc.hdf5_io import subscribe_hdf5, SimpleHDF5Mapping%0A%0A%0A@export%0A@subscribe_hdf5('tbmodels.model', check_on_load=False)%0Aclass KdotpModel(SimpleHDF5Mapping):%0A    HDF5_ATTRIBUTES = %5B'taylor_coefficients'%5D%0A%0A    def __init__(self, taylor_coefficients):%0A        self.taylor_coefficients = %7B%0A            tuple(key): np.array(mat, dtype=complex)%0A            for key, mat in taylor_coefficients.items()%0A        %7D%0A%0A    def hamilton(self, k):%0A        return sum(sum(kval**p for kval, p in zip(k, pow)) * mat for pow, mat in self.taylor_coefficients.items())%0A%0A    def eigenval(self, k):%0A        return la.eigvalsh(self.hamilton(k))%0A

Add prototype for k.p class.