some scripts generated automatically for transfer matrices