W211/M25Shan
Yafei Yang and Chung-chieh Shan
Developing quantum programs requires not only running them on quantum hardware but also simulating them on classical hardware. Because the semantics of a quantum program can be defined in terms of complex state vectors, it can in principle be simulated using any implementation of probabilistic or weighted programming that supports complex or at least negative weights. In this study, we compile a high-level quantum programming language to one such implementation---the _factor graph grammar_ solver for probabilistic programming---and benchmark its simulation performance. We prove that our compiler preserves the denotational semantics of the source language. To bring this simulation performance into the ballpark of the popular Qiskit toolkit, we enhance the solver with an optimization that commutes the tensor operations einsum and expand.