Previous Article in Journal
Conceptual Design Based on Modular Platforms for a Prototype of a Functional Growth Chamber for Cuttings in Controlled Agriculture
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Emulation of Variational Quantum Circuits on Embedded Systems for Real-Time Quantum Machine Learning Applications

Department of Electrical and Computer Engineering, Electrical Energy Technology, Aarhus University, Finlandsgade 20, 8200 Aarhus N, Denmark
*
Author to whom correspondence should be addressed.
Designs 2025, 9(4), 87; https://doi.org/10.3390/designs9040087
Submission received: 14 May 2025 / Revised: 27 June 2025 / Accepted: 8 July 2025 / Published: 11 July 2025

Abstract

This paper presents an engineering design framework for integrating Variational Quantum Circuits (VQCs) into industrial control systems via real-time quantum emulation on embedded hardware. In this work, we present a novel framework for fully embedded real-time quantum machine learning (QML), in which a four-qubit, four-layer VQC is both emulated and trained in situ on an FPGA-based embedded platform (dSPACE MicroLabBox 1202). The system achieves deterministic microsecond-scale response at a closed-loop frequency of 100 kHz, enabling its application in latency-critical control tasks. We demonstrate the feasibility of online VQC training within this architecture by approximating nonlinear functions in real time, thereby validating the potential of embedded QML for advanced signal processing and control applications. This approach provides a scalable and practical path toward real-time Quantum Reinforcement Learning (QRL) and other quantum-enhanced embedded controllers. The results validate the feasibility of real-time quantum emulation and establish a structured engineering design methodology for implementing trainable quantum machine learning (QML) models on embedded platforms, thereby enabling the development of deployable quantum-enhanced controllers.

1. Introduction

Quantum computing is emerging as a transformative computational paradigm with the potential to revolutionize design optimization and machine learning-based automation across a wide range of scientific and engineering disciplines [1,2]. Among the most versatile techniques in this emerging field are Variational Quantum Circuits (VQCs), which enable hybrid quantum–classical learning by embedding trainable parameters into quantum gate operations [3]. VQCs serve as the core building blocks of many quantum machine learning (QML) models, facilitating expressive representations that are particularly well suited to supervised learning, reinforcement learning, and quantum-enhanced optimization [4]. Due to their adaptive and parameterized structure, QML models—particularly Quantum Reinforcement Learning (QRL)—hold significant potential for latency-sensitive applications, such as industrial control, robotics, and multi-agent energy systems, in which real-time decision-making is critical [5,6,7,8].
When implemented on classical hardware, QRL offers a deterministic and accessible platform for small-scale quantum-inspired learning, albeit with architectural limitations compared to true quantum devices. Cost-effective classical platforms enable quantum-inspired algorithm prototyping for industrial control without the need for quantum infrastructure, thereby ensuring microsecond-scale responses. However, they lack quantum’s exponential speedup and entanglement, limiting scalability and necessitating hybrid approaches for more advanced QML tasks. While experimental progress continues, current noisy intermediate-scale quantum (NISQ) devices remain constrained in terms of qubit count, gate fidelity, and accessibility, often requiring remote execution via cloud services, which introduces latency and temporal variability [9]. For time-critical applications, such as feedback control or high-bandwidth signal processing, this latency is prohibitive. Conventional CPU- and GPU-based simulators, though effective for algorithmic studies, are generally unsuitable for real-time control tasks that demand control cycles in the order of tens to hundreds of microseconds. Their lack of deterministic execution and poor scalability under embedded constraints present fundamental barriers to integration within control-oriented system architectures [10].
From an engineering design perspective, these limitations underscore the urgent need for dedicated hardware–software co-design strategies that enable real-time inference, in situ learning, and tight integration with physical control loops. Achieving such functionality requires embedded architectures that are not only computationally efficient but also architected to meet strict timing, resource, and energy constraints. Furthermore, the practical deployment of QML models in embedded contexts demands the careful design of data encoding pipelines, interpretable parameter update mechanisms, and modular, scalable circuit representations, each of which forms a distinct layer within a structured QML system design framework [11,12,13].
To address these limitations, the field-programmable gate array (FPGA)-based emulation of quantum circuits has emerged as a promising engineering approach, offering deterministic timing behavior, energy-efficient execution, and tight integration with control hardware for time-critical applications [14]. Unlike noisy intermediate-scale quantum (NISQ) devices, which are constrained by limited qubit counts and cloud-induced latencies, or CPU/GPU simulators, which are hindered by exponential computational costs, FPGAs have enabled high-speed emulation since early efforts, achieving 16-qubit processing [15]. Their configurability and real-time responsiveness make them particularly well suited for control systems with modest qubit requirements, such as those in industrial automation and robotics. In this context, FPGA-based emulation provides a practical design platform for bridging classical control systems with future quantum-enhanced architectures, supporting both algorithm development and physical prototyping [7,16].
Recent advancements in FPGA-based emulation have primarily targeted simple circuits with limited entanglement, such as Clifford + T and rotational gate sets, or basic algorithms like Grover’s search and Shor’s factoring, achieving high-throughput for up to 32 qubits [17,18,19,20,21]. For instance, low-tier FPGAs accelerate circuit verification, and others emulate protocols like B92 quantum key distribution, yet most prioritize scalability and precision over microsecond-scale latency, which is essential for real-time applications [22,23]. Architectures that leverage pipelined execution show promise for throughput optimization but generally rely on static computation kernels or external training, which limits adaptability. Such designs are insufficient for emulating fully entangled and trainable VQCs, which form the computational backbone of QML models [12,13,24]. A fully embedded, real-time framework that simultaneously emulates and trains parameterized VQCs in situ within a high-frequency control loop remains absent, representing a critical gap for dynamic QML tasks in latency-sensitive domains like industrial control [16].
While significant advancements have been made in FPGA-based quantum circuit emulation, most existing works focus on either specific quantum algorithms (e.g., QFT, Grover’s, and QAOA) or large-scale offline simulation frameworks designed for throughput rather than latency [25,26,27]. These implementations, though efficient for verifying quantum protocols or accelerating quantum key distribution, often lack the adaptability needed for dynamic learning tasks. For example, simulators like Qulacs and decision diagram-based engines [28,29] achieve high efficiency for circuit verification and sampling but are unsuitable for microsecond-scale, real-time inference. Moreover, FPGA-based emulators, such as those designed by Mahmud [20,25,27] and Pilch [30], emphasize fixed-pipeline architectures and parallelism, with limited support for in situ learning. These limitations underscore the absence of a comprehensive design methodology for embedded QML systems that integrates real-time learning capabilities with tight computational and hardware constraints.
No existing study has presented a fully embedded framework that enables both the real-time emulation and in situ training of a Variational Quantum Circuit (VQC) on FPGA hardware with microsecond-scale latency. Existing implementations, such as those by Choi et al. [31], propose standalone FPGA-based emulators for algorithms like Grover’s and QAOA but do not incorporate trainable parameters or adaptive feedback mechanisms. Similarly, architectures such as Qu-Trefoil [32] and HPRC-based simulators [27] emphasize large-scale quantum circuit emulation, yet are limited by latency, energy consumption, or the lack of an embedded real-time control functionality. These constraints indicate a critical gap in realizing adaptive, trainable QML models that are suitable for deployment in embedded real-time control applications, where inference and learning must be performed within strict timing requirements.
To address this need, we present a fully embedded design framework for the real-time emulation and online training of a Variational Quantum Circuit (VQC) on an FPGA-based platform (dSPACE MicroLabBox 1202). Our system implements a four-qubit, four-layer VQC with 48 trainable parameters that is entirely mapped onto the FPGA fabric. It operates deterministically at a closed-loop frequency of 100 kHz, without reliance on external processors, making it well suited for latency-critical applications in control, robotics, and signal processing. Crucially, the system supports full in situ training using the parameter shift rule, allowing the VQC to adapt its parameters during live operation. As a proof of concept, we train the circuit in real time to approximate a nonlinear function, demonstrating both the feasibility and potential of embedded quantum machine learning (QML) in real-time control environments. This architecture provides a practical and scalable bridge between classical embedded platforms and future quantum-enhanced controllers, with applications in power electronics, industrial automation, and multi-agent energy systems [16].
This work addresses a critical engineering design problem: how to emulate and train Variational Quantum Circuits (VQCs) within the strict timing, memory, and computational constraints of embedded real-time systems. Our approach provides a structured methodology—including architectural design, algorithm mapping, and optimization criteria—that enables VQC-based controllers to be deployed in latency-sensitive environments, such as robotics, power systems, and industrial automation.
The rest of this paper is organized as follows: Section 2 reviews matrix-based quantum simulation techniques that motivate the chosen real-time implementation. Section 3 details the encoding, evolution, and decoding stages executed on the FPGA platform. Section 4 presents the in situ training algorithm based on the parameter-shift rule. Section 5 reports the experimental results obtained at a 100 kHz sampling rate, and Section 6 draws conclusions and outlines future research directions.

2. Analytical Simulation of Quantum Computing

2.1. Quantum Computing Basics

Quantum computing signifies a groundbreaking shift in computational capabilities, utilizing quantum mechanics to handle information in ways that classical computers cannot. This introduction presents essential concepts of quantum computing, such as qubits, quantum circuits, entanglement, and the process of quantum computation, while emphasizing their potential impact on ML applications. As an emerging field, quantum computing harnesses the principles of quantum mechanics to conduct calculations and address problems. Unlike classical computers, which rely on bits (binary digits) for information processing, quantum computers utilize qubits (quantum bits) [33]. This key distinction enables quantum computers to process information in ways that are exponentially more powerful than classical computers for certain specific tasks.
The fundamental unit of quantum computing is the qubit, the quantum counterpart to the classical bit. Unlike classical bits, which can only be in a state of 0 or 1, qubits can be in a superposition, representing both 0 and 1 at the same time [34]. This characteristic, combined with entanglement and quantum interference principles, enables quantum computers to handle large amounts of information simultaneously. This parallel processing capability is described mathematically in (1) and is key to the potential speed and efficiency of quantum computing.
ψ = α 0 + β 1
In quantum computing, qubits are represented by complex numbers α and β , which must adhere to the normalization condition α 2 + β 2 = 1 . This condition ensures that the probabilities of the qubit being in either state 0 or 1 sum to 1.
The ability of qubits to exist in superposition states, where α and β are non-zero, allows them to perform multiple calculations simultaneously, leading to a substantial increase in computational power. The state of a qubit can be graphically represented on the Bloch sphere, as shown in Figure 1, with the north and south poles corresponding to the basis states 0 and 1 , respectively. Any point on the surface of the Bloch sphere represents a valid superposition state of the qubit.
The systems with multiple qubits are expressed as the Kronecker product of individual qubit states as follows:
φ = ψ 1 ψ 2 ψ n = x = 00 0 11 1 C x x
where n is the number of qubits, and C x represents complex coefficients, as follows:
x = 00 0 11 1 C x 2 = 1

2.2. Quantum Gates

Quantum gates are the building blocks of quantum circuits and are similar to classical logic gates. They are represented by unitary matrices that operate on qubits. Rotation gates, which perform rotations around the X, Y, and Z axes of the Bloch sphere representation of a qubit, can be represented as (8).
The Controlled-NOT (CNOT) gate, shown in (9), is a two-qubit gate that flips the second qubit (target qubit) if and only if the first qubit (control qubit) is in the state 1 . The CNOT gate is particularly important because, together with single-qubit gates, it forms a universal set of quantum gates, meaning any quantum operation can be approximated to arbitrary precision using only these gates.
R X θ = cos θ 2 i sin θ 2 i sin θ 2 cos θ 2 R Y θ = cos θ 2 sin θ 2 sin θ 2 cos θ 2 R Z θ = e i θ 2 0 0 e i θ 2
C N O T = 1 0 0 1 0 0 0 0 0 0 0 0 0 1 1 0

2.3. Multiple-Qubit Systems

Applying a quantum gate to a single qubit can be extended to the entire system using the tensor product formalism in a multi-qubit quantum system. This approach is essential for defining localized quantum operations within multi-qubit systems, whether the system’s state is separable or entangled. Specifically, to apply a quantum gate, F , to a single qubit while leaving the other qubits unchanged, the operator, F , is combined with identity matrices, I , which correspond to the unaffected qubits, via the tensor product. The resulting operator acts on the entire system, ensuring that the gate, F , modifies only the target qubit without altering the states of the others.
For an N -qubit system, the operator, F , is applied to the k -th qubit by constructing the composite operator F k = I F I , where F k occupies the k -th position in the tensor product. This framework allows for the precise targeting of individual qubits, thereby facilitating operations in both separable and entangled states.
Figure 2 provides a modular gate-level toolbox for VQC construction, enabling system designers to select, configure, and cascade quantum-inspired blocks based on application needs. The figure exemplifies this with an N -qubit system, where a single-qubit gate, F , is extended to a two-qubit system using the tensor product, F I . This operation applies F exclusively to the first qubit, leaving the second qubit unchanged. This preserves the integrity of the multi-qubit system while achieving localized control.

2.4. Quantum State Measurement

Quantum measurement in quantum mechanics involves projecting a quantum system’s state onto an eigenstate of the measured observable, with outcomes determined probabilistically. The expectation value of an observable A A , denoted A , is the average result over many measurements on identical states, defined as A = ψ | A | ψ for a state | ψ . Expectation values reveal properties like the probability of measuring specific basis states for qubits, making them essential for quantum computations.
The Pauli Z operator, which is used for measurements on a computational basis, is defined as follows:
Z = 1 0 0 1
For a qubit state ψ = α | 0 + β | 1 , represented as the column vector α β , the expectation value Z is computed as follows:
Z = α * β * 1 0 0 1 α β = | α | 2 | β | 2
In multi-qubit systems, Z i acts on the i -th qubit, with Z i depending on its reduced state.

3. Emulation of VQCs

Quantum Neural Networks (QNNs) integrate the principles of quantum computing with artificial neural networks, utilizing superposition, interference, and entanglement to create more efficient algorithms. A key element of QNNs is Variational Quantum Circuits (VQCs), which use parameterized quantum gates tailored for distinct tasks. VQCs can be trained through gradient-based optimization [35] or metaheuristic approaches [36], enabling the development of quantum machine learning models for various applications, such as reinforcement learning.
In real-time quantum machine learning, embedded systems like Speedgoat and dSPACE outperform offline simulators such as PennyLane, which face latency issues. These embedded platforms run simulations directly on hardware, providing the low latency and high reliability that are crucial for real-time applications.
Real-time applications, particularly in control systems, often involve a limited number of inputs and typically only one or two outputs. Since each input is encoded into a qubit, the number of required qubits in such applications remains modest. This constraint enables embedded systems to effectively and analytically simulate quantum circuits in real time. Consequently, embedded platforms present a promising opportunity to test and evaluate the performance of quantum algorithms in real-time scenarios.
Our approach demonstrates precise, real-time simulation without delays or network integration issues, enhancing responsiveness to dynamic control needs. The adaptable nature of embedded systems allows for quick reconfiguration to accommodate changing VQC setups, providing unmatched versatility compared to remote simulators.

3.1. Matrix-Based VQCs

Figure 3 outlines the configurable VQC design procedure, including the selection of qubit size, layer depth, and entanglement scheme, forming the basis for rapid prototyping of QML architectures in embedded environments. As can be seen in this figure, in order to emulate a VQC based on the real-time analytical simulation of quantum computing, the embedded system executes the quantum circuit, with all quantum gates implemented using their matrix representations, as detailed in Section 3, to generate a quantum-driven signal as follows:
  • State Preparation: The input states, including the input voltage, inductor current, and output voltage, are processed through functions f i n x to generate parameter angles θ . These angles are then encoded into quantum states using parameterized rotation gates within the encoding layer.
  • Tensor Product and Parameterization Layers: The encoded states undergo tensor product operations and pass through multiple parameterization layers. Each layer consists of CNOT and rotation gates that manipulate the qubit states according to the trained VQC model. This structure ensures that the qubits capture nonlinear relationships within the input data.
  • Measurement and Output: After passing through the parameterization layers, the qubit states are measured to generate expectation values, E V i , which are transformed into control actions, a i = f o u t E V i . These control actions determine the quantum-derived action.
  • Closed-Loop Feedback: The system integrates real-time feedback, where the plant’s output is continuously monitored and fed back into the VQC, ensuring dynamic adjustments to maintain optimal performance.

3.2. Quantum State Encoding Procedure

The encoding layer of a VQC typically includes rotation gates that prepare qubits to match the states of input data. Figure 4a illustrates quantum state encoding. As can be seen in this figure, classical input data is transformed into quantum states by an X or Y rotation gate, where the angle corresponds to the input data. A Z-axis rotation also eliminates the global phase effect, preserving relative phase information [37,38].

3.3. Quantum State Decoding Procedure

In the final stage of the VQC, the expectation value (EV) of each qubit can be measured along the Z-axis. However, the output of the VQC can be decoded to map any desired function, as shown in Figure 4b.

4. Real-Time Quantum Machine Learning Design and Deployment

Real-time quantum machine learning (RT-QML) involves the use of VQCs on embedded systems to enable fast, adaptive decision-making. This section presents the end-to-end pipeline: from data encoding to circuit optimization and real-time control signal decoding. In this work, we develop and demonstrate a real-time VQC approximator, which is shown in Figure 5 as a supervised quantum machine learning example—specifically, fitting a known target function f ( x ) —to showcase the feasibility and capabilities of our proposed real-time embedded simulation framework. While the methodology is general and can be extended to reinforcement learning or unsupervised tasks, the supervised case provides a clear, interpretable benchmark for evaluating performance, training efficiency, and hardware responsiveness.

4.1. Objective Function and Training Procedure

In this supervised learning setting, the quantum model, y ( x ;   θ ,   a ) = a   Z 1 ( x ;   θ )   , aims to approximate a known function, such as f ( x ) , by minimizing the mean squared error as follows:
J θ , a = 1 N i = 1 N ( f x i a Z 1 x i ; θ ) 2
where θ R N Q N L N G are the trainable VQC parameters, ( N Q qubits × N L layers × N G gate angles), and a is a learnable scaling factor. Training is performed using gradient descent [35].

4.2. Quantum State Encoding

Each input, x x m i n , x m a x , is first normalized and then encoded using quantum rotation gates as follows:
x n = x x m i n x m a x x m i n
Then, the normalized input is mapped into rotation angles of the encoding layer using encoding functions as follows [35]:
θ i 0 Y = A r c s i n x n θ i 0 Z = A r c s i n x n 2
These angles are applied across four qubits using RY and RZ gates, forming the input state for the quantum circuit.

4.3. VQC Architecture and Optimization

The encoded input state is processed through N L layers of the VQC. Each layer consists of a fixed pattern of entangling CNOT gates, followed by parameterized single-qubit rotations (RX, RY, and RZ). This structure enables the VQC to represent a broad class of complex functions.
To optimize the VQC, the parameters, θ i , associated with the rotation gates are updated based on the gradient descent method. Specifically, gradients with respect to each θ i are computed using the parameter-shift rule as follows [35]:
f θ θ i = f θ i + π 2 f θ i π 2 2
The computed gradients are then used to update the parameters as follows:
θ i θ i η J θ i
where η is the learning rate, and J is the cost function defined to measure the difference between the VQC output and the target reference signal. Through this iterative optimization process, the VQC progressively improves its approximation of the desired function.
In this system, the entire optimization is performed in real time. The input and reference signals are streamed continuously, while the VQC parameters are updated on the fly using the gradient descent method. This enables the circuit to adapt its parameters dynamically and achieve optimal performance over time.

4.4. Output Decoding and Control Integration

After the final VQC layer, a quantum measurement is performed on the first qubit. The resulting expectation value, Z 1 , is scaled by a and serves as the output, which is a real-time quantum-driven signal, as follows:
y = a   Z 1

4.5. Pseudocode

The real-time training procedure on the dSPACE MicroLabBox 1202 has been described in Algorithm 1, where ( θ R 48 ) represents the VQC rotation parameters, ( a R ) is the scaling factor, and the objective is to minimize (8) with ( N = 20 ) . All operations are constrained to the 10 µs cycle. This algorithm can be interpreted as a generalized design procedure for training QML models in embedded systems, specifying the architectural steps and timing constraints necessary for online learning with VQCs.
Algorithm 1 Pseudocode for the design procedure of the real-time VQC training algorithm
001. 1. Initialization:
002.    - Randomly initialize θ U π , π 48 , a U 0,3 , and i t e r a t i o n = 0 on FPGA
003.    - Set m a x i t t e r = 100 , s a m p l e r a t e = 100   k H z (10 µs cycle), T = 0.1 s , N samples = 10,000 , N = 20
004. 2. Signal Sampling:
005.    - Initialize buffer B in FPGA memory for current 100 ms period // 10 Hz, 2 Vpp sawtooth
006.    - Generate input samples within 10 µs cycle:
007.      - x t = 2 t 10 m o d 1 1
008.      - f x = cos 2 π 10 t
009.    - If the new period starts at ( t   m o d   T = 0 ) :
010.      - i n d i c e s = l i n s p a c e 0 , ( N samples 1 ) , ( N )
011.      - x = x t indices
012.      - f x = f x indices
013.      - Store x , f x in B
014. 3. VQC Output Computation:
015.    - For i = 1 to N :
016.      - x n , i = x i + 1 2
017.      - Encode State:
018.        - θ Y , i = arcsin x n , i
019.        - θ Z , i = arccos x n , i 2
020.        - Initialize ψ i = 0 4
021.        - For q = 1 to 4 :
022.          - ψ i R Y θ Y , i R Z θ Z , i ψ i on qubit q 023.      - Apply VQC:
024.        - For l = 1 to 4 :
025.        - For q = 1 to 3 :
026.            - Apply CNOT on qubits q , q + 1 to ψ i
027.        - Apply CNOT on qubits 4,1 to ψ i
028.          - Apply rotations: ψ i R X θ l , q , 1 R Y θ l , q , 2 R Z θ l , q , 3 ψ i for all q = 1 to 4
029.      - Z 1 i = Tr ( ψ i ψ i Z 1
030.      - y i = a Z 1 i
031. 4. Error Computation:
032.    - Compute MSE: J θ , a = 1 N i = 1 N f x i y i 2
033. 5. Parameter Update:
034.    - If iteration < max_iterations:
035.      - For j = 1 to 48 :
036.        - θ + = θ , θ + j = θ j + π 2
037.        - θ = θ , θ j = θ j π 2
038.        - J + = 1 N i = 1 N f x i a Z 1 x n , i ; θ + 2
039.        - J = 1 N i = 1 N f x i a Z 1 x n , i ; θ 2
040.        - J θ j = J + J 2
041.      - Update θ : θ θ η θ J , where η = 0.01
042.      - Update a :
043.        - δ = 0.01
044.        - J a + = 1 N i = 1 N f x i a + δ Z 1 x n , i ; θ 2
045.        - J a = 1 N i = 1 N f x i a δ Z 1 x n , i ; θ 2
046.        - J a = J a + J a 2 δ
047.        - a a η J a
048.      - i t e r a t i o n i t e r a t i o n + 1
049.    - Else:
050.      - Output Generation:
051.        - For i = 1 t o N :
052.          - x n , i = x i + 1 2
053.          - θ Y , i = arcsin x n , i , θ Z , i = arccos x n , i 2
054.          - Initialize ψ i = 0 4
055.          - For q = 1 t o 4 :
056.             ψ i R Y θ Y , i R Z θ Z , i ψ i on qubit q
057.          - For l = 1 to 4 :
058.            - For q = 1 to 3 :
059.              - Apply CNOT on qubits q , q + 1 to ψ i
060.            - Apply CNOT on qubits 4,1 to ψ i
061.            - Apply rotations : ψ i R X θ l , q , 1 R Y θ l , q , 2 R Z θ l , q , 3 ψ i for all q = 1 to 4
062.          - Z 1 i = Tr ( ψ i ψ i Z 1
063.          - y i = a Z 1 i
064.          - s e n d t o o u t p u t y i




// 10 Hz, 2 Vpp sawtooth
// 10 Hz cosine reference

// Select 20 samples
// Uniform samples in ( 1 , 1 )
// Reference cosine samples


// Within 10 µs cycle
// Normalize to 0 , 1

// Compute θ 0 Y for encoding
// Compute θ 0 Z for encoding
// 4-qubit state
// Apply R Y and R Z to each qubit


// Apply 4 layers




// Measure expectation on qubit 1
// VQC output



// Parallelized on FPGA




// Parameter-shift rule

// Gradient descent









// Within 10 µs cycle



// Apply encoding rotations

// Apply VQC layers






// Output real-time signal

5. Experimental Results

This section validates the proposed VQC design framework in terms of latency, accuracy, and hardware resource efficiency, benchmarking the architecture against its design goals. To demonstrate the functionality of the proposed emulation method, a real-time VQC approximator, shown in Figure 5, has been implemented on an embedded system (dSPACE MicroLabBox 1202) as an RT-QML. For FPGA-level representation, an HDL Coder was used to generate VHDL code for the controller subsystem, providing a hardware-synthesizable logic design for high-speed operation. As shown in this figure, the system includes a function generator that produces a sawtooth signal as a repetitive input for the VQC and a reference function, which is a cosine function in this case. The emulated VQC, which is depicted in Figure 6, has 48 trainable parameters (4 qubits × 4 layers × 3 gate angles). The experimental setup is shown in Figure 7. The function generator generates a 10 Hz (100 ms period), 2 Vpp sawtooth waveform as the input of the VQC approximator implemented in MicroLabBox. The input waveform is sampled every 10 µs, and the corresponding output is emulated at the same rate in real time. The training was executed in real time, and to ensure that the approximated function is distinguishable from the exact function, deliberately limited precision was considered by setting the training iteration number to 100.
The real-time emulation was deployed on the dSPACE MicroLabBox 1202 platform, which integrates an FPGA and a real-time processor that are suitable for signal processing and embedded control tasks. The key specifications include:
  • Processor: NXP QorlQ P5020, dual-core, 2 GHz;
  • FPGA: Xilinx Kintex-7 (XC7K325T);
  • I/O Interface: Analog inputs for signal injection and digital/PWM outputs for external device interfacing.
The real-time link between the function generator and the embedded system transmits input and reference function values at a 100 kHz sampling frequency. These values are used to encode the input into the VQC and to update its parameters through gradient descent. The VQC parameters are trained in real time using the block diagram shown in Figure 5 and the procedure outlined in Algorithm 1. After 100 periods of the input signal (corresponding to 100 optimization iterations, or T = 100 × 1 10   H z = 10 s), the resulting real-time output of the trained VQC is shown in Figure 8. This optimized result approximates the cosine function with the desired precision, which reflects a design trade-off between computational complexity and response time that guides design decisions for resource-limited deployments.
The rotation angles of the VQC approximator during each training epoch were extracted from the MICROLABBOX, and the corresponding VQC was simulated offline in MATLAB/Simulink 2024a for different rotation angle sets using the same functions employed in the real-time implementation, as shown in Figure 9a. In this figure, the gray markers indicate the training trajectory of the VQC, which gradually turn black as they approach the optimal solution. The blue curve represents the analytical target function, c o s ( x ) , while the red curve depicts the final trained VQC output. To further validate the real-time training results, the optimally trained parameters, which are listed in Table 1, were also used to simulate the optimal VQC approximator using the PENNYLANE Python library [39], as shown in Figure 9b. The close agreement between the MATLAB/Simulink 2024a and PENNYLANE 0.41.1 results confirms the accuracy of the proposed matrix-based real-time emulation framework and demonstrates the feasibility of embedded quantum emulators for real-time signal generation.
While a direct quantitative comparison to previous works is challenging due to the novelty of this approach, it is worth highlighting the key distinctions of our system. Most existing FPGA-based quantum circuit emulations have focused on fixed kernels or shallow circuits with limited entanglement, targeting algorithms such as Grover’s search or simple quantum arithmetic [8,9,10,11]. In contrast, our implementation realizes a fully parameterized, fully entangled four-qubit, four-layer Variational Quantum Circuit (VQC), achieving real-time closed-loop operation and in situ training entirely on embedded hardware. To our knowledge, this is the first demonstration of such a system running VQC-based control at 100 kHz with deterministic latency. Furthermore, our results showcase the practical potential of VQCs as real-time adaptive controllers—a role traditionally dominated by classical neural networks—thereby positioning VQCs as a competitive architecture for future industrial control and signal processing applications.

6. Conclusions

This study validates the feasibility of real-time quantum machine learning (QML) in embedded systems, demonstrating a fully embedded design framework for Variational Quantum Circuit (VQC) emulation and training on the dSPACE MicroLabBox 1202. Our architecture, which implements a four-qubit, four-layer VQC with 48 trainable parameters, achieves a 100 kHz closed-loop frequency with deterministic microsecond-scale responses. Real-time training to approximate a cosine waveform yields a root mean square error (RMSE) below 3% within 100 iterations (10 s). Unlike prior FPGA-based emulations focused on fixed kernels or external training [8,19], our in situ training supports dynamic QML tasks, positioning VQCs as viable real-time adaptive controllers.
This paper introduces and validates an engineering design framework for emulating and training Variational Quantum Circuits (VQCs) on embedded systems in real time. Our contributions include the specification of design steps, architectural integration, and timing validation, offering a scalable path toward the practical deployment of quantum machine learning in latency-critical control systems. Future directions include expanding the toolbox for larger-scale QML designs, transitioning from FPGA to ASIC-based quantum-inspired processors, and scaling up to larger qubit counts and deeper circuits, thereby optimizing computational pipelines for enhanced efficiency. Potential applications include real-time Quantum Reinforcement Learning (QRL) in multi-agent energy systems, optimizing profit distribution for equitable resource allocation [16], and risk-aware control in stochastic energy networks using thermodynamic models [40]. The coordinated optimization of electric and heating systems via balancing multi-domain constraints offers another promising avenue [41]. By bridging classical embedded platforms and quantum-inspired control, this framework lays the foundation for the industrial adoption of QML in latency-critical domains like robotics, power electronics, and energy systems.

Author Contributions

A.M.: Conceptualization, Software, Validation, Writing—original draft; U.J.: Supervision, Writing—review & editing; M.H.K.: Methodology, Supervision, Writing—review & editing. All authors have read and agreed to the published version of the manuscript.

Funding

Aarhus University Research Foundation, AUFF-E-2023-9-60.

Data Availability Statement

The raw data supporting the conclusions of this article will be made available by the authors on request.

Conflicts of Interest

The authors declare no conflicts of interest.

References

  1. Gyongyosi, L.; Imre, S. A survey on quantum computing technology. Comput. Sci. Rev. 2019, 31, 51–71. [Google Scholar] [CrossRef]
  2. LaPierre, R. Introduction to Quantum Computing; Springer Nature: Luxembourg, 2021. [Google Scholar]
  3. Chen, S.Y.-C.; Yang, C.-H.H.; Qi, J.; Chen, P.-Y.; Ma, X.; Goan, H.-S. Variational quantum circuits for deep reinforcement learning. IEEE Access 2020, 8, 141007–141024. [Google Scholar] [CrossRef]
  4. Du, Y.; Huang, T.; You, S.; Hsieh, M.-H.; Tao, D. Quantum circuit architecture search for variational quantum algorithms. Npj Quantum Inf. 2022, 8, 62. [Google Scholar] [CrossRef]
  5. Cirstoiu, C.; Holmes, Z.; Iosue, J.; Cincio, L.; Coles, P.J.; Sornborger, A. Variational fast forwarding for quantum simulation beyond the coherence time. Npj Quantum Inf. 2020, 6, 82. [Google Scholar] [CrossRef]
  6. McArdle, S.; Jones, T.; Endo, S.; Li, Y.; Benjamin, S.C.; Yuan, X. Variational ansatz-based quantum simulation of imaginary time evolution. Npj Quantum Inf. 2019, 5, 75. [Google Scholar] [CrossRef]
  7. Vanderbauwhede, W.; Benkrid, K. High-Performance Computing Using FPGAs; Springer: Berlin/Heidelberg, Germany, 2013. [Google Scholar]
  8. El-Araby, E.; Mahmud, N.; Jeng, M.J.; MacGillivray, A.; Chaudhary, M.; Nobel, M.A.I.; Riachi, A.E. Towards complete and scalable emulation of quantum algorithms on high-performance reconfigurable computers. IEEE Trans. Comput. 2023, 72, 2350–2364. [Google Scholar] [CrossRef]
  9. Liu, X.-Y.; Zhang, Z. Classical simulation of quantum circuits: Parallel environments and benchmark. Adv. Neural Inf. Process. Syst. 2023, 36, 67082–67102. [Google Scholar]
  10. Jones, T.; Brown, A.; Bush, I.; Benjamin, S.C. QuEST and high performance simulation of quantum computers. Sci. Rep. 2019, 9, 10736. [Google Scholar] [CrossRef]
  11. Suzuki, Y.; Kawase, Y.; Masumura, Y.; Hiraga, Y.; Nakadai, M.; Chen, J.; Nakanishi, K.M.; Mitarai, K.; Imai, R.; Tamiya, S. Qulacs: A fast and versatile quantum circuit simulator for research purpose. Quantum 2021, 5, 559. [Google Scholar] [CrossRef]
  12. Cerezo, M.; Verdon, G.; Huang, H.-Y.; Cincio, L.; Coles, P.J. Challenges and opportunities in quantum machine learning. Nat. Comput. Sci. 2022, 2, 567–576. [Google Scholar] [CrossRef]
  13. Tychola, K.A.; Kalampokas, T.; Papakostas, G.A. Quantum machine learning—An overview. Electronics 2023, 12, 2379. [Google Scholar] [CrossRef]
  14. Li, H.; Pang, Y. FPGA-accelerated quantum computing emulation and quantum key distillation. IEEE Micro 2021, 41, 49–57. [Google Scholar] [CrossRef]
  15. Fujishima, M.; Saito, K.; Hoh, K. 16-qubit quantum-computing emulation based on high-speed hardware architecture. Jpn. J. Appl. Phys. 2003, 42, 2182. [Google Scholar] [CrossRef]
  16. Ding, B.; Li, Z.; Li, Z.; Xue, Y.; Chang, X.; Su, J.; Sun, H. Cooperative Operation for Multiagent Energy Systems Integrated With Wind, Hydrogen, and Buildings: An Asymmetric Nash Bargaining Approach. IEEE Trans. Ind. Inform. 2025, 21, 6410–6421. [Google Scholar] [CrossRef]
  17. Belfore, I.; Lee, A. A Scalable FPGA Architecture for Quantum Computing Simulation. arXiv 2024, arXiv:2407.06415. [Google Scholar]
  18. Bag, K.; Goswami, M.; Kandpal, K. FPGA based resource efficient simulation and emulation of Grover’s search algorithm. In Proceedings of the 2022 IEEE 19th India Council International Conference (INDICON), Kochi, India, 24–26 November 2022; pp. 1–6. [Google Scholar]
  19. Conti, C.; Volpe, D.; Cirillo, G.A.; Graziano, M.; Zamboni, M.; Turvani, G. Towards Quantum Circuit Emulation on Low-Tier FPGAs. In Proceedings of the 2024 IEEE International Conference on Quantum Computing and Engineering (QCE), Montreal, QC, Canada, 15–20 September 2024; Volume 2, pp. 512–513. [Google Scholar]
  20. Mahmud, N.; Haase-Divine, B.; Kuhnke, A.; Rai, A.; MacGillivray, A.; El-Araby, E. Efficient computation techniques and hardware architectures for unitary transformations in support of quantum algorithm emulation. J. Signal Process. Syst. 2020, 92, 1017–1037. [Google Scholar] [CrossRef]
  21. Waidyasooriya, H.M.; Oshiyama, H.; Kurebayashi, Y.; Hariyama, M.; Ohzeki, M. A scalable emulator for quantum fourier transform using multiple-fpgas with high-bandwidth-memory. IEEE Access 2022, 10, 65103–65117. [Google Scholar] [CrossRef]
  22. Mujahid, U.; Khalid, M.; Najam-ul-Islam, M. FPGA Based Emulation of B92 QKD Protocol. In Proceedings of the 2023 57th Annual Conference on Information Sciences and Systems (CISS), Baltimore, MD, USA, 22–24 March 2023; pp. 1–5. [Google Scholar]
  23. Suzuki, T.; Miyazaki, T.; Inaritai, T.; Otsuka, T. Quantum AI simulator using a hybrid CPU–FPGA approach. Sci. Rep. 2023, 13, 7735. [Google Scholar] [CrossRef]
  24. Tomar, S.; Tripathi, R.; Kumar, S. Comprehensive Survey of QML: From Data Analysis to Algorithmic Advancements. arXiv 2025, arXiv:2501.09528. [Google Scholar]
  25. Mahmud, N.; El-Araby, E.; Caliga, D. caling reconfigurable emulation of quantum algorithms at high precision and high throughput. Quantum Eng. 2019, 1, e19. [Google Scholar] [CrossRef]
  26. Lee, Y.H.; Khalil-Hani, M.; Marsono, M.N. An FPGA-Based Quantum Computing Emulation Framework Based on Serial-Parallel Architecture. Int. J. Reconfigurable 2016, 2016, 5718124. (In English) [Google Scholar] [CrossRef]
  27. Mahmud, N.; El-Araby, E. A scalable high-precision and high-throughput architecture for emulation of quantum algorithms. In Proceedings of the 2018 31st IEEE International System-on-Chip Conference (SOCC), Arlington, VA, USA, 4–7 September 2018; pp. 206–212. [Google Scholar]
  28. Hillmich, S.; Markov, I.L.; Wille, R. Just Like the Real Thing: Fast Weak Simulation of Quantum Computation. In Proceedings of the 2020 57th ACM/IEEE Design Automation Conference (DAC), San Francisco, CA, USA, 20–24 July 2020. (In English). [Google Scholar] [CrossRef]
  29. Vinkhuijzen, L.; Coopmans, T.; Elkouss, D.; Dunjko, V.; Laarman, A. LIMDD: A decision diagram for simulation of quantum computing including stabilizer states. Quantum 2023, 7, 1108. [Google Scholar] [CrossRef]
  30. Pilch, J.; Długopolski, J. An FPGA-based real quantum computer emulator. J. Comput. Electron. 2019, 18, 329–342. [Google Scholar] [CrossRef]
  31. Choi, S.; Lee, W. Developing a Grover’s quantum algorithm emulator on standalone FPGAs: Optimization and implementation. AIMS Math. 2024, 9, 30939–30971. [Google Scholar] [CrossRef]
  32. Wei, K.; Amano, H.; Niwase, R.; Yamaguchi, Y.; Miyoshi, T. Qu-Trefoil: Large-scale Quantum Circuit Simulator Working on FPGA with SATA Storages. IEEE Trans. Comput. 2024, 74, 1306–1321. [Google Scholar] [CrossRef]
  33. Bergou, J.A.; Hillery, M.; Saffman, M. Quantum Information Processing; Springer: Berlin/Heidelberg, Germany, 2021. [Google Scholar]
  34. Benedetti, M.; Lloyd, E.; Sack, S.; Fiorentini, M. Parameterized quantum circuits as machine learning models. Quantum Sci. Technol. 2019, 4, 043001. [Google Scholar] [CrossRef]
  35. Mitarai, K.; Negoro, M.; Kitagawa, M.; Fujii, K. Quantum circuit learning. Phys. Rev. A 2018, 98, 032309. [Google Scholar] [CrossRef]
  36. Chen, S.Y.-C. Evolutionary optimization for designing variational quantum circuits with high model capacity. arXiv 2024, arXiv:2412.12484. [Google Scholar]
  37. Dong, D.; Chen, C.; Chen, Z. Quantum reinforcement learning. In Proceedings of the International Conference on Natural Computation, Changsha, China, 27–29 August 2005; pp. 686–689. [Google Scholar]
  38. Meyer, N.; Ufrecht, C.; Periyasamy, M.; Scherer, D.D.; Plinge, A.; Mutschler, C. A survey on quantum reinforcement learning. arXiv 2022, arXiv:2211.03464. [Google Scholar]
  39. Bergholm, V.; Izaac, J.; Schuld, M.; Gogolin, C.; Ahmed, S.; Ajith, V.; Alam, M.S.; Alonso-Linaje, G.; AkashNarayanan, B.; Asadi, A. Pennylane: Automatic differentiation of hybrid quantum-classical computations. arXiv 2018, arXiv:1811.04968. [Google Scholar]
  40. Zhai, X.Y.; Li, Z.N.; Li, Z.M.; Xue, Y.X.; Chang, X.Y.; Su, J.; Jin, X.L.; Wang, P.; Sun, H.B. Risk-averse energy management for integrated electricity and heat systems considering building heating vertical imbalance: An asynchronous decentralized approach. Appl. Energy 2025, 383, 125271. (In English) [Google Scholar] [CrossRef]
  41. Du, Y.; Xue, Y.; Wu, W.; Shahidehpour, M.; Shen, X.; Wang, B.; Sun, H. Coordinated planning of integrated electric and heating system considering the optimal reconfiguration of district heating network. IEEE Trans. Power Syst. 2023, 39, 794–808. [Google Scholar] [CrossRef]
Figure 1. Bloch sphere.
Figure 1. Bloch sphere.
Designs 09 00087 g001
Figure 2. Fundamental modules for the analytical simulation of VQCs on classical computers.
Figure 2. Fundamental modules for the analytical simulation of VQCs on classical computers.
Designs 09 00087 g002
Figure 3. Matrix-based emulation of a VQC.
Figure 3. Matrix-based emulation of a VQC.
Designs 09 00087 g003
Figure 4. Encoding procedure. (a) Encoding layer, (b) decoding layer.
Figure 4. Encoding procedure. (a) Encoding layer, (b) decoding layer.
Designs 09 00087 g004
Figure 5. Real-time VQC approximator.
Figure 5. Real-time VQC approximator.
Designs 09 00087 g005
Figure 6. The emulated 4-qubit, 4-layer VQC.
Figure 6. The emulated 4-qubit, 4-layer VQC.
Designs 09 00087 g006
Figure 7. Experimental setup.
Figure 7. Experimental setup.
Designs 09 00087 g007
Figure 8. Real-time emulation of an optimally trained VQC.
Figure 8. Real-time emulation of an optimally trained VQC.
Designs 09 00087 g008
Figure 9. Offline simulation of the real-time trained VQC. (a) Result of MATLAB/Simulink 2024a functions used in real-time implementation, (b) result of the PENNYLANE 0.41.1 Python library.
Figure 9. Offline simulation of the real-time trained VQC. (a) Result of MATLAB/Simulink 2024a functions used in real-time implementation, (b) result of the PENNYLANE 0.41.1 Python library.
Designs 09 00087 g009
Table 1. Final trained rotation angles of the VQC (degrees).
Table 1. Final trained rotation angles of the VQC (degrees).
LayerQubitRX (°)RY (°)RZ (°)
10−9.958−15.93418.123
1−26.75791.673−43.934
28.9381108.1884.763
3−79.383105.8322.701
20−62.6345.751−7.4886
1168.5143.482−102.18
2116.4−122.5699.826
333.988−89.244−99.064
30−104.04−108.13138.78
1−107.76148.22180
2−108.62−21.4−22.007
3−10.863−124−140
40−83.42354.351−73.195
1−32.85976.037−65.237
234.16−100.17−27.301
3−85.606−137.732.8304
Optimized scaling factor a = 2.1515
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Masoudian, A.; Jakobsen, U.; Khooban, M.H. Emulation of Variational Quantum Circuits on Embedded Systems for Real-Time Quantum Machine Learning Applications. Designs 2025, 9, 87. https://doi.org/10.3390/designs9040087

AMA Style

Masoudian A, Jakobsen U, Khooban MH. Emulation of Variational Quantum Circuits on Embedded Systems for Real-Time Quantum Machine Learning Applications. Designs. 2025; 9(4):87. https://doi.org/10.3390/designs9040087

Chicago/Turabian Style

Masoudian, Ali, Uffe Jakobsen, and Mohammad Hassan Khooban. 2025. "Emulation of Variational Quantum Circuits on Embedded Systems for Real-Time Quantum Machine Learning Applications" Designs 9, no. 4: 87. https://doi.org/10.3390/designs9040087

APA Style

Masoudian, A., Jakobsen, U., & Khooban, M. H. (2025). Emulation of Variational Quantum Circuits on Embedded Systems for Real-Time Quantum Machine Learning Applications. Designs, 9(4), 87. https://doi.org/10.3390/designs9040087

Article Metrics

Back to TopTop