NYPD set up an inspection station at subway entrance using anti-terrorism tool a portable explosive detection device.
It gets around constitutional challenges, the searches are voluntary and supposedly random, but if you decline to be searched, the police can deny you entry to the subway.