Begin QQMA implementation