#! /usr/bin/env python
import numpy as np

import tbplas as tb


def line2vec(line: str) -> np.ndarray:
    return np.array([float(_) for _ in line.split()])


def main():
    with open("test.dat", "r") as inf:
        content = inf.readlines()
    coeff = line2vec(content[0]) + 1j *line2vec(content[1])
    r = line2vec(content[2])
    sk = tb.SK()
    for line in content[3:]:
        s = line.split()
        label_i = s[0]
        label_j = s[1]
        t_test = float(s[2]) + 1j * float(s[3])
        t_ref = sk.eval(r, label_i, label_j, *coeff)
        if abs(t_test - t_ref) > 1.0e-5:
            print(label_i, label_j, t_test - t_ref)


if __name__ == "__main__":
    main()
