Lewis Hamilton marked his Ferrari tenure with a sensational maiden pole during Sprint Qualifying at the Chinese Grand Prix.