SP-6: Intermediate Quantum Layer

Summary: Similar to the Quantum Head pattern, this pattern involves a pipeline of classical and quantum inference engines. In this approach, classical components are employed in both the initial and final stages of the inference pipeline, while the quantum component is used in the intermediate stage.

(a)

(b)

Figure 8. Two possible implementations of the Intermediate Quantum Layer pattern with a) low-dimensional and b) high-dimensional output.

Problem: The challenge lies in achieving and maximising quantum advantage for AI systems within the constraints of NISQ-era quantum computers, which include a limited number of qubits and restricted circuit depth, while handling high-dimensional input and/or output data.

Solution: The limitations of NISQ-era quantum hardware, particularly the restricted depth of quantum circuits, can be mitigated by embedding a quantum inference engine into a pipeline with classical inference engines, replacing several intermediate layers of the inference pipeline. In this approach, the classical components reduce diminsionality input data, performing initial stages of the feature extraction, and also processes data output from the quantum component interpreting results of the quantum state measurements. This solution can be viewed as a combination of the Quantum Head pattern and Quantum Feature Engineering where classical components participate both in quantum embedding for feature extraction and feature processing. This pattern is often utilised in applications addressing classification
problems. In a classifier, classical components reduce the dimensionality of the input data through feature extraction and interpret the output from the quantum component. Additionally, the quantum intermediate layer can serves as a blueprint for systems implementing quantum variational autoencoders.

Benefits:

  • Scalability for NISQ computers. Scalability for both input and output data is ensured by the classical components, which adjust the data to the available number of qubits.
  • Reduced number of parameters and space complexity. Replacing several layers of a classical neural network by quantum circuits reduces the number of parameters without compromising the expressibility of the model [S16; S28].

Drawbacks:

  • Portability and deployability. The Intermediate Quantum Layer pattern implies high-speed communication channels between classical and quantum components, and requires significant computational resources for classical components, which are not always available by default.

Known uses:

  • (Thakkar et al. 2024) used the intermediate quantum layer to improve financial forecasting.
  • (Sebastianelli et al. 2022) and (Sunkel et al. 2023) applied this pattern in a hybrid architecture for multiclass classification of remote sensing imagery and classification of computed tomography scans of lungs to detect COVID-19, respectively.
  • (Sakhnenko et al. 2022) used the intermediate quantum layer in the architecture of an autoencoder for anomaly detection in a dataset.