Towards quantum memory based single photon gates