Table of Contents
Fetching ...

Qiskit-Torch-Module: Fast Prototyping of Quantum Neural Networks

Nico Meyer, Christian Ufrecht, Maniraman Periyasamy, Axel Plinge, Christopher Mutschler, Daniel D. Scherer, Andreas Maier

TL;DR

Focusing on the widely used Qiskit software environment, the qiskit-torch-module is developed, which improves runtime performance by two orders of magnitude over comparable libraries, while facilitating low-overhead integration with existing code-bases.

Abstract

Quantum computer simulation software is an integral tool for the research efforts in the quantum computing community. An important aspect is the efficiency of respective frameworks, especially for training variational quantum algorithms. Focusing on the widely used Qiskit software environment, we develop the qiskit-torch-module. It improves runtime performance by two orders of magnitude over comparable libraries, while facilitating low-overhead integration with existing codebases. Moreover, the framework provides advanced tools for integrating quantum neural networks with PyTorch. The pipeline is tailored for single-machine compute systems, which constitute a widely employed setup in day-to-day research efforts.

Qiskit-Torch-Module: Fast Prototyping of Quantum Neural Networks

TL;DR

Focusing on the widely used Qiskit software environment, the qiskit-torch-module is developed, which improves runtime performance by two orders of magnitude over comparable libraries, while facilitating low-overhead integration with existing code-bases.

Abstract

Quantum computer simulation software is an integral tool for the research efforts in the quantum computing community. An important aspect is the efficiency of respective frameworks, especially for training variational quantum algorithms. Focusing on the widely used Qiskit software environment, we develop the qiskit-torch-module. It improves runtime performance by two orders of magnitude over comparable libraries, while facilitating low-overhead integration with existing codebases. Moreover, the framework provides advanced tools for integrating quantum neural networks with PyTorch. The pipeline is tailored for single-machine compute systems, which constitute a widely employed setup in day-to-day research efforts.
Paper Structure (11 sections, 6 equations, 4 figures, 3 tables)

This paper contains 11 sections, 6 equations, 4 figures, 3 tables.

Figures (4)

  • Figure 1: Benchmarking results of the proposed qtm module, compared to the available implementations in qml. All experiments are averaged over $10$ independent runs with standard deviations depicted in pale colors. The runtimes refer to a batch size of $B=48$, with single-qubit Pauli-Z observables on all qubits, and a circuit depth of $d=3$. The number of trainable parameters scales linearly in the number of qubits. (a) Depicts the combined times for one pass of computing expectation values and gradients on a logarithmic scale; (b) depicts the times for the forward pass, i.e. computing expectation values, with a cut-off at $5$ seconds; (c) depicts the times for the backward pass, i.e. computing gradients, with a cut-off at $100$ seconds.
  • Figure 2: Benchmarking results of the proposed qtm module, compared to qml-rev. The values depict gradient computation times for a batch size of $B=48$, with single-qubit Pauli-Z observables on all 12 qubits. The number of trainable parameters scales linearly in the depth. All experiments are averaged over $10$ independent runs with standard deviations depicted in pale colors. The times for qml-ps are too long to appear in the plot, qml-spsa was intentionally omitted since it only calculates approximate gradients.
  • Figure 3: performance of the algorithm proposed in Meyer_2023a on CartPole-v1 for $100$ random initializations. The performance difference originates from individual learning rates that can be set in qtm. In contrast, qml does not provide this option. Apart from this, also the runtime for each update step is reduced as depicted in \ref{['tab:times_qrl']}.
  • Figure 4: Ablation study testing efficiency of qtm on different hardware configurations and operating systems. The plots denote the runtime improvement factor over qml-rev on the same hardware for forward (Fwd) and backward (Bwd) pass. To ensure comparability the batch size is always selected as $4$ times the number of physical CPU cores of the respective setups.