The law of apostasy is not an Islamic law. It was inducted in the Islamic system in the later period, namely, during the Abbasid empire. In fact, the concept of apostasy is a Christian concept. After the fall of the Roman Empire in the seventh century, Christians accepted Islam on a mass level. At the time there was no system for education and training. Although these Christians converts accepted Islam by reciting the kalimah, but their mindset remained the same. So, they inducted the concept of apostasy in Islam, with an Arabic name, i.e. irtidad. The Arabic equivalent of apostasy is irtidad. The Quran refers to irtidad (apostasy). But the Quran doesn't command any legal punishment to those people who commit irtidad. In this regard there is a verse in the Quran.The translation of this verse is: "Whoever of you turns back from his faith and dies as a denier of the truth will have his deeds come to nothing in this world and the Hereafter, and he will be an inhabitant of the Fire, to abide therein forever." (2:217) In this Quranic verse, you can see that the Quran envisages natural death for one who commits irtidad, there is no mention of any kind of legal punishment for them. If you want to see more detail on this subject, please see my thirty-page article: "Irtidad ki Saza" in my book Hikmat-e-Islam.