Toward Privacy in Quantum Program Execution On Untrusted Quantum Cloud Computing Machines for Business-sensitive Quantum Needs

Tirthak Patel, Daniel Silver, Aditya Ranjan, Harshitta Gandhi, William Cutler, Devesh TiwariarXiv 2023 · DOI

TL;DR

This paper introduces SPYCE, the first method to obfuscate both the quantum program code and its output when run on untrusted cloud quantum computers. This is crucial for protecting sensitive business information, as SPYCE ensures that even if the cloud provider has access to the executed program, they cannot decipher the original algorithm or its results.

What Problem Does This Paper Address?

Quantum computing promises to revolutionize fields like optimization and machine learning, but its current accessibility is largely through cloud platforms. This presents a significant privacy challenge: organizations with sensitive, proprietary quantum algorithms (e.g., for defense or financial modeling) must entrust their code and results to cloud providers. Existing privacy solutions for quantum computing primarily focus on securing data in transit or protecting code from compilers, but they don't address the threat of the cloud provider itself snooping on the executed program's output. This paper tackles this gap by proposing a method to make quantum program outputs unintelligible to the cloud provider, while still allowing the user to recover the correct results.

Methods

SPYCE employs a two-pronged approach to obfuscation, executed entirely on the user's side before sending the program to the cloud:

  1. Output Obfuscation (X-Gate Injection): At the end of the quantum circuit, SPYCE injects X gates (quantum NOT gates) on a randomly selected subset of qubits. This effectively flips the output bits in a way that is dependent on a secret "key" (the specific permutation of X-gate injections). Without this key, the resulting output distribution is scrambled and uninterpretable. The number of possible permutations grows exponentially with the number of qubits, making brute-force guessing infeasible for realistic quantum algorithms.
  2. Structure Obfuscation (RX-Pair Injection and Synthesis): To prevent an adversary from inferring information by analyzing the circuit's structure (even if they can't read the output), SPYCE injects pairs of RX gates with random rotation angles throughout the circuit. These RX gates are designed to cancel each other out computationally, preserving the original program's logic. Crucially, SPYCE then divides the circuit into manageable two-qubit blocks and uses a novel synthesis procedure to rewrite these blocks into new, structurally different but mathematically equivalent circuits. This process effectively "hides" the injected RX gates and makes the overall circuit structure significantly different from the original, even if the adversary could inspect it.

Decoding is a simple, one-step process on the user's end, where the secret key is used to flip the output bits back to their original state.

Datasets

The paper does not introduce new datasets. Instead, it evaluates SPYCE on a variety of established quantum algorithms, including:

  • Quantum Adder Circuit (ADD)
  • Google's Quantum Advantage Algorithm (ADV)
  • Deep Quantum Neural Network (DNN)
  • Hidden Linear Function Circuit (HLF)
  • Quantum Multiplier Circuit (MULT)
  • Quantum Approximate Optimization Algorithm (QAOA)
  • Quantum Fourier Transform (QFT)
  • Quantum Boolean Satisfiability Algorithm (SAT)
  • Transverse Field Ising Model (TFIM)
  • Variational Quantum Eigensolver (VQE)
  • W-State Preparation/Assessment Circuit (WSTATE)
  • XY Quantum Heisenberg Model Circuit (XY)

These algorithms were tested across various qubit counts, ranging from 4 to 128 qubits.

Key Insights and Ideas

  • The "Blind" Cloud Provider: The core idea is to make the quantum cloud provider act like a "blind" operator – they can execute the program and return a result, but they cannot understand what they are executing or what the result means.
  • Complementary Obfuscation: SPYCE's strength lies in combining two distinct obfuscation techniques: X-gates for output scrambling and RX-gates with synthesis for structural obfuscation. Neither technique alone is sufficient for both goals.
  • Noisy Hardware Resilience: A key design consideration was ensuring that SPYCE's obfuscation process doesn't significantly increase the circuit's susceptibility to hardware noise, which is a major challenge in current NISQ (Noisy Intermediate-Scale Quantum) devices.
  • Scalability is Key: The paper emphasizes the need for scalable obfuscation, particularly for larger quantum circuits, which is addressed by the block-based synthesis approach.
  • Classical Decryption: The ability to decode the quantum output using classical computation and a secret key is a critical aspect of SPYCE's practicality.

Key Results

  • Output Obfuscation: SPYCE effectively scrambles the output probability distribution. The Total Variation Distance (TVD) between the uncorrected SPYCE output and the baseline output was high (close to 1), indicating significant obfuscation. Upon decoding, the TVD dropped to negligible levels (<0.05), showing successful recovery of the original output.
  • Structure Obfuscation: SPYCE achieves significant structural obfuscation, with NetLSD divergence metrics showing orders of magnitude greater difference compared to only using X-gate injections. This makes it difficult for an adversary to infer circuit functionality.
  • Minimal Impact on Solution Quality: Despite obfuscation, SPYCE-generated circuits maintained comparable solution quality to the original circuits, with minimal increase in output error, even on noisy quantum hardware.
  • Controlled Overhead: SPYCE ensures no increase in the number of CX gates (high-error operations) and a modest increase in one-qubit gates (lower-error operations). Compilation times increased by approximately 2x on average, which is considered negligible compared to cloud queue wait times.
  • Variational Algorithm Compatibility: A case study on QAOA demonstrated that SPYCE effectively obfuscates each iteration of a variational algorithm without negatively impacting optimization quality or convergence time.

Limitations and Future Work

  • No Theoretical Guarantees on Algorithm Hiding: While SPYCE obfuscates the circuit structure and output, the authors note that it does not make theoretical claims about privatizing or hiding the original quantum algorithm's logic itself. The obfuscation is primarily empirical.
  • Classical Obfuscation Techniques Not Directly Applicable: The paper highlights that classical code obfuscation techniques are not directly transferable to quantum computing due to fundamental differences in computation models (entanglement, superposition).
  • Future Work: The paper suggests that SPYCE is a foundational step. Future work could explore more advanced synthesis techniques for even greater structural obfuscation or investigate SPYCE's applicability to other quantum computing paradigms. The authors also mention that while they focused on specific basis gates, SPYCE is compatible with other gate sets.

Summary updated

BibTeX
@misc{patel2023toward,
  author = {Tirthak Patel and Daniel Silver and Aditya Ranjan and Harshitta Gandhi and William Cutler and Devesh Tiwari},
  title = {{Toward Privacy in Quantum Program Execution On Untrusted Quantum Cloud Computing Machines for Business-sensitive Quantum Needs}},
  year = {2023},
  eprint = {2307.16799},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2307.16799},
}
Figure