The 46-year-old has teamed up with Boyle, the artistic director of the games, for the gala ceremony.
"Clarifying the report on the Olympics track I am composing... It's a track in Punjabi celebrating the Indian influence in the UK. It's a part of a medley in the Olympics opening ceremony, according to Danny Boyle's creative wishes!," Rahman wrote on facebook page.
It is the third collaboration between the Oscar-winning director and the Indian composer after the success of 'Slumdog Millionaire' and '127 Hours'.
The 2012 London Olympics will be held from July 27 to August 12.