Forty kilotons on the deck? The fireball of the nuke of that size is 350 meters. A Nimitz-class carrier is about as long.

Nimitz-class carrier
It depends a bit then where on the deck the bomb exploded, but suppose it was in the center of the deck. If that happened no, the ship wouldn’t have sunk. It would have evaporated, sublimated. It would cease to be. There might be some small but still identifiable chunks of metal from the reactor and the keel that could be found on the ocean floor, that’s the best you can hope for.

An explosion 500 meters above the ship is a different story. The carrier would be a constructive loss, but the hull would likely remain afloat.
