Digital metamaterials shrink integrated photonic devices