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.
Contatti
-
E-Mail:
-
Telefono:
Link utili
Autori
A. Ceschini, A. Rosato, M. Panella
Novembre 8, 2021









