Quantum Programming Languages for Specification and Optimization Fred Chong UC Santa Barbara Ken Brown, Ravi Chugh, Margaret Martonosi, John Reppy and Wim van Dam GaTech, Princeton, U Chicago, UCSB Fred Chong UC Santa Barbara Ken Brown, Ravi Chugh, Margaret Martonosi, John Reppy and Wim van Dam GaTech, Princeton, U Chicago, UCSB
IARPA Algorithms 2 AlgorithmLines of Code Boolean Formula479 Linear Systems1741 Binary Welded Tree608 Class Number226 Triangle Finding1231 Shortest Vector Problem539 Ground State Estimation554 Started with algorithms specified in English prose, some pseudocode
Correctness? Need a specification language for algorithms Check implementation against the specification Simulation for small problem sizes (~30 qubits) Type systems Model checking Symbolic execution Certified compilation passes General quantum properties No-cloning, entanglement, uncomputation Programmer assertions 3
Programmer Assertion Example b_eig_U = Eigenvalue(b,U) CascadeU(a,b,U) if not(b_eig_U) assert(Entangled(a,b)) 4
Success Probabilities / Error Bounds measure(a) assert(precision(a, 8)) /*precision of a is at least */ assert(error(a, 0.5)) /*probability of error in a < 0.5 */ Quantum operations are approximate (eg rotations) Need to track achieved precision Quantum programs often involve multiple trials Assume error probability is low enough for success in small number of trials Type system that tracks probabilities Static analysis when possible Symbolic execution when necessary 5
Scalable Compilation Need deep optimization given known inputs Constant propagation Function cloning Loop unrolling Need to optimize parallelism and communication Constraints such as SIMD control Need to optimize success probabilities and error correction 6
Language Design Ideas Embedded, high-level front-end language Lower-level backend language with industrial- strength, scalable analysis tools Type system for verifying quantum properties and calculating success probabilities / errors Longer term: Verification or direct code generation using Unitary Transforms ORAQL/NQCS7