Carbon efficient quantum AI: an empirical study of ansätz design trade-offs in QNN and QLSTM models Authors: Sarvapriya Tripathi, Himanshu Upadhyay, Jayesh Soni Published: 2025 ABSTRACT AbstractThe rising environmental cost of deep learning has placed Green AI, which promotes focus on reducing the carbon footprint of AI, at the forefront of sustainable computing. In this study, we investigate Quantum Machine Learning (QML) as a novel and energy-efficient alternative by benchmarking two quantum models, the Quantum Neural Network (QNN) and Quantum Long Short-Term Memory (QLSTM), on the N-BaIoT anomaly detection dataset. Our first phase of experiments compares the QNN and QLSTM models using ten distinct quantum circuit designs (ansätze A1–A10). We systematically compare trade-offs between classification performance, model complexity, training time, and energy consumption. The results indicate that simpler QNN ansätze can achieve accuracy comparable to more complex ones while consuming significantly less energy and converging faster. In particular, QNN with ansatz A4 provided the optimal balance between performance and energy efficiency, consistently outperforming QLSTM across most metrics. A detailed energy breakdown confirmed GPU usage as the dominant source of power consumption, underscoring the importance of circuit-efficient quantum design. To contextualize QML’s viability, we conducted a second phase of experiments comparing quantum models with three benchmark classical machine learning models: Artificial Neural Network (ANN), Long Short-Term Memory (LSTM), and CatBoost. We find that the classical models demonstrated faster training times and lower energy consumption, highlighting and contrasting the maturity of algorithmic development that classical ML algorithms have already seen. Finally, we examined the energy implications of developing quantum models on actual quantum hardware. This third phase of experiments compared training on IBM Qiskit’s emulation environment (running on GPU servers) versus execution on real IBM Quantum hardware. Highlighting the significant differences in execution time and energy footprint, extrapolated results indicate that quantum hardware still incurs higher energy costs. This suggests that further hardware-aware ansätz optimization and improvements in quantum infrastructure are essential to realizing carbon-efficient QML at scale.Keywords: Ansätz, Energy-efficient AI, Quantum machine learning, SustainabilitySubject terms: Environmental impact, Computational science, Information technology, Software Introduction Quantum computing (QC) has rapidly evolved as a computational paradigm that offers theoretical advantages over classical computing, particularly in terms of complexity handling1,2. Unlike classical systems, quantum computers leverage principles such as superposition and entanglement to perform operations on high-dimensional data spaces with exponential scalability. There has, subsequently, been the emergence of Quantum Machine Learning (QML), which combines quantum computation with machine learning algorithms to enhance performance on data-intensive tasks3,4. Among QML approaches, variational quantum models such as Quantum Neural Network (QNN) and Quantum Long Short-Term Memory (QLSTM) network have gained prominence due to their adaptability and suitability for current noisy intermediate-scale quantum (NISQ) devices5,6. These models rely on Parameterized Quantum Circuits (PQCs), or ansätze, whose learning capacity and optimization behavior are directly defined by their topology including circuit depth and entanglements. As quantum computing progresses toward practical deployment, integrating Green AI principles becomes critical to ensure a sustainable energy footprint7–9. Most of the current Quantum technology presents very high energy requirements, especially the superconducting systems that require extreme cooling. This contributes significantly to the environmental footprint for quantum computing10–12. Green AI in machine learning emphasizes the need for energy-efficient hardware innovations13,14. In addition to energy concerns inherent to quantum hardware, a significant portion of QML research and experimentation today occurs within classical emulation environments using CPUs and GPUs. These simulations, while necessary due to the limited accessibility of quantum devices, are computationally intensive and can lead to substantial energy consumption15. Therefore, incorporating Green AI principles into the algorithmic design in QML is crucial along with algorithmic improvements to reduce the quantum system’s runtime and energy footprint. This will include optimizing ansätze designs and reducing parameter counts to lower the resource burden during model development in a simulation environment. On the applied front, there is a growing interest in using QML to real-world domains such as cybersecurity16–19. Attacks from Botnets such as Mirai and BASHLITE pose serious security threats20,21. The N-BaIoT dataset, which comprises of real network traffic from compromised IoT devices, serves as a widely accepted benchmark for such intrusion detection tasks22. QML approaches, including QNNs and QLSTM networks, may offer novel advantages in accurate identification of botnet traffic. Quantum Artificial Intelligence (QAI) offers transformative potential over classical AI by leveraging quantum phenomena such as superposition, entanglement, and quantum interference to achieve computational and representational advantages in real-world applications23. Recent studies have demonstrated that QAI models can outperform classical algorithms in complex domains including quantum sensing, computer vision, and object identification. For instance, Quantum Reinforcement Learning (QRL) has been shown to achieve high-accuracy state preparation in quantum many-body systems, reaching the Heisenberg limit even in noisy environments, surpassing the limitations of adiabatic methods24. Similarly, quantum-enhanced generative models utilizing programmable quantum circuits have exhibited superior reconstruction and generalization capabilities compared to classical deep learning frameworks, particularly in tasks such as image inpainting and colorization. In applied imaging problems, hybrid QAI approaches have achieved up to a 10% improvement in identification accuracy over classical machine learning methods, demonstrating the feasibility of quantum advantage25. These findings collectively suggest that QAI may provide efficiency gains and faster convergence to position it as a promising technology for intelligent and sustainable computational systems. In this work, we unite the perspectives of QML algorithms, ansätz designs, and energy-efficient AI in the context of IoT botnet detection. We implement QNN and QLSTM models for classifying attacks in the N-BaIoT dataset while exploring ten different ansätz circuit architectures ranging from very simple to highly complex. We monitor each model’s performance and measure the energy and carbon emissions of the training process using CodeCarbon, which is a tool to quantify CO2 emissions from computing resources26. By analyzing accuracy, stability, training time, and carbon footprint, we provide a holistic evaluation of quantum-powered models on a real cybersecurity task. Research motivation The growing environmental footprint of Artificial Intelligence has prompted a shift in research priorities, bringing Green AI into focus as a critical need. The Green AI advocates for energy-aware model development by challenging the trend of increasingly large models that offer marginal performance gains at disproportionate energy costs. With some large-scale models consuming megawatt-hours of electricity, the carbon implications of AI are not hypothetical anymore. As the adoption of AI expands, so does its contribution to climate change thus making energy efficiency a scientific and ethical imperative. While the environmental footprint of quantum computing hardware has begun to attract scholarly attention, with studies exploring energy consumption, cooling requirements, and lifecycle emissions of various quantum computing platforms, there remains a significant research gap in understanding how quantum algorithm design itself can contribute to sustainability. Existing work has predominantly focused on the physical infrastructure and system-level efficiencies, overlooking the role that algorithmic strategies might play in reducing computational burden, training time, and energy expenditure. This presents an untapped opportunity to develop algorithm-aware Green AI methodologies within QML, where circuit architecture, depth, and parameterization can be optimized not only for accuracy but also for environmental efficiency. By systematically investigating how different ansätze influence both performance and energy usage, researchers can begin to formulate principles for carbon-aware quantum algorithm design, thereby aligning QML advancements with broader goals of sustainable computation. This paper seeks to address this gap by empirically profiling the energy consumption and carbon emissions of QML models, contributing critical insights into their potential role in sustainable AI development. Our study focuses on a representative and high-impact use case in cybersecurity, that of botnet detection. We use N-BaIoT, an open-source botnet traffic reference dataset, and systematically examine how the design of quantum circuits (ansätze), the choice of model architecture (QNN vs. QLSTM), and training efficiency affect sustainability metrics. This dual emphasis on accuracy and environmental cost is central to the principles of Green AI. By treating energy and carbon efficiency as first-class metrics, we aim to guide future QML research toward Pareto-optimal configurations that balance sustainability with functional effectiveness. Key contribution This paper makes the following contributions : Integration of QML and Green AI: We introduce a novel study combining sustainability metrics with quantum machine learning. While implementing and comparing both QNN and QLSTM architectures for IoT intrusion detection, we investigate not only the prediction accuracy but also the energy and carbon costs during the training process. Integration of QML and Green AI: We introduce a novel study combining sustainability metrics with quantum machine learning. While implementing and comparing both QNN and QLSTM architectures for IoT intrusion detection, we investigate not only the prediction accuracy but also the energy and carbon costs during the training process. Extensive Ansätz Analysis: We evaluated 10 different parameterized quantum circuit designs for each of the two models. These ansätze follow different hardware efficient templates involving layered rotations with various entanglements. This systematic investigation clarifies how circuit depth and different types of gates affect both classification performance as well as energy consumption. Extensive Ansätz Analysis: We evaluated 10 different parameterized quantum circuit designs for each of the two models. These ansätze follow different hardware efficient templates involving layered rotations with various entanglements. This systematic investigation clarifies how circuit depth and different types of gates affect both classification performance as well as energy consumption. Energy and Emissions Measurement: Using the CodeCarbon toolkit we measure the power drawn by CPU, GPU, and RAM during the training and calculate total energy (kWh) and CO2 equivalent emissions (Kg CO2e). We adopt the rigorous protocol as that of Green AI work which includes consistent hardware, 15-s sampling of GPU through NVIDIA’s management library, and CPU through RAPL and regional carbon intensity factors. Energy and Emissions Measurement: Using the CodeCarbon toolkit we measure the power drawn by CPU, GPU, and RAM during the training and calculate total energy (kWh) and CO2 equivalent emissions (Kg CO2e). We adopt the rigorous protocol as that of Green AI work which includes consistent hardware, 15-s sampling of GPU through NVIDIA’s management library, and CPU through RAPL and regional carbon intensity factors. Insights for Sustainable QML Design: We study the sustainable QML design in the context of the identification of Pareto-optimal ansätz configurations that jointly optimize classification performance and environmental efficiency. We investigate if there is a relationship between ansätz complexity and their achieving maximum accuracy while minimizing energy consumption and training time. This approach to investigation enables the development of carbon-aware quantum AI systems that are both effective and environmentally responsible. Insights for Sustainable QML Design: We study the sustainable QML design in the context of the identification of Pareto-optimal ansätz configurations that jointly optimize classification performance and environmental efficiency. We investigate if there is a relationship between ansätz complexity and their achieving maximum accuracy while minimizing energy consumption and training time. This approach to investigation enables the development of carbon-aware quantum AI systems that are both effective and environmentally responsible. Structure The rest of the paper is organized as follows - The Literature Review section contains the survey of the related work on Green AI, Quantum Machine Learning, and IoT intrusion detection. Methods section details the N-BaIoT dataset, the QNN and QLSTM architectures, ten quantum ansätze designs, and the CodeCarbon Measurement setup. The Experimental Setup section explains the underlying experimental configurations, including data splitting, training parameters, and hardware environment. The Results section discusses the results in deep detail, and we compare model accuracy across ansätze, analyzing their training results and examining carbon/energy metrics. And finally, Discussion section concludes with the key findings, model performance and environmental trade-offs, strengths, limitations, and an outline of the future directions for energy-efficient quantum AI research. Literature review QML and Green AI have each gained rapid momentum in recent years converging around a common goal which is to build intelligent systems that are not only powerful but also environmentally sustainable. Initially introduced by Schwartz et al.7, Green AI calls for a conscious shift in machine learning from purely performance-driven development, to approaches that measure energy consumption, training time, and carbon impact as core evaluation criteria. This vision has catalyzed the emergence of tools such as CodeCarbon26, which enables AI researchers to log real-time energy consumption and carbon emissions of CPU, GPU, and memory during training. At the same time, QML proposes a new paradigm for learning systems. Quantum Neural Networks (QNNs), for example, leverage quantum states to encode data and exploit entanglement and superposition to carry out complex computations with potentially fewer parameters than their classical counterparts. Massoli et al.27 provided a comprehensive review of QNN architectures which ranges from variational quantum perceptrons to hybrid Boltzmann and convolutional quantum models. Chen et al.28 further extended this boundary with a formal proposal for QLSTM networks while outlining how quantum circuits can replace conventional gates in LSTM cells to enhance temporal modeling capacity. As quantum circuits become more and more complex, researchers have begun to investigate the optimal solution of a problem versus the complexity of the design. McLean et al.29 investigated the problem of barren plateaus, where the gradient vanishes, in relation to deep circuits, which would make highly complex circuits difficult to optimize. Schuld et al.30 demonstrated that certain shallow parameterized circuits can match the performance of deeper models thus hinting at energy savings through ansätz design. More recently Salek et al.17 developed a hybrid QML framework to detect adversarial attacks on networks and found that quantum-enhanced classifiers not only improved accuracy but also reduced training iterations compared to the classical baselines. The domain of cybersecurity has seen early applications of QML, especially for intrusion detection for IoT networks. N-BaIoT dataset22,31 remains a benchmark for IoT anomaly detection which captured network traffic from devices infected with Mirai and Bashlite botnets. Several classical approaches have already demonstrated very high accuracy on this dataset using autoencoders, RNNs and CNNs32. However, these models are computationally heavy. Kim and Madhavi16 proposed a hybrid quantum-classical anomaly detector where they used parameterized quantum circuits and outlier analysis on network data where they were able to achieve 99.87% accuracy on a DDoS detection task. While prior research has increasingly examined the environmental impact of quantum computing33–38, including factors such as power consumption, cryogenic cooling demands, and platform-specific lifecycle emissions, there has been comparatively little attention paid to the carbon footprint of quantum algorithms themselves. Unlike classical machine learning, where Green AI initiatives have led to tangible advancements in energy-conscious model design, QML has not yet seen a systematic effort to evaluate how algorithmic choices affect sustainability. This study addresses that gap by focusing on the carbon efficiency of variational quantum circuits, specifically examining how different ansätze impact both classification performance and environmental cost. By profiling energy and emissions across a variety of QML configurations using real-world anomaly detection tasks, this work offers a novel, algorithm-level perspective on Green AI in the quantum domain. A detailed investigation into the operational energy costs of quantum computers was conducted by Parker and Vermeer39, who attempted to bridge the gap between abstract quantum resource estimates and concrete economic metrics such as electricity usage and cost. While they did not address the upfront capital or maintenance expenses of building a cryptanalytically relevant quantum computer (CRQC), they estimated the marginal cost of electricity required to break a single cryptographic public key. Their model decomposes energy consumption into the product of runtime, number of qubits, and the average power consumed per qubit, a metric that includes all overhead costs such as classical co-processing and cryogenic cooling. Their framing of spacetime volume power-per-qubit as a fundamental expression for quantum energy modeling is particularly influential, offering a standardized way to compare quantum architectures and project resource scaling. Although precise data on the operational electricity consumption and running costs of IBM quantum computers are not publicly published, several researchers have attempted rough estimates. For instance, Desdentado et al.11 report an assumed power draw of approximately 25 kW for IBM’s superconducting-qubit systems, which corresponds to roughly 600 kWh of electricity usage per day. This estimate is derived from earlier reports by Boger40 and Castro41, as well as industry-analyst coverage of quantum-computer power consumption in sources such as IEEE Spectrum. Such estimates underscore that the cooling, control electronics and classical infrastructure supporting IBM’s quantum processors may dominate their energy footprint, thereby making system-level power consumption a non-negligible factor in assessing the sustainability of quantum computing deployments. Methods Dataset The N-BaIoT dataset22 provides labeled network traffic from nine IoT devices e.g. cameras, sockets, and thermostats that were intentionally infected with two prominent botnets, namely Mirai and Bashlite. In total, this public dataset contains over 7 million samples each of which has 115 numerical features giving an outline of a packet-level statistic. The target label is binary comprising of attack and benign categories arising from a variety of DDoS and remote access attacks. For this study, we used the L5 group of features (the 5-second history) for the data obtained from the Danmini doorbell and created a data subset of 150,000 records (50,000 records each for benign, Mirai, and Bashlite packets), as detailed in Table 1. The dataset was further split in a 75:25 train-test ratio. We normalized each feature to zero mean and unit variance. Since our primary focus is on the model and energy comparisons, we did not perform further feature selection or augmentation. Table 1N-BaIoT dataset used in this study.AttributeN-BaIoTFocusIoT device behaviorDevices UsedDanmini DoorbellFeatures Used23 (L5 Group)Attack TypesMirai and BashliteTraffic TypeIoT device trafficDataset Size150,000 recordsTrain:Test Split75:25LabelingBenign vs. Attack N-BaIoT dataset used in this study. QML models We evaluate two hybrid quantum architectures: Quantum Neural Network (QNN) : This is a variational feedforward network42,43 as illustrated in Fig. 1. Input features are first reduced using a classical dense layer to match the qubit count. We then use amplitude embedding to encode the inputs into the VQCs, which are described in the next section on Ansätze Designs. The 10 ansätze resulted in 10 different versions of QNN model which were part of this study. In each ansätz, the final measurement on each qubit is linearly combined to produce the output, which is then used for classification. The algorithm for the QNN training for the 10 ansätze is given in algorithm 1. QML algorithms. Quantum Long Short-Term Memory (QLSTM) : QLSTM model28,44,45 mimics the architecture of a classical LSTM, with each gate (input, forget, and output) being constructed from a VQC (Fig. 1). The 10 ansätze used (described in the next section) resulted in 10 versions of QLSTM model that were investigated as part of this research. In each ansätz, the final measurement on each qubit is linearly combined to produce the output, which is then used for classification. The algorithm for the QLSTM training for the 10 ansätze is given in algorithm 2. Both models use linear activation at the quantum classical interface. Hyperparameters are kept identical except for the optimizer which in QNN’s case uses Stochastic Gradient Descent (SGD) while in QLSTM’s case uses Adagrad. Other shared hyperparameters are learning rate of 0.01, batch size of 32, 20 epochs and 6 qubits per circuit. We implement both models in PennyLane with a PyTorch backend while enabling automatic differentiation of the quantum circuits. QNN training across multiple ansätze QLSTM training across multiple ansätze Ansätze designs We designed 10 distinct ansätze as the core of our experimental setup as shown in Fig. 2. Each ansätz varies in depth, rotation gates and entanglement patterns: Schematic representation of the 10 ansätze with varying depths, rotations, and entanglements used in this study. A1: This hardware-efficient linear entangling circuit is the simplest of all designs. It encodes the input features into each qubit’s amplitudes and applies a parameterized rotation on every qubit. This is followed by CNOT gates which are applied sequentially between adjacent qubits to entangle them in a chain. The result is a BasicEntangler pattern ensuring nearest neighbor connectivity across the register. A2: This ansätz builds on Ansätz 1 by adding rotations to each qubit. Each qubit is acted on by both the and rotations. The qubits are then entangled through the same chain of sequential CNOT gates as that of Ansätz 1. The additional gates provide extra tunable parameters, which allows for finer adjustment of the model’s weights while training. A3: This ansätz uses two layers of qubit rotations, where every qubit is rotated by , and gates. In the first layer, CNOT gates are applied sequentially between the neighboring qubits, while in the second layer, the CNOTs connect next-to-nearest neighbors each time skipping one qubit. This two-layer scheme provides richer expressivity by introducing extra degrees of freedom in the parameters. A4: This ansätz alternates between single qubit rotations and global CZ entangling gates in a staggering pattern. Each layer applies rotations to all qubits followed by CZ gates that entangle qubits across the register. This design generates correlations over multiple qubits at once and results in an ansätz with a fixed depth. A5: This ansätz also uses layered rotations and entanglement but with different sequence. It begins with , and rotations, followed by two successive layers of entanglement. The first layer of entanglements is achieved via a linear chain of CNOT gates between adjacent qubits, while the second layer incorporates Controlled-RX gates also applied in a linear pattern. A6: It is the most complex ansätz in the group and uses dense entanglement across multiple layers. It begins with , and rotations on each qubit followed by a fully connected layer of Controlled-RX gates. In this dense layer, each qubit is entangled with every other qubit through CRX operations while creating maximum entanglement across the register. A7: This ansätz has a fixed shallow depth. Each qubit is acted upon by and rotations. Moreover, the entanglement is introduced with Controlled-RX gates connecting neighboring qubits. Because of its choice of rotation gates and a single entangling operation, this circuit is one of the simplest designs with a shallow depth. A8: This ansätz also has a fixed shallow depth, but uses a different rotation scheme. Each qubit receives and rotations while introducing entanglement through a linear chain of CNOT gates. By using rotations instead of the , and standard CNOT entangler, this ansätz offers a contrasting structure as compared to the previous ansätz while maintaining the same shallow depth. A9: This ansätz applies rotations on each qubit and uses Controlled-RZ gates to entangle them. This ansätz differs from Ansätz 10 only in its choice of entangler gates. A10: This ansätz is structurally identical to the previous ansätz, except the entanglement is done with Controlled-RX gates. This variation yields a design that performs differently from the previous ansätz. Carbon measurement tools To quantify energy usage and emissions we use the CodeCarbon library following the Green AI methodology. CodeCarbon is an open-source Python package that tracks real-time energy consumption of hardware components and estimates CO2 emissions based on the grid carbon intensity. We configure CodeCarbon to log CPU, GPU, and RAM power every 15 seconds throughout training. GPU power is read through the NVIDIA management library, CPU through intel RAPL counters, and RAM is approximated by the standard rule of thumb which is almost 3W/8GB (Table 2). Table 2Comparison of Ansätz structures by parameter count, gate count, and depth.AnsätzRotation gatesQubit entanglement patternParms1Q2QDepth1CNOT, Fully connectedn2nn2 + CNOT, Fully connected2n3nn3 + + layeredCNOT, Fully connected, layered3n7n2n4 layeredCZ on alternate qubits, layeredn105 + + , CNOT and CRX, Fully connected3n4n2n6 + + CRX, Fully connected, layered3n4n7 + pairsCRX, asymmetric layered2n5n78 + , asymmetric layeredCNOT, asymmetric layered2n79CRZ, Fully connected, asymmetric layered2n3n2n10CRX, Fully connected, asymmetric layered2n3n2nHere n is the number of qubits in the circuit. Column 1Q shows the number of single-qubit gates, column 2Q shows the number of two-qubit gates, and Parms indicates the total number of trainable parameters. Comparison of Ansätz structures by parameter count, gate count, and depth. Here n is the number of qubits in the circuit. Column 1Q shows the number of single-qubit gates, column 2Q shows the number of two-qubit gates, and Parms indicates the total number of trainable parameters. We verify that CodeCarbon’s geographic settings match our lab’s location. If location data are unavailable it defaults to 475g CO2/kWh. For each training run, CodeCarbon outputs Total Energy (kWh) which is calculated by integrating power over time, Total Emissions (kg CO2e) which is computed as Energy multiplied by the carbon intensity and Emissions Rate (kg CO2e/sec). By comparing these metrics across models and ansätze we isolate differences in carbon cost corresponding to model efficiency. This allows us to report, for instance the percentage energy reduction of a simpler ansätz versus a complex one or QNN versus QLSTM under the same workload. The metric definitions and details have been documented in Table 3. These metrics together provide a detailed overview of our models’ environmental impact, allowing for comparisons of model efficiency and guiding energy-efficient development practices. Table 3Metrics and calculation methods used by CodeCarbon.MetricDescriptionCalculation methodTotal Energy (kWh)Total energy consumed by CPU, GPU, and RAMTotal Energy = CPU Energy + GPU Energy + RAM EnergyTotal carbon Emissions (kg)Emissions as carbon-equivalents [carboneq]Emissions = , where C is the carbon intensity and E is the energy consumed.CPU Energy (kWh)Energy used by the CPUTracked by Intel Power Gadget (Windows/Mac Intel), powermetrics (Apple Silicon), or Intel RAPL files (Linux). Defaults to TDP-based approximation if unavailable. This experiment was done using Linux, so CPU Energy was tracked using Intel RAPL files.GPU Energy (kWh)Energy used by GPUTracked using Nvidia GPUs via the pynvml libraryRAM Energy (kWh)Energy used by RAMEstimated with a fixed ratio of 3 W per 8 GB of RAMEmissions Rate (kg/s)Emissions divided by durationEmissions Rate = Total Emissions / Duration(seconds) Metrics and calculation methods used by CodeCarbon. QML training workflow The Fig. 3 illustrates the workflow used for evaluating QML models using 10 distinct ansätze (Fig. 2). The pipeline begins with the N-BaIoT dataset, preprocessed through normalization and train-test splitting. The diverse set of ansätze forms the basis for experimental comparison across both QNN and QLSTM architectures. Each model-ansatz combination is trained across 20 independent runs, with 20 epochs per run. Green AI framework for evaluating QNN and QLSTM models using 10 distinct ansätze. Experimental setup Training and testing configurations We split N-BaIoT into a fixed 75% training set and 25% test set while ensuring that the benign and attack ratio is preserved. All models were evaluated on this split. Each model-ansätz combination was trained 20 times, each time starting from different random weights for proper initialization. Each training run consisted of 20 epochs passing through the full data. Keeping the batch size as 32 we monitored training and validation loss for each epoch. During each run, the CodeCarbon tracker was activated at the beginning of training and stopped at the end of the final epoch. This ensured that we measured only the forward and backward training computations. After training we evaluated model performance on the held-out test data, reporting accuracy, precision, recall, F1-score, and ROC AUC. We aggregated results over the 20 runs to compute the median and variance of each metric for each model-ansätz pair. Hyperparameters, experimental setup and design The experiments were conducted in three sequential phases to comprehensively evaluate the energy efficiency and performance of quantum versus classical models. The models were fine-tuned with hyperparameters as shown in Tables 4, 5, and 6. The selection of hyperparameters for all models was informed by both empirical experimentation and established practices reported in the literature. Preliminary exploratory runs were conducted to identify stable parameter ranges that ensured convergence while avoiding overfitting. Drawing from prior studies in quantum and classical machine learning, key parameters such as learning rate, batch size, optimizer choice, and number of epochs were fine-tuned to balance training efficiency with model generalization. Once finalized, these hyperparameters were applied uniformly across all experimental runs to ensure methodological consistency and enable direct comparability between architectures and ansätze. Table 4Hyperparameters used for training QNN and QLSTM using PennyLane environment.ParametersQLSTMQNNData EncodingAmplitudeAmplitudeQubitsLearning Rate0.010.01Batch Size3232Epochs2020OptimizerAdamAdamLoss FunctionMSEMSEActivationlinearlinear Hyperparameters used for training QNN and QLSTM using PennyLane environment. Table 5Hyperparameters used for training ANN, LSTM, and CatBoost classical ML algorithms.ParametersANNLSTMCatBoostLearning Rate0.010.010.01Batch Size323232Epochs202020OptimizerAdamAdamCatBoostLoss Functionbinary_crossentropybinary_crossentropyLogloss(binary_crossentropy)ActivationSigmoidSigmoidProbability(Sigmoid) Hyperparameters used for training ANN, LSTM, and CatBoost classical ML algorithms. Table 6Hyperparameters used for training the QNN model for IBM Qiskit emulation and IBM Quantum Hardware environments.ParametersQNNData EncodingAmplitudeQubitsLearning Rate0.01Batch Size50OptimizerAdamLoss FunctionMSEActivationlinear Hyperparameters used for training the QNN model for IBM Qiskit emulation and IBM Quantum Hardware environments. In the first phase, ten distinct quantum circuit architectures (ansätze A1–A10) were evaluated under two model types (QNN and QLSTM) using the Pennylane framework in simulation mode. These experiments were executed in the computational environment described in Table 7, where both classification accuracy and energy usage were monitored over multiple trials. Table 7System specifications for experimental setup for phase 1 and 2.ComponentSpecificationOperating SystemLinux 6.1.0-25-amd64-x86_64 with glibc 2.36CPUIntel(R) Xeon(R) Gold 5218 CPU @ 2.30GHz (12 physical cores)RAM128 GBGPUNVIDIA Tesla T4 with 16 GB of GDDR6 memoryNVIDIA Driver Version560.35.03CUDA Version12.6 System specifications for experimental setup for phase 1 and 2. For the QML models, amplitude encoding was employed, with circuit structures designed to accommodate the dimensionality of the input features. We set the learning rate to 0.01, batch size to 32, and number of epochs to 20 . The optimizer for both of the models, QNN and QLSTM, was Adagrad. We used linear activation on the classical output of each model. Except for the quantum circuit itself, all other components were identical between runs. We used PennyLane’s “default.qubit” simulator for all quantum operations. This setup ensured that our energy measurements would reflect classical simulation of quantum circuits. In practice, true quantum hardware might have a different energy profiling. However, the simulator approach allowed us to make consistent comparisons, and to ensure that the relative differences between the ansätze would still hold conceptually. All experiments were executed on the same hardware to ensure fairness. We used a server equipped with an NVIDIA Tesla T4 GPU and an Intel Xeon Gold 5218 CPU, with 128 GB of RAM. The software environment consisted of Python 3.11 with PennyLane and PyTorch. The Tesla T4’s power and performance characteristics were typical to that of modern data center GPUs. By keeping hardware consistent, we ensured that any differences in energy use were due to model-ansätz choices and not due to device changes. All CodeCarbon logs automatically detected this GPU and CPU setup while attributing power correctly. The server configuration is detailed in Table 7. In the second phase, benchmark classical models including Artificial Neural Network (ANN), Long Short-Term Memory (LSTM), and CatBoost were trained and evaluated on the same dataset to enable a comparative baseline against quantum models. These experiments were also conducted under the same hardware and software environment to ensure consistency. The hyperparameters for the three classical models are given in Table 5. In the third phase, experiments were designed to compare energy consumption between a quantum model operating in an emulated setting and on actual quantum hardware. For this phase, IBM Qiskit was selected as the framework, and the experiment was confined to QNN model, utilizing ansätz A1. Emulation-based experiments were performed using high-performance GPU servers equipped with NVIDIA A100 units, as detailed in Table 8. For the quantum hardware runs, IBM’s ibm_brisbane backend was used (Table 9). Due to access limitations on IBM Quantum systems, full dataset training was not feasible within the allocated runtime. As a result, the dataset was partitioned into smaller subsets of 50 samples each, allowing for successful execution and timing of training runs. The model used hyperparameters shown in Table 6. Table 8System specifications for experimental setup for phase 3.ComponentSpecificationOperating SystemLinux 6.1.0-25-amd64-x86_64 with glibc 2.36CPUIntel(R) Xeon(R) Gold 5218 CPU @ 2.30GHz (12 physical cores)RAM128 GBGPUNVIDIA A100 (80 GB) and A100 (40 GB)NVIDIA Driver Version570.133.20CUDA Version12.8 System specifications for experimental setup for phase 3. Table 9Specifications of IBM ibm_brisbane Quantum Computer.ParameterValueNumber of Qubits127Best Two-Qubit Gate ErrorLayered Two-Qubit Gate ErrorCLOPS (Circuit Layer Operations per Second)180 K Specifications of IBM ibm_brisbane Quantum Computer. The aggregate runtime from these subsets was then extrapolated to estimate the total time required for full dataset training. This extrapolated value, in conjunction with literature-based estimates of IBM Quantum’s average power usage (25 kW), was used to compute the expected energy consumption of a full training run on quantum hardware. This is discussed in more details in next section. Energy consumption estimation on IBM quantum and emulated platforms To estimate the energy consumption associated with training quantum models on IBM Quantum hardware, a two-pronged experimental approach was adopted. First, a Qiskit-equivalent implementation of the QNN model using Ansatz A1 was developed and executed in an emulation environment. The emulation was performed using Qiskit version 1.4.3 on high-performance computing servers equipped with NVIDIA A100 GPUs. The QNN model was trained for 20 epochs and repeated across 20 trials to ensure statistical robustness. During each trial, real-time energy consumption was monitored and recorded using the CodeCarbon library, enabling the collection of detailed power usage metrics for subsequent analysis. When deploying the same model on IBM Quantum hardware, it was observed that a full-dataset training run could not be completed within the allocated quantum runtime quota due to extended execution times. To address this limitation, the dataset was partitioned into smaller subsets of 50 records each, enabling multiple complete training runs within the available resource window. Training runs were conducted on several such subsets, and the corresponding total training time was recorded. This average run-time was then extrapolated to estimate the total time required to train the model on the full dataset. Using publicly reported estimates of IBM Quantum’s energy consumption, approximately 25 kW (or 25 kWh per hour), the extrapolated training time was multiplied by the power consumption rate to derive an estimated total energy usage for a full QNN training cycle on IBM Quantum hardware. Experimental design for classical model energy profiling To establish a robust comparative baseline for evaluating the energy efficiency of quantum models, a series of experiments were conducted using three widely adopted classical machine learning models: Artificial Neural Networks (ANN), Long Short-Term Memory (LSTM) networks, and CatBoost. Each model was trained on the same preprocessed version of the N-BaIoT dataset used in the quantum experiments, ensuring consistency in data conditions and evaluation. For each model, 20 independent trials were performed using identical hardware configurations. During each trial, real-time energy consumption was monitored using the CodeCarbon tracking library, which logs power usage across CPU and GPU components. The resulting energy values were aggregated to compute median and standard deviation statistics for each classical model’s total energy consumption, providing a reliable estimate of their computational footprints under repeated training scenarios. Results Phase 1: energy consumption and carbon emission comparison for various ansätze in QNN and QLSTM models One of the primary aims of this study was to evaluate and compare the energy efficiency and carbon footprint of QML architectures, deployed across 10 different ansätze using PennyLane. The evaluation criteria included Total Energy Consumption, Carbon Emissions, Energy Breakdown by H/W components (CPU, GPU, and RAM), Emission Rate, and Training Time. The results for these statistics are detailed in Table 10 and also depicted in Fig. 4. Table 10Energy consumption and Total Emission comparison between QNN and QLSTM models across 10 ansätz configurations.Model/MetricA1A2A3A4A5A6A7A8A9A10QNN - Quantum Neural Network Total Energy (kWh)0.1933 ± 0.01040.3140 ± 0.01610.3240 ± 0.01280.1363 ± 0.01690.3042 ± 0.00820.6082 ± 0.01510.2827 ± 0.01390.2227 ± 0.01540.3053 ± 0.01500.2840 ± 0.0135 CO2 Emissions (kg)0.0897 ± 0.00480.1457 ± 0.00750.1504 ± 0.00600.0632 ± 0.00780.1410 ± 0.00410.3124 ± 0.00750.1312 ± 0.00640.1034 ± 0.00710.1417 ± 0.00700.1318 ± 0.0063 CPU Energy (kWh)0.0340 ± 0.00180.0549 ± 0.00280.0812 ± 0.00320.0340 ± 0.00410.0849 ± 0.00240.1328 ± 0.00310.0551 ± 0.00270.0432 ± 0.00290.0776 ± 0.00430.0713 ± 0.0034 GPU Energy (kWh)0.1390 ± 0.00740.2268 ± 0.01160.2098 ± 0.00830.0885 ± 0.01100.1988 ± 0.00530.4432 ± 0.01120.1948 ± 0.00960.1537 ± 0.01070.1960 ± 0.00900.1837 ± 0.0087 RAM Energy (kWh)0.0203 ± 0.00110.0324 ± 0.00170.0329 ± 0.00130.0139 ± 0.00170.0205 ± 0.00060.0324 ± 0.00080.0329 ± 0.00160.0258 ± 0.00180.0315 ± 0.00180.0290 ± 0.0014 Emissions Rate (Kg/s) ± ± ± ± ± ± ± ± ± ±Training Time (sec)1341 ± 102153 ± 92178 ± 16961 ± 81401 ± 102088 ± 222189 ± 241778 ± 522074 ± 461970 ± 5QLSTM - Quantum Long Short-Term Memory Total Energy (kWh)0.2628 ± 0.01770.4848 ± 0.01710.4856 ± 0.01790.1821 ± 0.01740.3841 ± 0.01060.7799 ± 0.01360.4448 ± 0.01460.3458 ± 0.01580.4748 ± 0.01980.4692 ± 0.0126 CO2 Emissions (kg)0.1221 ± 0.00830.2251 ± 0.00800.2254 ± 0.00830.0845 ± 0.00810.1901 ± 0.00520.4091 ± 0.00660.2065 ± 0.00680.1604 ± 0.00740.2203 ± 0.00920.2178 ± 0.0059 CPU Energy (kWh)0.0465 ± 0.00320.0867 ± 0.00300.0964 ± 0.00370.0358 ± 0.00340.0822 ± 0.00240.1286 ± 0.00270.0883 ± 0.00290.0680 ± 0.00310.1192 ± 0.00500.1177 ± 0.0032 GPU Energy (kWh)0.1888 ± 0.01270.3469 ± 0.01230.3320 ± 0.01210.1250 ± 0.01200.2616 ± 0.00720.5896 ± 0.00960.3039 ± 0.01000.2372 ± 0.01080.3076 ± 0.01280.3039 ± 0.0081 RAM Energy (kWh)0.0275 ± 0.00190.0510 ± 0.00180.0572 ± 0.00220.0213 ± 0.00200.0409 ± 0.00120.0616 ± 0.00140.0525 ± 0.00170.0406 ± 0.00190.0481 ± 0.00200.0475 ± 0.0013 Emissions Rate (Kg/s) ± ± ± ± ± ± ± ± ± ± Training Time (sec)1425 ± 132879 ± 193187 ± 401118 ± 102228 ± 253551 ± 372932 ± 342224 ± 222681 ± 372657 ± 24All numbers are represented in median ± standard deviation notation. Energy consumption and Total Emission comparison between QNN and QLSTM models across 10 ansätz configurations. All numbers are represented in median ± standard deviation notation. Energy consumption comparison of QNN and QLSTM for ansatze across runs. Across all ansatz configurations, QNN models consistently demonstrated lower energy consumption and carbon emissions compared to their QLSTM counterparts, owing to the higher complexity of a QLSTM architecture as compared to QNN. For example, for A6 (the most complex ansätz), the median for QNN model was at 0.61 kWh while for QLSTM it was 0.78 kWh. While this difference may appear modest in magnitude, it is amplified when considering large-scale training runs or multiple model iterations common in practical deployments. Additionally, simpler circuits like A1 and A4 in QNN showed the lowest total energy consumption, making them especially attractive for low-carbon AI implementations. On average, QLSTM models consume 25–30% more energy than their QNN counterparts for the same ansatz.This trend holds consistently across CPU, GPU, and RAM energy usage, with the GPU being the dominant contributor in both models. Similarly, QNN models maintained lower total CO2 emissions, with configurations such as A4 having emission median at 0.063 kg CO2 compared to QLSTM’s at 0.085 kg under the same ansätz. CO2 emissions mirror the energy consumption pattern. The consistent trend of reduced carbon footprint in QNNs suggests that the structure of QNNs imposes less computational burden and energy demand than the QLSTM models. Disaggregating energy use by component provides further insight. In both models, the GPU was the dominant energy consumer, accounting for more than 70% of total energy usage across most configurations. QLSTM mirrored the trend of QNN, albeit at slightly higher absolute levels, indicating the energy-intensive nature of quantum circuit execution on current quantum simulators accelerated by GPUs. Interestingly, RAM energy consumption remained relatively constant and marginal across all configurations, indicating that RAM usage is not a significant differentiator for environmental performance in these quantum models. The emissions rate (total emission in a unit training duration) varied modestly across ansätze but was generally in the same order of magnitude (10−6 kg/s). QNN configurations showed more favorable emissions rates compared to their QLSTM equivalents, affirming the potential of QNNs for low-carbon applications (Table 11). Table 11Performance metrics comparison between QNN and QLSTM models across 10 ansätz configurations.Model/MetricA1A2A3A4A5A6A7A8A9A10QNN - Quantum Neural Network Accuracy0.9343 ± 0.03090.9288 ± 0.03320.9299 ± 0.03350.9536 ± 0.02430.9570 ± 0.03320.9361 ± 0.02480.9456 ± 0.02570.9484 ± 0.02620.9413 ± 0.06880.9602 ± 0.0341 Precision0.9846 ± 0.02880.9902 ± 0.00560.9926 ± 0.00640.9881 ± 0.00660.9856 ± 0.00530.9883 ± 0.00600.9908 ± 0.00580.9899 ± 0.00590.9829 ± 0.04030.9905 ± 0.0071 Recall0.9396 ± 0.02260.9636 ± 0.01690.9469 ± 0.02700.9609 ± 0.02540.9474 ± 0.02560.9483 ± 0.01910.9600 ± 0.03310.9765 ± 0.02230.9442 ± 0.04510.9348 ± 0.0432 F1-Score0.9635 ± 0.02100.9704 ± 0.00940.9715 ± 0.01400.9727 ± 0.01130.9688 ± 0.01830.9675 ± 0.01180.9681 ± 0.01840.9806 ± 0.01410.9681 ± 0.04670.9738 ± 0.0239 AUC ROC0.9624 ± 0.03110.9742 ± 0.00980.9669 ± 0.01340.9703 ± 0.01460.9599 ± 0.01400.9722 ± 0.01450.9685 ± 0.01670.9827 ± 0.01740.9658 ± 0.06420.9603 ± 0.0208QLSTM - Quantum Long Short-Term Memory Accuracy0.8952 ± 0.07330.9048 ± 0.06250.9155 ± 0.07240.9644 ± 0.03840.8970 ± 0.07680.9139 ± 0.05250.9319 ± 0.07060.9337 ± 0.04400.9057 ± 0.05700.9261 ± 0.0452 Precision0.9129 ± 0.06410.9352 ± 0.06350.9566 ± 0.05570.9764 ± 0.02950.9067 ± 0.06910.9465 ± 0.04440.9545 ± 0.08150.9421 ± 0.02820.9299 ± 0.06230.9540 ± 0.0298 Recall0.9199 ± 0.04350.9163 ± 0.04410.9434 ± 0.04390.9495 ± 0.02350.9050 ± 0.04540.9295 ± 0.03020.9294 ± 0.04120.9216 ± 0.02030.9414 ± 0.04980.9345 ± 0.0296 F1-Score0.9166 ± 0.05010.9306 ± 0.05120.9488 ± 0.04900.9607 ± 0.02570.8907 ± 0.05590.9360 ± 0.03130.9401 ± 0.05310.9362 ± 0.01740.9327 ± 0.05100.9401 ± 0.0226 AUC ROC0.8921 ± 0.08260.9279 ± 0.08490.9369 ± 0.06810.9596 ± 0.03060.8459 ± 0.10000.9121 ± 0.05600.8948 ± 0.15420.9288 ± 0.02950.9093 ± 0.07860.9242 ± 0.0381All numbers are represented in median ± standard deviation notation. Performance metrics comparison between QNN and QLSTM models across 10 ansätz configurations. All numbers are represented in median ± standard deviation notation. Training time varied significantly across ansätze, with A4 being the fastest in both models. In contrast, some QLSTM configurations such as A3 and A6 required significantly longer training time, owing to the computational overhead associated with quantum recurrent architectures. Generally, A6 configuration was the most computationally expensive, largely due to its complexity. The general trend in the data suggests that the added complexity of QLSTM does not always translate to proportionally improved performance, especially when weighed against energy and time costs. Phase 2: energy and training time comparison between classical and quantum models To assess the computational efficiency and environmental impact of quantum versus classical models, we measured both training time and energy consumption across five representative architectures: Classical Models for ANN and LSTM (using Tensorflow), and CatBoost, and Quantum Models for QNN and QLSTM (using PennyLane, for ansätze A1–A10). The results are summarized in Table 12. Table 12Comparison of energy consumed by classical versus quantum models during training runs.CategoryModelTraining timeEnergy consumedClassicalANN ± ± LSTM ± ± Catboost ± ± QuantumQNN ± ± QLSTM ± ± All numbers are in kWh and are represented in median ± standard deviation notation. Comparison of energy consumed by classical versus quantum models during training runs. All numbers are in kWh and are represented in median ± standard deviation notation. Classical models completed training within a relatively short timeframe, ranging from less than ten seconds for CatBoost ( s) to approximately two minutes for LSTM ( s). ANN exhibited moderate training time of about a minute ( s). In contrast, quantum models demonstrated significantly longer training durations. The QNN required a median of seconds (approximately 33 minutes), while the QLSTM extended further to seconds (about 44 minutes), representing a one to two order-of-magnitude increase in training time relative to classical counterparts. This disparity is primarily due to the computational cost of quantum circuit simulation and repeated expectation value measurements when executed on emulated quantum environments using classical computers. A similar, and related, trend was observed in energy usage. Classical models consumed minimal energy, ranging from kWh for CatBoost to kWh for LSTM. In contrast, quantum models exhibited markedly higher energy consumption, with QNN consuming kWh and QLSTM peaking at kWh. These results emphasize the substantial energy cost associated with quantum machine learning when run in classical simulation environments. This overhead arises primarily from the need to emulate qubit interactions, apply parameterized gates repeatedly, and perform stochastic sampling to estimate observables–processes that scale exponentially with the number of qubits. This discrepancy underscores the computational overhead of simulating quantum circuits on classical hardware. Unlike classical models that have already seen tremendous algorithmic development and optimization, quantum circuit simulators are still in early stages of development and require complex linear algebraic operations, which are computationally expensive even on high-performance GPUs. These results highlight the fact that while theoretical quantum advantage promises asymptotic gains in performance or efficiency, practical implementations continue to be impacted by the limitations of classical simulation. Phase 3: comparison of energy consumption between quantum emulation and physical quantum hardware In order to quantify and compare the energy consumption between quantum neural network (QNN) models operating in simulated versus actual quantum hardware environments, we conducted a dedicated set of experiments using IBM Quantum systems and the Qiskit framework. Simulated training was executed on a high-performance emulation environments powered by NVIDIA A100 GPUs, with complete system specifications outlined in Table 8. These simulations served as a baseline for understanding the resource demands under idealized execution conditions. The results are described in Table 13. Table 13Comparison of energy consumption and training time per epoch using IBM Qiskit in emulation mode across different GPU systems.MetricA100 (80 GB)A100 (40 GB)Duration per Epoch (sec)37748788Energy Consumed (kWh)0.22761.2639 Comparison of energy consumption and training time per epoch using IBM Qiskit in emulation mode across different GPU systems. Due to time and access constraints associated with the IBM Quantum hardware, training the model on the full dataset was not feasible. To address this, the original dataset was segmented into smaller batches of 50 records each, allowing each training run to complete within the available execution window. Multiple such runs were conducted, and their cumulative execution time was used to extrapolate the total training duration that would have been required for the full dataset. By combining this extrapolated training time with published estimates of the power draw of IBM Quantum hardware, approximately 25 kW, we estimated the total energy consumption for executing the QNN training on actual quantum systems. These numbers are detailed in Table 14. Table 14Estimation of energy consumption per epoch for model training on IBM Quantum hardware.MetricValueNumber of samples in training dataset112,500Number of samples per batch50Number of batches needed for 1 epoch2250Mean runtime of 1 batch (seconds)68Approximate execution time for 1 epoch (seconds)151,875Approximate energy consumption for 1 epoch (kWh)1055 Estimation of energy consumption per epoch for model training on IBM Quantum hardware. The energy cost of training a QNN model on actual IBM Quantum hardware was estimated by first measuring the time required to process batches of 50 samples and extrapolating the total runtime needed for a complete epoch across 112,500 training samples. Given the average per-batch execution time of 68 s, the estimated epoch-level runtime amounted to approximately 151,875 seconds. Using a widely cited power consumption estimate of 25 kW for quantum computing infrastructure, this corresponds to an energy footprint of approximately 1055 kWh per epoch. By contrast, the same model executed in a Qiskit-based emulation environment on high-performance classical hardware exhibited substantially lower energy consumption. Training runs conducted on three GPU platforms, NVIDIA A100 (40 GB and 80 GB), yielded the following per-epoch energy usage: 0.2276 kWh (A100-80GB) and 1.2639 kWh (A100-40GB). These results demonstrate that the energy required for emulated quantum training is several orders of magnitude lower than that of real quantum systems under current hardware implementations. This disparity can be attributed primarily to the non-computational overhead intrinsic to quantum hardware. Contemporary superconducting quantum computers demand continuous cryogenic cooling, precision control electronics, and error correction subsystems, all of which operate independent of the quantum workload size. As such, a significant portion of the energy consumption is dedicated to maintaining quantum coherence and system stability rather than direct computation. In contrast, classical emulation environments benefit from energy-proportional hardware, where power usage scales more directly with task complexity and duration. The A100-40GB energy-intensive emulation consumed over 800 less energy than IBM Quantum hardware for the same training task, while the more efficient A100-80GB setup demonstrated an even larger efficiency gap exceeding 4000. These findings highlight that quantum hardware currently lacks energy efficiency advantages in its present form. While QML models may show potential in terms of accuracy or expressiveness, their environmental and operational costs are significant. As the field progresses, advances in hardware efficiency will be necessary before such systems become competitive in terms of sustainability and energy economics. Phase 1 results revisited: performance analysis To complement the energy and environmental assessments, we evaluated the predictive performance of the QNN and QLSTM models across the same ten ansätz configurations (A1 to A10), using standard classification metrics of Accuracy, Precision, Recall, F1-Score, and AUC-ROC. These metrics, detailed in Table 11, provide a comprehensive view of the models’ capabilities for anomaly detection in IoT networks. These metrics are also visually represented in Figs. 5 and 6. QNN accuracy metrics for various ansatze. QLSTM accuracy metrics for various ansatze. Across most configurations, QNN models continued to demonstrate stronger performance consistency and superior accuracy. QNN achieved accuracy scores between 0.9288 and 0.9602, with multiple configurations such as A4, A5, A8, and A10 exceeding 0.94. In contrast, QLSTM exhibited greater variability, with accuracies ranging from 0.8952 to 0.9644, but only A4 surpassed the 0.96 mark. QNN models also outperformed QLSTM in precision, with most values above 0.98, indicating minimal false positives. QLSTM, while achieving strong precision in select configurations (A3, A4, A6), showed lower values overall, with wider standard deviations reflecting less consistent performance. Notably, QNN’s precision remained tightly clustered with lower variance, suggesting better reliability. In terms of recall, both models performed well, but QNN again led slightly. The QNN recall ranged from 0.9396 to 0.9765, while QLSTM ranged from 0.9050 to 0.9495, with a slightly higher spread in results. This suggests that QNN models were more effective in capturing true positives, a critical factor in security contexts where missing an attack can have serious implications. The F1-score also highlights QNN’s dominance, with all configurations achieving scores above 0.96, peaking at 0.9806 (A8). In comparison, QLSTM F1-scores were generally lower and more variable, ranging from 0.8907 to 0.9607, with only A4 nearing the QNN levels. The AUC-ROC values further support these findings, with QNN configurations consistently recorded AUCs above 0.95. QLSTM showed greater fluctuation, including a low of 0.8459 (A5) and a high of 0.9596 (A4). This variability suggests that QLSTM models may struggle with consistent class separation across different ansätze, while QNNs provide more dependable performance. Looking at the confusion matrices in Figs. 7 and 8, we find that across all ansätze, QNN consistently achieved higher accuracy than QLSTM, albeit marginally. This trend suggests that QNNs were able to generalize slightly better in this classification task. QNN models also displayed higher precision (>98%) across ansätze as compared to QLSTM models. Confusion matrices for QNN with various ansätze. Confusion matrices for QLSTM with various ansätze. To evaluate whether the observed performance differences between QNN and QLSTM models are statistically significant across various ansätze, we conducted the non-parametric Mann–Whitney U test on five key classification metrics: Accuracy, Precision, Recall, F1-Score, and AUC ROC. The results, shown in Table 15, indicate that Precision, F1-Score, and AUC ROC metrics consistently exhibit statistically significant differences () across nearly all ansätze, suggesting that QNN and QLSTM models differ meaningfully in how they optimize classification boundaries. These metrics highlight QNN’s advantage in balancing classification reliability and discriminative capacity. For Accuracy, statistical differences are more nuanced, only A2 and A5 exhibit significant divergence, indicating that accuracy alone may not capture the broader performance dynamics. Overall, the QNN model demonstrates consistently better median precision and F1 performance with lower variance across trials. These findings affirm that in general the QNN configurations show better performance compared to identical QLSTM configurations. Given that QNN models also demonstrated lower carbon emissions in prior sections, this makes QNN based designs more favorable as compared to QLSTM based designs. Table 15Mann–Whitney U Test p-values (QNN vs. QLSTM) across all ansätze.MetricA1A2A3A4A5A6A7A8A9A10Accuracy0.11670.04390.40940.49890.00060.14040.22350.09890.22350.1136Precision0.00020.00000.00010.02070.00000.00000.00010.00010.00180.0007Recall0.01060.00400.12640.17620.00900.01550.03850.00000.56090.6359F1-Score0.00130.00020.00210.05830.00080.00000.00230.00000.00980.0047AUC ROC0.00050.00010.00020.02650.00510.00000.00020.00000.00280.0053Bold values indicate statistically significant differences (). Mann–Whitney U Test p-values (QNN vs. QLSTM) across all ansätze. Bold values indicate statistically significant differences (). Deeper look at emissions and energy consumption Figure 9 illustrates the total CO2 emissions, in kilograms, generated during the training of QNN and QLSTM models across ten distinct ansätze (A1–A10). This comparison directly reflects the environmental cost of quantum model training. The complexity of the different circuit architectures directly influences power usage and sustainability profiles. A1 and A4 were the most carbon-efficient configurations for both QNN and QLSTM models, with emissions at or under 0.09 kg, while A6 was the least carbon-efficient. Carbon emissions by model configuration. The environmental impact varies significantly across ansätz configurations. Figure 10 illustrates the computational demands of various ansätze and their implications for performance optimization and energy sustainability. Across all ansätze, GPU energy dominates total energy usage. A6 shows the highest GPU consumption, in accordance with its gate-heavy circuit structure. In contrast, A4 stands out in both models with the lowest energy consumption, aligning with its overall minimal energy profile. CPU energy remains modestly variable, with A6 demanding the most. RAM consumption contributes the smallest fraction of total energy across all ansätze. QLSTM RAM usage is higher than QNN for all ansätze owing to its memory-intensive architecture. Hardware energy consumption breakdown. GPU energy dominates total consumption for both models. The diagram in Fig. 11 shows the ansätze performances in the context of their energy costs, which is especially relevant for large-scale or environmentally conscious deployments. This chart clearly illustrates that QNN models consistently outperform QLSTM in accuracy for a given energy budget. A4 is notable for achieving the highest accuracy ( 96%) at moderate energy consumption, thus representing a Pareto-optimal configuration within the group. QLSTM models, in general, show diminishing returns, consuming more energy per unit of accuracy. With QLSTM, only A4 crosses the 94% accuracy threshold while consuming the least energy, making it an outlier for QLSTM. Energy-accuracy trade-off analysis. QNN achieves higher accuracy with variable energy consumption. Figure 12 examines the convergence behavior and generalization performance of QNN A4 and QLSTM A4 models, which were the two most promising ansätz configurations. QNN A4 exhibits a steep learning trajectory, with both training and test accuracy surpassing 90% by epoch 5, and plateauing near 97% by epoch 7. It shows stable performance, with the variance narrowing over time, indicating good learning and convergence. The gap between training and test accuracy remains minimal, suggesting minimal overfitting. QLSTM A4, on the other hand, reaches 94% test accuracy by epoch 10, with a relatively slower slope in the early epochs, even though it starts with a higher base accuracy ( 75%) in the first epoch. While the gap between train and test accuracy is small, it saturates earlier and at a lower performance level than QNN A4. Additionally, the variance in test accuracy is smaller in early epochs compared to QNN. Learning curves for optimal configurations. QNN A8 demonstrates faster convergence than QLSTM A4. The training and test loss curves for three representative ansätze, A1, A4, and A8, across QNN and QLSTM models, are shown in Fig. 13. The top row shows the training and test loss for QNN while the bottom row shows the same for QLSTM for A1, A4, and A8 ansätze. For QNN, all three ansätze exhibit smooth, monotonic convergence. A4 and A8 outperform A1, converging to a lower final training loss ( ( 0.05). A1 trails slightly, leveling at 0.09, owing to its design of that of a relatively less expressive and shallower ansätz. A8 and A4 again show good generalization on the test dataset, with the parallel trajectories between training and test losses for A4 and A8 suggesting minimal overfitting. In QLSTM models, A4 demonstrates the fastest and steepest convergence, reaching 0.27 by epoch 10. A1 and A8 converge more slowly. The difference in convergence speed is more pronounced in QLSTM than in QNN. On test dataset, A4 again achieves the lowest final test loss indicating excellent generalization. A8 performs moderately ( 0.07), while A1 levels off at a higher loss ( 0.11–0.12). Additionally, A1 exhibits higher variance in test loss (visible through minor oscillations post-epoch 5), which could suggest early overfitting. Loss convergence over training epochs. QNN demonstrates faster convergence than QLSTM. A4 performs best on both QNN and QLSTM models. Figure 14 represents the holistic evaluation of the classification capabilities of QNN and QLSTM models for the average taken on the results from the ten ansätze A1 - A10. The comparison makes use of five metrics (Accuracy, Precision, Recall, F1-Score, and AUC-ROC). As represented visually in the diagram, QNN (Blue pentagon) dominates in all five metrics, and its balanced shape suggests consistency across metrics. QLSTM (Red pentagon) exhibits slightly lower but uniform performance across the metrics. This radar chart confirms that QNN consistently outperforms QLSTM in all of the classification metrics evaluated. Multi-metric performance comparison. QNN outperforms QLSTM across all evaluation metrics. To assess the practical viability of QNN and QLSTM architectures, Figure 15 shows a twofold view of their training efficiency. The left panel shows the average time per epoch across ten different ansätze, while the right panel shows final test accuracy against total training duration. As seen on the left chart, QNN consistently incurs higher average training time per epoch as compared to QLSTM for most ansätze. The most computationally expensive QLSTM configuration is A6 (median 3551/epoch), while for QNN it is A7 (median 2189 s/epoch). The fastest ansätz is A4 (median 961 s for QNN and 1118 s for QLSTM). Looking at the right chart, we see that QNN achieves higher accuracy consistently, with most data points above 0.90, even for moderate training times. Additionally, for all training times, QNN accuracy exhibits low variance and strong generalization. QLSTM demonstrates greater scatter in both accuracy and training time. While some QLSTM models reach 0.95 accuracy, many fail to reach that level even after extended training durations, with accuracy dropping below 0.85 or even 0.75 in some cases. Training efficiency analysis. Figure 16 depicts the energy efficiency of the QNN and QLSTM models by evaluating the correlation between training time (in minutes) and total energy consumption (in kWh) across the ten distinct ansätze. As the diagram visually shows, both QNN and QLSTM models exhibit a positive correlation between training time and energy consumption. QLSTM models generally lie higher on the energy axis for comparable training durations, indicating higher energy demands due to quantum circuit complexity. A4 (in both QNN and QLSTM) presents an ideal configuration for time-energy balance. A6 consistently consumes the most energy and time across both models, owing to its circuit depth and complexity. Overall, this diagram establishes that the training time is a strong predictor of energy cost for both QNN and QLSTM models and that QLSTM models tend to be more energy-demanding as compared to QNN. Training time versus energy usage. Discussion This study presents a comprehensive evaluation of Quantum Machine Learning through a three-phase experimental framework designed to assess performance, energy efficiency, and hardware implications across quantum and classical paradigms. In the first phase, we conducted a comparative assessment of QNN and QLSTM architectures across ten distinct ansätze. This phase revealed critical trade-offs between classification accuracy, energy usage, and training overhead. QNN consistently outperformed QLSTM across all major evaluation metrics–including Accuracy, Precision, Recall, F1-score, and AUC-ROC–with the QNN-A4 ansatz delivering the best overall performance. Furthermore, certain ansätze, such as A6, were notably more energy-intensive and slower to train, highlighting the importance of designing resource-efficient circuits. On the other hand, ansätze like A4 and A8 achieved favorable energy-accuracy trade-offs, positioning them as ideal candidates for practical deployment. The second phase extended the investigation to benchmark QML models against three classical machine learning architectures: ANN, LSTM, and CatBoost. This analysis enabled a holistic view of energy-performance trade-offs. Classical models demonstrated orders-of-magnitude lower training times and energy consumption compared to their quantum counterparts, with CatBoost being the most efficient. Within the quantum models, QNNs demonstrated better classification performance per unit energy costs, suggesting that they may serve as viable alternatives in scenarios where interpretability of quantum circuits adds value. This phase also reinforced the importance of using standardized energy profiling tools (such as CodeCarbon) to ensure consistent evaluation of carbon impact across paradigms. In the third phase, we analyzed the energy consumption of QML models on actual IBM quantum hardware and compared it against Qiskit-based quantum emulation running on high-performance GPUs. The extrapolated energy usage on IBM’s real quantum hardware was significantly higher–reaching over 1,000 kWh per epoch–compared to sub-kWh levels observed in GPU emulation environments. This stark contrast underscores the current overheads and limitations associated with quantum hardware, particularly in terms of accessibility, runtime constraints, and energy scalability. Nevertheless, these findings provide a realistic baseline for energy budgeting and emphasize the importance of circuit compression, data batching, and judicious ansätz selection in mitigating quantum training costs. Collectively, these results highlight that while classical models currently dominate in terms of energy efficiency and accessibility, QML models, especially QNNs, hold promising potential for cases where appropriate. The insights into ansätz-driven energy behaviors, cross-paradigm performance benchmarking, and real-vs-emulated hardware analysis contribute to a more nuanced understanding of the practical considerations in building scalable and carbon-aware quantum AI systems. Unexpected findings While it was anticipated that deeper or more complex ansätz configurations would generally lead to higher model performance, one of the more surprising outcomes was that A4 delivered the highest classification accuracy with relatively lower energy consumption and training time compared to several other configurations (e.g., A6), which consumed significantly more resources without proportionate performance gains. This challenges the conventional assumption that expressibility and depth directly translate to better generalization in QML models. The efficiency of A4 suggests that there exists an optimal complexity-to-efficiency trade-off, where moderately complex circuits can outperform deeper ones if better aligned with the data and training dynamics. This result suggests for a more principled approach to ansätz design based on empirical energy-performance profiles, rather than defaulting to depth or entanglement as proxies for capability. Trade-offs and broader implications One of the central insights emerging from this study is the distinct trade-off between model accuracy and resource efficiency (energy consumption) across both QNN and QLSTM architectures. While certain ansätz configurations (e.g., QNN-A6 and QLSTM-A6) achieved decent classification performance, they did so at a significantly higher cost in terms of CO2 emissions, GPU energy draw, and prolonged training durations. Conversely, QNN-A4 and QLSTM-A4 demonstrated a good balance between high accuracy and minimal energy footprint and training time. These findings indicate that beyond a certain threshold, increasing ansätz complexity leads to diminishing returns in accuracy while increasing computational overhead. This suggests the need for a more judicious ansätz selection process. The broader implications of this study take us into the domain of Sustainable-AI. As quantum computing moves toward practical deployment, especially in resource-constrained and eco-sensitive contexts, it becomes imperative to look into minimizing environmental impact without sacrificing performance. This study finds empirical evidence that eco-sensitive QML is attainable if the choice of ansätz design is strategically aligned. Strengths, limitations, and future work A notable strength of this work lies in its comprehensive and multi-faceted evaluation framework for comparing QNN and QLSTM architectures across ten distinct ansätz configurations. The study rigorously benchmarks models not only on conventional classification metrics, but also incorporates environmental and operational considerations, including CO2 emissions, energy breakdown by hardware component, training time, and convergence dynamics. This integrated approach allows for a holistic understanding of performance-to-efficiency trade-offs. This work highlights configurations that optimally balance accuracy and sustainability. Additionally, the consideration of real-world system-level energy and emission data adds practical relevance to the experimental outcomes. On the other hand, this study also has several limitations. First, the experiments were conducted in a simulated quantum environment. They do not account for real quantum noise, decoherence, and hardware-specific constraints which may significantly impact actual model performance on near-term quantum hardware. Additionally, modern quantum computing infrastructure is significantly more complex than classical computing infrastructure and has more dimensions to energy consumption than just GPU, CPU, and RAM which were not studied as part of this work. Second, the dataset and classification task selected for this evaluation may not be generalizable across all domains, and results may vary when applied to more complex or higher-dimensional problems. Lastly, while the ten ansätze provide a meaningful spectrum of architectural diversity, the search space remains constrained, and additional exploration of circuit depth, entanglement patterns, and hybrid designs could further enrich the comparative analysis. Additionally, as done in the third phase of the study, we compared the energy profiles of Quantum Machine Learning models between a Qiskit-based emulation environment and an actual quantum processing environment. The strength of this approach lies in the novel attempt to bridge simulation-based experimentation with real quantum hardware evaluation. This dual-perspective analysis provided valuable insights into the scalability and sustainability of QML models when transitioned from controlled emulation to physical execution. However, a notable limitation in this experiment was the constrained access to IBM Quantum hardware, which prevented complete execution on the full dataset. Consequently, energy consumption metrics for full-scale training were derived through extrapolation from smaller batch runs. While this approach offered a reasonable estimation framework, the extrapolated results are subject to uncertainty due to non-linear hardware behaviors and potential variations in qubit stability and execution latency. Future work should aim to extend this analysis using expanded runtime allocations or hybrid sampling strategies to capture more representative hardware measurements. Additionally, integrating real-time telemetry data from quantum systems such as power draw, cooling overhead, and qubit utilization would enhance the precision of energy modeling. Such advancements would help refine our understanding of true energy costs associated with quantum workloads and improve the fidelity of sustainable quantum AI research. Given the increased complexity and operational variability inherent in modern quantum computing infrastructure, future studies should prioritize empirical validation of energy-to-performance trade-offs on real quantum hardware. Simulated environments, while useful for preliminary benchmarking, cannot fully capture the stochasticity introduced by quantum noise, qubit decoherence, gate fidelity variations, and readout errors. As quantum computing becomes more prevalent and accessible, the study and quantification of the environmental impact becomes all the more important for sustainable AI. In addition, real-time energy monitoring integrated into quantum hardware stacks will be crucial to establishing standardized, cross-platform protocols for measuring carbon impact in future quantum AI workflows. In parallel, ansätz design and optimization should evolve toward hardware-aware and task-adaptive architectures. The findings of this study suggest that more complex circuits do not always yield better outcomes, especially when considering energy and training time. Future work should investigate automated or learning-based ansätz search strategies that co-optimize for complexity, energy efficiency, and robustness to noise. Additionally, a broader group of QML tasks should be evaluated to generalize these insights beyond binary classification. Interdisciplinary approaches that combine quantum compiler optimization, variational algorithm tuning, and environmental modeling may also yield valuable frameworks for developing sustainable and scalable quantum AI strategies. Acknowledgements This research received no specific grant from any funding agency for the submitted work. Abbreviation Artificial Intelligence Central Processing Unit Graphics Processing Unit Gated Recurrent Unit Kullback-Leibler Long Short-Term Memory Quantum Long Short-Term Memory Quantum Neural Network Random Access Memory Recurrent Neural Network Receiver Operating Characteristic - Area Under the Curve Standard Deviation Thermal Design Power NVIDIA Tesla T4 Graphics Processing Unit Author contributions S.T., H.U., and J.S. conceived the experiment, S.T. conducted the experiment, and S.T. and J.S. analyzed the results. All authors reviewed the manuscript. Data availability 1. The open dataset used in this study (N-BaIoT) is publicly available on Kaggle: https://www.kaggle.com/datasets/mkashifn/nbaiot-dataset 2. The code supporting the findings of this study is available from the corresponding author, Sarvapriya Tripathi (strip011@fiu.edu), upon reasonable request. Declarations Competing interests The authors declare no competing interests. Footnotes Publisher’s note Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations. References Associated Data Data Availability Statement 1. The open dataset used in this study (N-BaIoT) is publicly available on Kaggle: https://www.kaggle.com/datasets/mkashifn/nbaiot-dataset 2. The code supporting the findings of this study is available from the corresponding author, Sarvapriya Tripathi (strip011@fiu.edu), upon reasonable request.