Loop operators and the Kondo problem