Skip to main content

Design of an LSTM Cell on a Quantum Hardware

A quantum circuit design translates LSTM memory gates into qubit-based operations for future quantum recurrent networks

Building Memory on Quantum Circuits: Toward a Quantum LSTM Cell

Time series learning has become one of the most important frontiers of modern artificial intelligence. From energy forecasting to signal processing and financial modelling, many real-world systems require models that can remember what happened before and use that memory to interpret what comes next. In classical deep learning, Long Short-Term Memory (LSTM) networks have become one of the most effective tools for this purpose, thanks to their ability to manage both short-term signals and long-range dependencies. Here, we explore a more radical question: can the internal logic of an LSTM cell be translated into a quantum circuit? Instead of treating quantum computing merely as an external accelerator or as part of a hybrid variational model, the approach directly reconstructs the inference mechanism of an LSTM cell using quantum gates. The result is a first design step toward a fully quantum recurrent neural architecture.

From Classical Memory to Quantum Logic

A classical LSTM cell is built around a precise internal structure. It receives the current input, the previous hidden state, and the previous cell state; then it uses input, forget, and output gates to decide which information must be retained, updated, or released. This mechanism is what allows LSTM networks to process temporal sequences more effectively than simpler recurrent models. The proposed design preserves this structure but translates each operation into a quantum equivalent. Inputs, hidden states, and cell states are encoded as qubit registers, while arithmetic operations and activation functions are implemented through quantum transformations. The quantum cell mirrors the classical LSTM flow while adding auxiliary qubits and computing procedures to respect the reversibility required by quantum computation.

Encoding Numbers Inside Qubits

A central part of the methodology concerns how numerical values are represented. The system adopts basis encoding, where classical binary values are mapped directly into qubits. A fixed-point notation is then used to represent integer and fractional parts, allowing the quantum circuit to process quantised versions of the values normally handled by an LSTM. This choice makes the model compatible with the limited number of qubits currently available, while still preserving the possibility of increasing precision as hardware improves. In the experimental validation, a compact encoding is used, but the same framework can scale to higher resolution by allocating more qubits to each numerical register.

Rebuilding the LSTM Operations

The core of the contribution lies in the construction of quantum versions of the operations inside the LSTM cell. Addition, multiplication, negation, absolute value, sigmoid, and hyperbolic tangent functions are all redesigned as reversible quantum circuits. The activation functions are implemented through lookup-table logic, translating classical nonlinear behaviour into gate-based quantum transformations. These building blocks are then assembled into a complete quantum LSTM cell, where the hidden and cell states evolve according to the same conceptual rules as in the classical model.

Testing the Quantum Cell

The proposed circuit is validated on the IBM Quantum simulator using a 24-qubit configuration. The goal is not to demonstrate practical quantum advantage on current noisy hardware, but to verify that the designed circuit correctly reproduces the expected LSTM inference behaviour. The simulated quantum outputs match the corresponding classical outputs for the tested input configurations. A second numerical simulation examines a sequence of quantum LSTM cells arranged over time, comparing their behaviour with a classical LSTM on a periodic signal. The results show that, as the number of qubits used for numerical precision increases, the quantum version approaches the behaviour of the classical model.

A Step Toward Quantum Recurrent Neural Networks

The most interesting aspect of this work is not only the specific implementation of a single cell, but the architectural vision it suggests. Quantum machine learning is often framed through hybrid models, where classical and quantum components alternate. Here, the direction is different: the internal mechanics of a recurrent neural unit are reconstructed directly in the quantum domain. This does not mean that full quantum LSTM networks are ready for immediate deployment. Current hardware limitations, qubit scarcity, noise, and the complexity of training remain major obstacles. Yet the design shows that the logic of memory, gating, and temporal state propagation can be expressed through quantum circuits. In this perspective, the quantum LSTM cell becomes a prototype of something broader: neural architectures where memory is no longer only a classical computational mechanism, but a structure that can eventually be embedded into quantum hardware.

Authors

A. Ceschini, A. Rosato, M. Panella
November 8, 2021

Recommended

Recommended

More articles to read
Renewable energy

A Review of the Enabling Methodologies for Knowledge Discovery from Smart Grids Data

A KDD-driven pipeline turns smart meter streams into multi-step load forecasts, benchmarking feature reduction and models.
Biomedical

Enhancing Autism Detection Through Gaze Analysis Using Eye Tracking Sensors and Data Attribution with Distillation in Deep Neural Networks

A deep learning model enhances early autism diagnosis by analyzing visual patterns with eye tracking.
Quantum computing

Quantum Generative Modeling via Straightforward State Preparation

A lightweight quantum generative model creates high-fidelity data samples with minimal parameters and efficient state preparation.
Quantum computing

Enhancing QAOA Ansatz via Multi-Parameterized Layer and Blockwise Optimization

A novel quantum-classical algorithm boosts QAOA performance with fewer layers, enabling real-world optimization on NISQ devices.
Renewable energy

A Deep Learning-based Approach for Battery Life Classification

A deep learning-based LSTM network accurately classifies battery health, optimizing energy storage and predictive maintenance.
Biomedical

An explainable fast deep neural network for emotion recognition

A fast, explainable deep neural network enhances emotion recognition by optimizing facial landmark analysis.
Renewable energy

Multi-label classification with imbalanced classes by fuzzy deep neural networks

A fuzzy deep neural network accurately classifies household appliances in real time using symbolic data and multi-label AI.
Quantum computing

Quantum enhanced knowledge distillation

Classical-to-quantum knowledge distillation boosts hybrid AI performance using efficient quantum circuits and reduced model sizes.
Quantum computing

A variational approach to quantum gated recurrent units

A faster and efficient Quantum Gated Recurrent Unit (QGRU) improves time series forecasting.
Aerospace

A Neural Network Symbolic Approach to Structural Health Monitoring in Aerospace Applications

A symbolic deep learning approach enhances structural health monitoring in aerospace achieving near-perfect damage classification.

Do you have a specific need?

Fill out the form and tell us about your project.
We'll propose the solution that best fits your context.
Unable to save your subscription. Please try again.
Thank you for submitting the form.

Do you have a specific need?

Fill out the form and tell us about your project. We'll propose the solution that best fits your context.
GRID+ Copyright © 2026. All Rights Reserved.
VAT No. 17387741006 | The capital has been paid up in full €10,000 | RM – 1715269
GRID+ Copyright © 2026. All Rights Reserved.
VAT No. 17387741006 | The capital has been paid up in full €10,000 | RM – 1715269
P. IVA 17387741006 · The capital has been paid up in full €10,000 | RM – 1715269