The thermal spin molecular logic gates modulated by light