setup tensor operator and matrix