Quantum Cognitive Internet of Things Framework for Energy Consumption Prediction and Optimization in Smart Home

Quantum Cognitive Internet of Things Framework for Energy Consumption Prediction and Optimization in Smart Home

C. Boulkamh* L. Derdouri A. Bourouis

Research Laboratory on Computer Science’s Complex System (ReLa(CS)2), University of Oum El Bouaghi, Oum El Bouaghi 04000, Algeria

Corresponding Author Email: 
boulkamh.chouaib@univ-oeb.dz
Page: 
1065-1078
|
DOI: 
https://doi.org/10.18280/jesa.580519
Received: 
2 April 2025
|
Revised: 
16 May 2025
|
Accepted: 
26 May 2025
|
Available online: 
31 May 2025
| Citation

© 2025 The authors. This article is published by IIETA and is licensed under the CC BY 4.0 license (http://creativecommons.org/licenses/by/4.0/).

OPEN ACCESS

Abstract: 

In recent years, the electricity consumption in residential sector has witnessed a significant increase due to the population growth on one hand and the widespread adoption of electrical appliances on the other hand. Hence, finding solutions to decrease electricity consumption has become a matter of great interest for researchers. To address this challenge, we propose a Quantum Cognitive IoT (QCIoT) Framework that integrates quantum deep learning with edge computing to optimize energy use in smart homes. Our key innovation is a hybrid Quantum Long Short-Term Memory (QLSTM) model, which enhances traditional LSTM networks by leveraging quantum circuits for improved time-series forecasting. Specifically, QLSTM employs parameterized quantum gates to process temporal dependencies more efficiently, enabling higher accuracy than classical approaches. We evaluate quantum-enhanced LSTMs (QLSTMs) against classical LSTM baselines on multivariate time-series forecasting. Experimental results demonstrate that QLSTMs significantly outperform classical counterparts, with the multivariate QLSTM (MQLSTM) achieving a 25.8% reduction in RMSE and improving explanatory power by 78.3%. While QLSTMs exhibit slightly slower convergence, they deliver superior generalization, evidenced by lower test loss and stable training dynamics. These advantages stem from quantum parallelism, entanglement and optimized state representation, which enable superior handling of noisy, high-dimensional smart home data. By integrating quantum-enhanced forecasting with edge-based IoT systems, our framework offers a scalable solution for real-time energy management in smart homes. This work bridges quantum computing and smart infrastructure, demonstrating practical benefits for sustainability and energy savings.

Keywords: 

Cognitive Internet of Things, deep learning, energy management systems, internet of things, quantum computing, quantum deep learning, smart home

1. Introduction

Household electricity consumption constitutes a significant portion of total energy usage across various countries. In Algeria, the residential sector was the largest consumer of electricity, accounting for 38% of the final electricity consumption in 2023 [1]. Similarly, in the European Union, households represented 25.8% of final energy consumption in 2022 [2]. thus, the adoption of solutions to minimize electric power consumption has attached significant research interest.

The rapid adoption of Internet of Things (IoT) technologies has revolutionized the concept of smart homes, enabling real-time monitoring and control of energy consumption through interconnected devices such as sensors, smart meters, and actuators [3].

Phung et al. [4] presented an IoT-based dependable control system for managing solar energy in microgrids. Advanced systems like the one proposed by Sampaio et al. [5] utilize autonomic management and context-awareness to dynamically optimize energy consumption, demonstrating the versatility and effectiveness of IoT in energy management. Furthermore, Dutta et al. [6] developed a system utilizing Wi-Fi smart plugs and MQTT protocol for real-time monitoring and control of electricity consumption in buildings. In the realm of smart homes, Salma et al. [7] combined IoT and blockchain technologies to create a secure framework for controlling light consumption in smart city buildings. Recently Saadawi et al. [8] implemented an IoT-based energy management system employing the Harmony Search Optimization Technique to optimize energy usage, Integrating renewable energy sources.

While these works have improved the efficiency of energy management systems, they face several limitations. Classical IoT-based solutions often struggle with scalability, latency, and the inability to adapt effectively in real-time to dynamic environments with heterogeneous data sources [9].

To address these challenges, Recurrent Neural Networks (RNNs) and Long Short-Term Memory (LSTM) networks have been applied to energy prediction tasks [10, 11]. Among these, encoder-decoder architectures have gained attention for their ability to capture long-range dependencies and are well-suited for sequence-to-sequence modeling in energy forecasting [12].

Classical machine/deep learning models, though powerful, require large volumes of training data, and their performance degrades significantly in the presence of noise and non-stationary patterns, which are common in energy consumption time series. These models also exhibit limited ability to capture long-term dependencies in complex sequences, often leading to suboptimal forecasting accuracy.

The integration of machine/deep learning with IoT has given rise to the Cognitive Internet of Things (CIoT) paradigm. CIoT frameworks have improved adaptability and decision-making in energy systems by incorporating intelligent algorithms. For example, Liu et al. [13] presented a green CIoT system that integrates energy harvesting with joint optimization strategies to balance spectrum sensing and energy harvesting tasks effectively, an AI-based load optimization model within CIoT networks was developed to enhance energy efficiency through intelligent algorithms. Similarly, Kalinga et al. [14] implemented a CIoT framework utilizing linear regression models to monitor and control energy consumption of various devices, achieving notable savings. Rahmani and Arefi [15] presented a self-organizing CIoT framework employing learning automata to adaptively manage transmission power, resulting in improved energy efficiency. However, these systems still struggle to generalize in data-scarce environments, and cannot efficiently explore complex solution spaces due to the inherent limitations of classical processors.

To overcome these barriers, quantum machine learning (QML) has emerged as a promising direction. QML models exploit the principles of quantum parallelism and entanglement, enabling richer data representations in high-dimensional Hilbert spaces [16]. Hybrid models such as the Quantum LSTM (QLSTM) integrate parameterized quantum circuits within classical LSTM layers, offering superior expressiveness and robustness to noise [17].

Recent advancements in quantum machine learning have shown promise in improving energy consumption forecasting. Sagingalieva et al. [18] developed hybrid quantum neural networks that significantly improved photovoltaic power forecasting accuracy. Nutakki et al. [19] proposed Quantum Support Vector Machines (QSVMs) to enhance load forecasting in Home Energy Management Systems (HEMS), demonstrating superior accuracy in handling complex consumption patterns. Similarly, hybrid quantum neural networks have been applied to photovoltaic power forecasting, achieving significant improvements in prediction accuracy, especially in data-scarce scenarios. In the realm of energy efficiency, Quantum Reinforcement Learning (QRL) has been explored for optimizing energy usage in various applications. These approaches leverage quantum algorithms to learn optimal policies for energy management tasks [20].

In this paper, we propose a novel Quantum Cognitive Internet of Things (QCIoT) framework for smart home energy forecasting, which integrates IoT data acquisition, deep learning, and quantum computing. Our main technical contributions are as follows:

(1) We design a Quantum LSTM Encoder-Decoder architecture that leverages quantum circuits to enhance sequence modeling,  improving the system's ability to learn long-term dependencies and generalize in noisy or low-data regimes.

(2) We demonstrate how quantum parallelism can significantly improve the computational efficiency of the forecasting model in dynamic smart home environments.

(3) Through extensive experiments on real-world energy consumption data, we show that our QCIoT framework outperforms classical LSTM and deep learning models in terms of accuracy, energy savings, and adaptability, especially under noisy and data-limited conditions.

2. Proposed Framework

Our proposed Quantum Cognitive Internet of Things (QCIoT) framework is designed to optimize energy consumption in smart homes by the integration of IoT, deep learning and quantum computing. As illustrated in Figure 1, this framework comprises three synergistic layers, each designed to address specific challenges in consumption forecasting and decision-making.

Figure 1. Architecture of the proposed quantum cognitive iot (QCIoT) framework

The architecture integrates IoT layer, quantum layer, and decision making layer to achieve efficient energy management. At the heart of this framework is the Quantum LSTM (QLSTM), a novel model that we define, train, test and deploy for energy prediction. Below, we describe the architecture and workflow of the framework, emphasizing the role of the QLSTM model.

2.1 IoT layer

 Efficient data collection and preprocessing are critical for IoT-based energy systems. Gubbi et al. [21] highlighted the importance of real-time monitoring and control in IoT networks.

The IoT Layer serves as the foundation of the framework, enabling real-time data collection from smart home devices such as sensors, smart meters, and smart appliances. These devices monitor energy consumption, environmental conditions (e.g., temperature, humidity), and user behavior. The collected data is transmitted to a central micro-controller for preprocessing, where it is cleaned, normalized, and prepared for transmission into the quantum layer.

2.2 Quantum layer

The Quantum Layer is the core of the framework, where the Quantum Encoder Decoder LSTM (QLSTM) model is defined, trained, and used for energy prediction. The QLSTM model combines the temporal modeling capabilities of classical LSTMs with the computational advantages of quantum computing, enabling more efficient and accurate energy optimization.

2.2.1 Model definition

The QLSTM model is a hybrid architecture that integrates quantum computing principles into a classical LSTM network. While the LSTM component captures temporal dependencies in the energy consumption data, the quantum component enhances the model's ability to perform optimization tasks. We use parametrized quantum circuit to accelerate the training and inference processes. The QLSTM model consists of:

Input Layer. Receives preprocessed data from the IoT Layer.

Quantum Gates. Performs quantum computations to accelerate optimization.

LSTM Cells. Captures temporal dependencies in the data.

Output Layer. Generates energy consumption predictions.

Recent work by Biamonte et al. [22] and Dunjko and Briegel [23] has demonstrated the potential of quantum computing for machine learning tasks. Building on these insights, we define the QLSTM model as a quantum-enhanced variant of the classical LSTM, with additional quantum gates and circuits integrated into the architecture.

2.2.2 Model deployment

The QLSTM model is deployed to predict energy consumption in real time. The model takes preprocessed data from the IoT Layer as input and generates energy usage forecasts, which are passed to the Decision-Making Layer for optimization.

2.3 Decision-Making Layer

The Decision-Making Layer is responsible for optimizing energy usage based on the predictions from the QLSTM model. Our framework uses a rule-based or heuristic approach to make decisions. For example:

- If the QLSTM model predicts a peak in energy demand, the system can reduce the usage of non-essential devices (e.g., delaying the operation of a dishwasher or washing machine).

- If the model predicts low energy demand, the system can prioritize the use of energy-intensive devices to take advantage of lower costs.

This simplified decision-making process is efficient and easy to implement, making it well-suited for real-time energy management in smart homes. The decisions are directly based on the QLSTM model's predictions, ensuring that the system responds dynamically to changes in energy demand.

2.4 Integration and workflow

The integration of the IoT, Quantum, and Decision-Making Layers enables the framework to operate as a cohesive system. The workflow can be summarized as follows:

(1) The IoT Layer collects real-time consumption data from smart home devices.

(2) The data is preprocessed and transmitted to the Quantum Layer.

(3) The QLSTM model predicts energy consumption patterns based on the input data.

(4) The Decision-Making Layer uses these predictions to optimize energy usage across smart home devices.

(5) The optimized energy usage schedule is implemented through the IoT Layer(actuators), controlling devices such as thermostats, lights, and smart appliances.

2.5 Advantages of the framework

The QCIoT framework offers several advantages over traditional energy management systems:

(1) Scalability: The use of quantum computing enables the framework to handle large-scale IoT systems efficiently.

(2) Real-time prediction: The QLSTM model provides accurate energy consumption forecasts in real time.

(3) Simplicity: The Decision-Making Layer uses a straightforward rule-based approach, making the system easy to implement and maintain.

(4) Energy efficiency: By optimizing energy usage, the framework reduces energy consumption and costs while maintaining user comfort.

2.6 Deployment and real-world applications

The proposed Quantum Cognitive IoT (QCIoT) framework is designed for seamless integration into existing smart home infrastructures. Below, we discuss its real-world applicability, deployment challenges, and potential solutions.

2.6.1 Application scenarios

Dynamic Load Management. During peak electricity pricing (e.g., 6–9 PM), the framework:

- IoT layer: Monitors real-time consumption via smart meters.

- Quantum layer: Forecasts demand spikes using QLSTM.

- Decision layer: Shifts high-load appliances (e.g., EV charging) to off-peak hours to reduce costs.

Fault Detection & Anomaly Alerts. Detects abnormal appliance behavior (e.g., fridge compressor failure).

- QLSTM identifies deviations from expected consumption patterns.

- Decision layer triggers maintenance alerts, preventing energy waste.

Renewable Energy Optimization. Homes with solar panels use the framework to:

- Align battery storage with solar generation forecasts.

- Reduce grid dependence.

2.6.2 Technical challenges and mitigation strategies

Table 1 shows Technical Challenges to deploy our proposed framework in real-world smart home environments.

Table 1. Technical challenges and solutions

Challenge

Solution

Heterogeneous device protocols

Edge middleware (e.g., Home Assistant) for protocol unification.

Hardware noise on real quantum devices (IBMQ, Rigetti)

Employ error mitigation techniques

User comfort vs. energy savings trade-offs

Multi-objective reinforcement learning (MORL) with personalized user preferences.

3. Methodology

This study proposes a Quantum Cognitive IoT Framework for optimizing residential energy consumption through intelligent forecasting and decision-making. The methodology integrates hybrid quantum-classical machine learning with IoT infrastructure, comprising five systematic key phases: (1) data acquisition and preprocessing, (2) hybrid Quantum Long Short-Term Memory (QLSTM) model design, (3) classical baseline implementation, (4) training and optimization, and (5) evaluation metrics used to demonstrate the effectiveness of our proposed model.

3.1 Data collection and preprocessing

3.1.1 Dataset

The UCI Household Power Consumption Dataset [24] was selected for its high-resolution recordings of energy usage (1-minute intervals) from a single household over four years (2006–2010). The dataset includes:

(1) Global_active_power: Total household power consumption (kW).

(2) Sub-metering: Granular measurements for appliances (e.g., kitchen, heating…).

(3) Voltage, Global_intensity, and reactive power measurements.

3.1.2 Preprocessing pipeline

Our preprocessing pipeline employed rigorous techniques to ensure data quality and model compatibility:

Data cleaning.  Gaps (marked as "?") were replaced with NaN, then addressed through temporal imputation. Recognizing the strong diurnal patterns in residential energy use, we implemented a day-lag filling approach.

Resampling and aggregation (daily granularity). To balance computational efficiency with temporal resolution, minute-level observations were aggregated to daily totals through summation. This transformation: Reduces high-frequency noise, maintains meaningful consumption patterns and enables longer forecast horizons.

Normalization and windowing. The processed dataset was enhanced through:

-Min-Max normalization to [-1, 1] range,

-Creation of Temporal Windowing (7-days input/output windows) for sequence prediction,

-Stratified temporal splitting (70% training, 15% validation, 15% test)

Feature Selection. Our study initially utilizes the Global_active_power variable from the UCI dataset, then we expanded our investigation to multivariate prediction, incorporating additional relevant features to capture more complex interdependencies in the energy consumption patterns.

3.2 Hybrid quantum-classical model design

In our work, we propose a hybrid quantum-classical sequence-to-sequence model designed to predict short-term power consumption based on past energy usage. The model is structured using an encoder-decoder architecture, with both modules leveraging a custom-built Quantum-enhanced Long Short-Term Memory cell (QLSTMCell). The design seamlessly integrates classical neural operations with parameterized quantum circuits (PQCs), allowing us to investigate potential benefits of quantum computation in sequential learning tasks.

3.2.1 Parameterized quantum circuits

Figure 2 show the parametrized quantum circuit used to implement our quantum neural network layer (encoder and decoder) for our QLSTM. The circuit is composed of 4 qubits, initialized to 0>, and is divided into three main stages:

Figure 2. Architecture of the parameterized quantum circuit

Quantum data encoding layer. We Use angle embedding to map classical input data $x \in \mathrm{R}^n$ to quantum state $|\psi(\mathrm{x})\rangle$ through Rx rotations. Each feature $\mathrm{x}_{\mathrm{i}}$ is mapped to a rotation angle $\theta_{\mathrm{i}}=\pi \mathrm{x}_{\mathrm{i}}$, see Eq. (1).

$|\psi(x)\rangle=\bigotimes_{i=1}^n R_{X\left(\theta_i\right)}|0\rangle^{\{\otimes n\}}, R_{X\left(\theta_i\right)}=e^{-i \theta X / 2}$                   (1)

Each RX($\theta_i$) rotates $|0\rangle$ around the X-axis by $\theta_i$, placing the qubit at ($\pi$/2,$\theta_i$) in spherical coordinates (latitude $\pi$/2, longitude $\theta_i$).

Variational Quantum Circuit (Ansatz). The trainable circuit consists of:

- Single-Qubit Rotations (RX-RY-RZ): Each qubit i in the circuit undergoes three rotations as shown in Eq. (2) and Eq. (3).

$U_i\left(\alpha_i, \beta_i, \gamma_i\right)=\bigotimes_{i=0}^{n-1} R_X\left(\alpha_i\right) R_Y\left(\beta_i\right) R_Z\left(\gamma_i\right)$                  (2)

where,

$R_{X(\alpha)}=e^{-i \alpha X / 2}, R_{y(\beta)}=e^{-i \beta Y / 2}, R_{z(\gamma)}=e^{-i \gamma Z / 2}$                    (3)

- Entanglement via CNOT: that link the qubits in a closed linear entangling pattern designed to maximize entanglement. Each CNOT gate “$\mathrm{CNOT}_{i,j}$’’ is a 2-qubit unitary operation with the form depicted in Eq. (4):

$U_{\text {ent }}=\prod_{i=0}^{n-1}$ CNOT $_{i,(i+1) \bmod n}$                     (4)

The full unitary for the variational part of our proposed circuit is presented in the Eq. (5).

$U_{\text {circuit }}=\binom{\left[\prod_{i=0}^{n-1} C N O T_{i,(i+1) \bmod n}\right]}{\cdot\left[\bigotimes_{i=0}^{n-1} R_Z\left(\gamma_i\right) R_Y\left(\beta_i\right) R_X\left(\alpha_i\right)\right]}$                     (5)

Each qubit is both a control and a target in the entanglement structure, allowing strong correlations.

Pauli-z measurements. The measurements produce classical output data, which can then be used in our quantum-classical hybrid model (make prediction). Eq. (6) shows the final state measured via Pauli-Z operators on m output qubits:

$y_t=W *\left\langle\psi\left(x_t\right)\right| Z^{\otimes m}\left|\psi\left(x_t\right)\right\rangle+b, \mathrm{Z}=\left(\begin{array}{cc}1 & 0 \\ 0 & -1\end{array}\right)$                  (6)

3.2.2 Quantum LSTM cell (QLSTMCell)

At the core of both the encoder and decoder is a modified LSTM cell where the traditional gates (forget, input, candidate/update, and output) are replaced by parameterized quantum circuits. Each gate follows the same hybrid pattern:

(1) First, classical input vectors (from the current input and previous hidden state) are projected through fully connected layers to match the dimension of the quantum circuit.

(2) The resulting vectors are summed and passed into the dedicated Parameterized/Variational Quantum Circuit (VQC).

(3) The quantum circuit outputs the expectation values of Pauli-Z measurements on all qubits, which are then processed by a classical linear layer.

(4) Finally, classical nonlinearities (sigmoid or tanh) are applied to produce gate activations.

Figure 3. Architecture of the QLSTMCell [25]

This structure allows each gate to learn nonlinear transformations in a hybrid quantum-classical parameter space. Figure 3 illustrates the QLSTM Cell’s architecture.

The dynamics of information propagation within a Quantum LSTM cell are governed by the following mathematical expressions:

- Forget Gate: $\mathrm{f}_{\mathrm{t}}=\sigma\left(\langle Z\rangle_{\mathrm{f}}\right)$

- Input Gate: $i_t=\sigma\left(\langle Z\rangle_I\right)$

- Candidate gate: $\tilde{c}_t=\tanh \left(\langle Z\rangle_c\right)$

- Cell State Update: $\mathrm{c}_{\mathrm{t}}=\mathrm{f}_{\mathrm{t}} . \mathrm{c}_{\mathrm{t}-1}+\mathrm{i}_{\mathrm{t}} . \tilde{\mathrm{c}}_{\mathrm{t}}$

- Output Gate: $\mathrm{o}_{\mathrm{t}}=\sigma\left(\langle\mathrm{Z}\rangle_{\mathrm{o}}\right)$

- Hidden State Update: $\mathrm{h}_{\mathrm{t}}=\mathrm{o}_{\mathrm{t}} .\tanh \left(\mathrm{c}_{\mathrm{t}}\right)$

3.2.3 Encoder module

The encoder receives a univariate or multivariate time series sequence of shape [batch_size, sequence_length, input_size]. It processes the input sequentially, time step by time step, using a single shared QLSTM cell. The encoder maintains and updates two internal states, the hidden state h(t) and the cell state c(t), initialized to zero. At the end of the input sequence, the final hidden and cell states are passed to the decoder as a summary of the input history. Figure 4 is a detailed schematic description that illustrate the architecture of our hybrid quantum encoder.

Figure 4. Architecture of the encoder

3.2.4 Decoder module

The decoder is designed to autoregressively generate a sequence of future values, given the encoded states. It reuses the QLSTM architecture. At each step, the decoder updates its hidden state using the quantum cell and generates the next prediction via a classical linear layer applied to the hidden state. This output becomes the input for the next time step. The decoder iterates for a fixed number of steps equal to the prediction horizon (7 days in our work), and the outputs are concatenated into a final prediction vector of shape [batch_size, sequence_length, input_size]. Figure 5 illustrates the architecture of our hybrid quantum decoder.

Figure 5. Architecture of the decoder

3.3 Comparative baseline

We compare our proposed QLSTM model with a classical LSTM model that use an identical architecture to the QLSTM model but with classical LSTM cells.

3.4 Model training and hyperparameters

To evaluate quantum enhancements of our proposed model, we compared it against a classical encoder-decoder LSTM. To ensure a fair Comparison between the classical LSTM and QLSTM we use the same training hyperparameters. This controlled comparison isolates the effects of quantum components.

3.4.1 Model architecture hyper parameters

Number of lstm layers. We use the same number of layers

(1 layer for the encoder and decoder).

Hidden Units per Layer. We use the same number of hidden units (64 hidden units for each model).

Input Sequence Length. We use the same sequence length (7 time steps for input/output sequence length).

3.4.2 Training hyperparameters

Optimization. Adam optimizer with learning rate Lr = 0.01.

Batch Size. We use the same batch size (batch size =32).

Number of Epochs. We use the same number of epochs (num_epochs =100 Epochs).

Loss Function. MSE Loss Function.

3.4.3 Regularization hyperparameters

Early Stopping. Employed early stopping with patience=5 to prevent overfitting.

3.4.4 Quantum-Specific hyperparameters

Number of Qubits. This is a new hyperparameter specific to the QLSTM. (n-qubits=4).

Quantum Circuit Depth. The depth of the quantum circuit can impact performance (n-Layers=1).

The choice of using 4 qubits and a single-layer depth in the parameterized quantum circuit was not arbitrary, but rather the result of a series of systematic experiments.

3.5 Evaluation metrics

Performance assessment incorporates multiple quantitative metrics as shown in Table 2.

Table 2. Evaluation metrics

Metric

Formula

RMSE

$R M S E=\sqrt{\frac{1}{N} \sum_{i=1}^N\left(y_i-\hat{y}_i\right)^2}$  

MSE

$M S E=\frac{1}{N} \sum_{i=1}^N\left(y_i-\hat{y}_i\right)^2$  

MAE

$M A E=\frac{1}{N} \sum_{i=1}^N\left|y_i-\hat{y}_i\right|$  

R-squared (R²)

$\boldsymbol{R}^2=\mathbf{1}-\left(\frac{\sum\left(y_i-\hat{y}_i\right)^2}{\sum\left(y_i-\bar{y}\right)^2}\right)$  

Convergence Speed

Epochmin=argmin (ValLossepoch)

Training Stability

$\sigma$train=STD (TrainLossepoch)

Validation Stability

$\sigma$val=STD (ValLossepoch)

Generalization Mean

$\mu$val=Mean (ValLossepoch)

Generalization Median

Medianval=Median (ValLossepoch)

3.6 Implementation

The experiments were conducted on the Anaconda3 which provides an environment for classical and quantum computing.  The classical LSTM and QLSTM models were implemented using PyTorch and PennyLane. Quantum simulations were performed using PennyLane’s “default.qubit”simulator (CPU).

4. Experimental Results

4.1 Performance comparison

This section presents a comparative evaluation of four models: Univariate LSTM (univLSTM), Univariate Quantum LSTM (univQLSTM), Multivariate LSTM (multivLSTM), and Multivariate Quantum LSTM (multivQLSTM) based on multiple standard regression metrics, including root mean square error (RMSE), mean absolute error (MAE), R² score, convergence speed, Stability and generalization ability. The analysis is supplemented with visualizations depicting the correspondence between true and predicted values, loss evolution during training and rmse variation per predicted sequence of 7 days. All experiments were conducted on the preprocessed UCI Household Power Consumption dataset under identical training conditions.

4.2 Key findings

The experimental results demonstrate a consistent improvement across all key metrics when replacing standard LSTM architectures with Quantum-enhanced LSTMs (QLSTMs).

4.2.1 Enhanced accuracy

As shown in Table 3, UnivQLSTM achieved a 25.4% reduction in RMSE and 19.0% reduction in MAE compared to UnivLSTM, while the MultivQLSTM achieved the best overall performance with the lowest RMSE (392.58) and MAE (295.03), representing 33.6% and 32.2% improvements over MultivLSTM, respectively. In the univariate setting, the QLSTM achieves a marginally lower test loss (MSE = 0.0291) compared to the traditional LSTM (MSE = 0.0296), suggesting a slight but measurable enhancement in modeling sequential dependencies. However, the most significant improvement emerges in the multivariate scenario, where the QLSTM (MSE = 0.0270) substantially outperforms its classical counterpart (MSE = 0.0362). This notable reduction in error, approximately 25.4% relative improvement, indicates that the QLSTM’s hybrid quantum-classical structure is particularly effective at capturing complex, high-dimensional temporal patterns. The comparative forecast results plots reinforce the quantitative results. A direct comparison of the true vs. predicted value plots clearly demonstrates the superior temporal modeling capabilities of quantum-enhanced LSTM models (Figure 6, Figure 7). The MultivQLSTM in particular achieves near-overlap with the actual series across the entire prediction window, closely following both gradual trends and sudden transitions. By contrast, classical LSTM models (Figure 8, Figure 9), especially in the multivariate case, tend to produce smoothed predictions that fail to capture volatility and result in large deviations during periods of abrupt change. These findings visually underscoring the value of quantum circuits in encoding complex temporal and inter-variable dependencies.

Figure 6. Energy consumption prediction (UnivQLSTM)

 Figure 7. Energy consumption prediction (MultivQLSTM)

Figure 8. Energy consumption prediction (UnivLSTM)

Figure 9. Energy consumption prediction (MultivLSTM)

Table 3. Predictive accuracy metrics

Metric

Univ

LSTM

Univ QLSTM

Multiv LSTM

Multiv QLSTM

RMSE

529.6008

395.0070

590.8674

392.5802

MAE

382.6524

309.8419

435.3688

295.0266

Final Test Loss (MSE)

0.0296

0.0291

0.0362

0.0270

To further evaluate temporal robustness and reliability, we analysed the RMSE variation per predicted sequence (using 7-day forecast blocks) for all models.

This analysis provides insight into not only average prediction accuracy but also the consistency of each model across time. The RMSE variation per predicted sequence analysis highlights a clear advantage for quantum-enhanced models. Both univariate and multivariate QLSTM (Figure 10, Figure 11) maintain lower and more stable RMSE values across all rolling 7-day forecast blocks, with markedly fewer and less severe error spikes. In contrast, classical LSTM models (Figure 12, Figure 13), particularly in the multivariate configuration, suffer from frequent and pronounced bursts of high error, reflecting instability and sensitivity to changing data patterns. These results reinforce the quantum models’ superiority not only in average predictive accuracy but also in ensuring reliable performance across all time periods, an essential attribute for robust temporal forecasting in practical applications.

Figure 10. Rmse variation per sequence (UnivQLSTM)

Figure 11. Rmse variation per sequence (MultivQLSTM)

Figure 12. Rmse variation per sequence (UnivLSTM)

Figure 13. Rmse variation per sequence (MultivLSTM)

4.2.2 Stronger predictive power

Table 4 illustrate comparison of predictive power metric of both models. The negative R² values for the UnivLSTM and MultivLSTM models (-0.1249, -0.4002) indicate complete failure to capture data trends (i.e., poor correlation between predicted and actual values). In contrast, the quantum-enhanced models achieve substantially better performance, with UnivQLSTM and MultivQLSTM yielding positive R² values of 0.3323 and 0.3819, respectively. This performance differential demonstrates that quantum LSTM architectures can effectively capture temporal dependencies and explain approximately 52-130% of the variance in the data, representing a significant improvement over their classical counterparts.

Table 4. predictive power metric

Metric

Univ

LSTM

Univ QLSTM

Multiv LSTM

Multiv QLSTM

-0.1249

0.3323

-0.4002

0.3819

4.2.3 Improved stability

As shown in Table 5 the quantum models demonstrated lower standard deviations in training and validation loss (e.g., UnivQLSTM: 0.0078 train loss STD, 0.0036 val loss STD), indicating more stable learning behavior.

Table 5. Stability of learning metrics

Metric

Univ LSTM

Univ QLSTM

Multiv LSTM

Multiv QLSTM

Train Loss STD

0.009487

0.007822

0.013700

0.008108

Val Loss STD

0.007407

0.003628

0.006635

0.006463

4.2.4 Convergence speed

As shown in Figure 14 and Figure 15 the classical MultivLSTM converged fastest (epoch 31), while the MultivQLSTM took longer (epoch 100), suggesting that quantum-inspired training may require more iterations for optimization (see Table 6).

Figure 14. Train vs validation loss (MultivLSTM)

Figure 15. Train vs validation loss (MultivQLSTM)

Table 6. Convergence speed metric

Metric

Univ LSTM

Univ QLSTM

Multiv LSTM

Multiv QLSTM

Convergence Speed

epoch49

epoch81

epoch 31

epoch 100

4.2.5 Generalization performance

As illustrated in Table 7 the quantum variants (UnivQLSTM, MultivQLSTM) exhibited superior generalization to unseen data, as shown by lower generalization median and mean values compared to classical LSTMs.

Table 7. Generalization performance metrics

Metric

Univ LSTM

Univ QLSTM

Multiv LSTM

Multiv QLSTM

Generalization Mean

0.038339

0.036590

0.043796

0.038157

Generalization Median

0.037027

0.035090

0.040966

0.036636

5. Discussion

The experimental results demonstrate the advantages of integrating quantum computing principles into deep learning models for time series forecasting of smart home energy consumption. This section explores the theoretical underpinnings of these performances, focusing on how quantum computing principles, such as superposition, entanglement, and quantum parallelism, enhance the capacity of LSTMs to capture complex temporal dependencies.

5.1 Quantum parallelism and enhanced feature representation

Classical LSTMs process sequential data through deterministic weight updates, which can struggle with high-dimensional or noisy time-series data due to limited representational capacity. In contrast, QLSTMs leverage quantum parallelism, enabling them to explore multiple states simultaneously during training. This property allows QLSTMs to:

(1) Efficiently encode temporal patterns in a high-dimensional Hilbert space, capturing nonlinear relationships that classical LSTMs may miss.

(2) Mitigate the curse of dimensionality in multivariate settings (as seen in MultivQLSTM’s superior RMSE of 392.58 vs. MultivLSTM’s 590.87), where quantum state superposition helps model interactions between variables more effectively.

The improved R² scores of QLSTMs (UnivQLSTM: 0.3323, MultivQLSTM: 0.3819 vs. negative values for classical LSTMs) suggest that quantum enhancements provide a better fit to the underlying data distribution, likely due to richer feature embeddings.

5.2 Entanglement and long-term dependency learning

A key challenge in classical LSTMs is their reliance on gating mechanisms (input, forget, and output gates) to manage long-term dependencies, which can fail when gradients vanish or explode. Quantum entanglement, a phenomenon where qubits remain correlated even when separated, offers a theoretical advantage:

(1) Entangled quantum gates in QLSTMs may strengthen memory retention across time steps, explaining their lower validation loss STD (UnivQLSTM: 0.0036 vs. UnivLSTM: 0.0074).

(2) This aligns with the smoother convergence observed in QLSTMs, where entanglement could stabilize gradient flow during backpropagation.

5.3 Quantum noise resistance and generalization

Classical LSTMs are sensitive to noise and overfitting, as evidenced by the higher train/val loss STD of MultivLSTM (0.0137/0.0066) compared to MultivQLSTM (0.0081/0.0065). Quantum models inherently exploit noise resilience through:

(1) Probabilistic state measurements, which may act as a natural regularizer, reducing overfitting.

(2) Quantum interference effects, which can cancel out spurious correlations in training data, leading to better generalization (lower generalization mean/median in QLSTMs; Table 7).

5.4 Convergence dynamics: Quality vs. speed trade-off

While QLSTMs required more epochs to converge (UnivQLSTM: epoch 81; MultivQLSTM: epoch 100) than classical LSTMs (MultivLSTM: epoch 31), their final performance was superior. Slower convergence often yields globally optimal solutions. Theoretically, this suggests:

(1) Quantum optimization explores the loss landscape more thoroughly, avoiding shallow local minima that trap classical models.

(2) The lower final test loss of MultivQLSTM (0.0270 vs. MultivLSTM’s 0.0362) supports this hypothesis.

5.5 Implications

These results highlight the potential of quantum deep learning for energy forecasting tasks. By leveraging the computational richness of quantum circuits, the QLSTM model is able to capture more nuanced temporal relationships, leading to more accurate and efficient predictions. This has practical implications for smart home energy management systems, enabling more adaptive and data-driven control strategies.

5.6 Limitations and future work

While the results are promising, they are constrained by the use of quantum simulation rather than real quantum hardware. Current quantum processors still face limitations such as decoherence (loss of quantum state stability) and gate errors (imperfect operations), which degrade QLSTM performance. These issues limit circuit depth and scalability. Possible solutions include error mitigation techniques (e.g., dynamical decoupling), hybrid quantum-classical architectures to reduce circuit complexity, and fault-tolerant designs leveraging quantum error correction. Advances in qubit coherence times and high-fidelity gates are critical for practical deployment. Future work will focus on:

5.6.1 Deployment on real quantum hardware

The present study relied on quantum simulations due to the current limitations of available quantum devices. Future work should involve testing the QLSTM architecture on real quantum hardware to evaluate the model’s resilience to noise, gate fidelity issues, and decoherence effects.

5.6.2 Ansatz optimization 

While the proposed hybrid quantum-classical LSTM model has demonstrated improved performance in terms of RMSE and other evaluation metrics, the current quantum circuit architecture may not represent the optimal configuration. Future research should explore alternative quantum circuit designs, including variations in the number of qubits, depth, and types of parameterized gates. Additionally, testing different circuit layer configurations could reveal architectures that are better suited for learning temporal patterns in energy consumption data. Such exploration would not only enhance the predictive capability of the model but also contribute to a deeper understanding of the interplay between quantum circuit complexity and learning performance in hybrid frameworks.

5.6.3 Extension to multihousehold datasets

Our experiments were conducted on a single-household dataset. A lo6gical next step is to scale the model to handle larger, multivariate datasets that reflect the diversity and heterogeneity of energy usage across different households and regions.

5.6.4 Exploration of alternative quantum circuits

Further investigation into the design and optimization of variational quantum circuits may reveal circuit architectures better suited to sequential data. Techniques such as quantum convolution and quantum attention mechanisms could be explored in future implementations.

5.6.5 Real-time integration and edge deployment

With the growing ubiquity of edge devices and IoT frameworks, integrating QLSTM models into real-time systems for dynamic load forecasting and energy management presents a valuable research trajectory. This will require careful consideration of computational efficiency and latency in edge environments.

5.6.6 Robustness and interpretability studies

As quantum models gain traction, ensuring their robustness to data anomalies and their interpretability from a decision-making standpoint becomes increasingly important. Investigating explainability methods tailored to hybrid quantum-classical models would be a valuable contribution.

6. Conclusion

Our study explored the integration of quantum deep learning into the time series forecasting of energy consumption in smart homes, with a particular focus on a hybrid quantum encoder-decoder LSTM model implemented using the PennyLane framework. By leveraging the UCI Individual Household Electric Power Consumption dataset, we conducted a comparative evaluation between the proposed quantum models and a conventional LSTM architectures.

The findings clearly demonstrate that the quantum-enhanced models not only deliver improved predictive accuracy, as evidenced by lower RMSE and MAE, but also exhibits more efficient training dynamics and stronger generalization to unseen data. Most notably, the QLSTM (UnivQLSTM and MultivQLSTM) produced forecasts that more closely aligned with the actual energy consumption patterns.

These results not only validate the potential of variational quantum circuits for modeling complex consumption dynamics but also highlight their inherent efficiency in optimization processes. The quantum deep learning model, even in its simulated form, offers a meaningful step forward in addressing the complexity and real-time demands of smart home energy management. By incorporating quantum computational elements, the model effectively captures non-linear temporal dependencies that may otherwise be underrepresented in traditional frameworks.

The limitations identified in this work, particularly regarding computational overhead, present clear pathways for future research. As quantum hardware continues to advance, the implementation of these models on physical quantum processors represents the most immediate research priority. Subsequent investigations should focus on developing hybrid architectures that maintain quantum advantages while improving computational tractability, as well as rigorous testing across diverse household energy profiles. The methodological framework developed here provides a foundation for exploring quantum machine learning applications in related temporal prediction domains.

This research contributes to the growing body of evidence supporting practical quantum advantage in machine learning applications. By successfully applying quantum-enhanced models to a concrete sustainability challenge, we have demonstrated that near-term quantum technologies can address real-world problems despite current hardware limitations.

Nomenclature

 

Mathematical Symbols

$y_t$  

Actual energy consumption at time step t (kW)

$\hat{y}_t$

Predicted energy consumption at time step t (kW)

N

Total number of predictions

$\begin{gathered}X_t \\ \otimes\end{gathered}$

Input power consumption at time t (kW)

denotes the tensor product (Kronecker product)

Abbreviations and Acronyms

IoT

Internet of Things

CIoT

Cognitive Internet of Things

QCIoT

Quantum Cognitive Internet of Things

LSTM

Long Short-Term Memory

QLSTM

Quantum Long Short-Term Memory

RMSE

Quantum Long Short-Term Memory

MAE

Mean Absolute Error

MSE

Mean Squared Error

Coefficient of Determination

QRL

Quantum Reinforcement Learning

NaN

Not a Number

MQTT

Message Queuing Telemetry Transport

UCI

University of California, Irvine (dataset source)

Quantum-Specific Terms

RY/RZ gates

 Quantum rotation operators (Y/Z-axis)

$\Phi$

trainable parameters for qubit i{$\alpha_i, \beta_i, \gamma_i$}

n_qubits

Number of qubits

Pauli-Z

Quantum observable for measurement

n_layers

Number of layers (depth of quantum circuit)

CNOT

Controlled-NOT entanglement gate

$\left|x_t\right\rangle$

Quantum-encoded input at time t

  References

[1] Enerdata. (2025). Algeria Energy Information. Available from: https://www.enerdata.net/estore/energy-market/algeria/.

[2] eurostat. (2025). Energy consumption in households. Availabless from: https://ec.europa.eu/eurostat/statistics-explained/index.php?title=Energy_consumption_in_households.

[3] Atzori, L., Iera, A., Morabito, G. (2010). The internet of things: A survey. Computer networks, 54(15): 2787-2805. https://doi.org/10.1016/j.comnet.2010.05.010

[4] Phung, M.D., De La Villefromoy, M., Ha, Q. (2017). Management of solar energy in microgrids using IoT-based dependable control. In 2017 20th International Conference on Electrical Machines and Systems (ICEMS), Sydney, NSW, Australia, pp. 1-6. https://doi.org/10.1109/ICEMS.2017.8056441

[5] Sampaio, H.V., Koch, F., Westphall, C.B., Boing, R.D.N., Cruz, R.N.S. (2021). Autonomic management of power consumption with IOT and fog computing. arXiv preprint arXiv:2105.03009. https://doi.org/10.48550/arXiv.2105.03009

[6] Dutta, P.K., El-kenawy, S.M., Ali, G., Dhoska, K. (2023). An Energy consumption monitoring and control system in buildings using internet of things. Babylonian Journal of Internet of Things, 2023: 38-47. https://doi.org/10.58496/BJIoT/2023/006

[7] Elgabri, S.R., Hassanein, M.S., El-Sawy, A.A., Taha, A. (2023). REAL-time energy consumption framework-based IOT sensors with blockchain. Journal of Southwest Jiaotong University, 58(4): 10. https://doi.org/10.35741/issn.0258-2724.58.4.46

[8] Saadawi, E.M., Abohamama, A.S., Alrahmawy, M.F. (2022). IoT-based optimal energy management in smart homes using harmony search optimization technique. https://doi.org/10.21203/rs.3.rs-1817009/v1

[9] Al-Fuqaha, A., Guizani, M., Mohammadi, M., Aledhari, M., Ayyash, M. (2015). Internet of things: A survey on enabling technologies, protocols, and applications. IEEE Communications Surveys & Tutorials, 17(4): 2347-2376. https://doi.org/10.1109/COMST.2015.2444095

[10] Hochreiter, S., Schmidhuber, J. (1997). Long short-term memory. Neural Computation, 9(8): 1735-1780. https://doi.org/10.1162/neco.1997.9.8.1735

[11] Gers, F.A., Schmidhuber, J., Cummins, F. (2000). Learning to forget: Continual prediction with LSTM. Neural Computation, 12(10): 2451-2471. https://doi.org/10.1162/089976600300015015

[12] Cho, K., Van Merriënboer, B., Gulcehre, C., Bahdanau, D., Bougares, F., Schwenk, H., Bengio, Y. (2014). Learning phrase representations using RNN encoder-decoder for statistical machine translation. arXiv preprint arXiv:1406.1078. https://doi.org/10.48550/arXiv.1406.1078

[13] Liu, X., Li, Y., Zhang, X., Lu, W., Xiong, M. (2020). Energy-efficient resource optimization in green Cognitive Internet of Things. Mobile Networks and Applications, 25: 2527-2535. https://doi.org/10.1007/s11036-020-01510-w

[14] Kalinga, E.A., Bazila, S., Ibwe, K., Abdalla, A.T. (2023). Cognitive Internet of Things-based framework for efficient consumption of electrical energy in public higher learning institutions. Journal of Electrical Systems and Information Technology, 10(1): 19. https://doi.org/10.1186/s43067-023-00079-0

[15] Rahmani, P., Arefi, M. (2024). Improvement of energy-efficient resources for Cognitive Internet of Things using learning automata. Peer-to-Peer Networking and Applications, 17(1): 297-320. https://doi.org/10.1007/s12083-023-01565-y

[16] Benedetti, M., Lloyd, E., Sack, S., Fiorentini, M. (2019). Parameterized quantum circuits as machine learning models. Quantum Science and Technology, 4(4): 043001. https://doi.org/10.1088/2058-9565/ab4eb5

[17] Schuld, M., Petruccione, F. (2021). Machine Learning with Quantum Computers, Berlin: Springer. pp. 163-169. https://doi.org/10.1007/978-3-030-83098-4

[18] Sagingalieva, A., Komornyik, S., Senokosov, A., Joshi, A., Sedykh, A., Mansell, C., Melnikov, A. (2023). Photovoltaic power forecasting using quantum machine learning. arXiv preprint arXiv:2312.16379. https://doi.org/10.48550/arXiv.2312.16379

[19] Nutakki, M., Koduru, S., Mandava, S. (2024). Quantum support vector machine for forecasting house energy consumption: a comparative study with deep learning models. Journal of Cloud Computing, 13(1): 105. https://doi.org/10.1186/s13677-024-00669-x

[20] Andrés, E., Cuéllar, M.P., Navarro, G. (2022). On the use of quantum reinforcement learning in energy-efficiency scenarios. Energies, 15(16): 6034. https://doi.org/10.3390/en15166034

[21] Gubbi, J., Buyya, R., Marusic, S., Palaniswami, M. (2013). Internet of Things (IoT): A vision, architectural elements, and future directions. Future Generation Computer Systems, 29(7): 1645-1660. https://doi.org/10.1016/j.future.2013.01.010

[22] Biamonte, J., Wittek, P., Pancotti, N., Rebentrost, P., Wiebe, N., Lloyd, S. (2017). Quantum machine learning. Nature, 549(7671): 195-202. https://doi.org/10.1038/nature23474

[23] Dunjko, V., Briegel, H.J. (2018). Machine learning & artificial intelligence in the quantum domain: A review of recent progress. Reports on Progress in Physics, 81(7): 074001. https://doi.org/10.1088/1361-6633/aab406

[24] Hebrail, G., Berard, A. (2012). Individual household electric power consumption data set. UCI Machine Learning Repository. Irvine, CA: University of California, School of Information and Computer.

[25] Chen, S.Y.C., Yoo, S., Fang, Y.L.L. (2022). Quantum long short-term memory. In ICASSP 2022-2022 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), Singapore, pp. 8622-8626. https://doi.org/10.1109/ICASSP43922.2022.9747369