Source code for the QCMagritte tutorial