Skip to main content
Scientific Reports logoLink to Scientific Reports
. 2026 Jun 23;16:19535. doi: 10.1038/s41598-026-57304-9

NQQR: scalable qutrit image representation

Mirna Rofail 1,✉, Rasha Montaser 2,#, Ahmed Younes 1,3,#
PMCID: PMC13291318  PMID: 42337274

Abstract

Ternary quantum image processing (TQIP) integrates qutrit-based quantum computing with image representation, offering a promising pathway for efficient image encoding models. This paper introduces Novel Qutrit Quantum Representation (NQQR) model, a scalable and optimized ternary model for representing grayscale and RGB images of size Inline graphic in a ternary quantum system. The proposed model encodes pixel positions using the superposition of 2n qutrits and assigns grayscale or color intensity values using 6 qutrits, while an additional color qutrit and an ancilla qutrit are employed to reduce the complexity of multi-controlled N-qutrit gates, thereby lowering the overall quantum cost. Experimental results show that the NQQR achieves a time complexity of Inline graphic and the optimized NQQR model significantly reduces quantum cost, with improvements up to Inline graphic for grayscale images and Inline graphic for RGB images when compared to equivalent non-optimized qubit/qutrit-based encoding models. In addition, the performance of the proposed model is evaluated under quantum depolarizing noise using MSE and PSNR metrics computed between the original and reconstructed images under different noise levels. These results demonstrate the efficiency and scalability of the proposed NQQR model at the representation level and suggest its potential as a building block for future research in TQIP.

Supplementary Information

The online version contains supplementary material available at 10.1038/s41598-026-57304-9.

Keywords: Ternary quantum systems, Ternary quantum image processing, Quantum image representation, Qutrit-based quantum computing, Quantum circuits optimization, Grayscale and RGB quantum images

Subject terms: Mathematics and computing, Optics and photonics, Physics

Introduction

Quantum computing expands the boundaries of computational power by leveraging the principles of quantum mechanics such as superposition and entanglement, enabling quantum systems to solve complex problems with a level of efficiency and parallelism that classical computers cannot achieve1–5. In addition to traditional binary quantum systems, ternary quantum systems use three-level quantum states (qutrits), which increase data density, reduce circuit complexity, and allow more efficient quantum algorithms 6–9. These advantages are particularly important in fields such as image processing10,11, cryptography 12,13 and machine learning14,15, where digital images are fundamental data units requiring efficient storage, manipulation, and retrieval.

Quantum image representation is an essential step in quantum image processing (QIP). While most existing representation models rely on binary qubits16–21, ternary quantum systems offer higher scalability and flexibility, providing more compact and efficient encoding of digital images22–25. In binary-based quantum systems, the Flexible Representation of Quantum Images (FRQI)16, the Novel Enhanced Quantum Representation (NEQR) 17, the Multi-Channel Quantum Representation (MCQI)18 and the Novel Quantum Representation of Color Digital Images (NCQI)19 have been widely used to represent grayscale and RGB images. Despite their effectiveness, binary models require a rapidly increasing number of qubits and more complex circuits as image dimensions grow. To address these scalability challenges, ternary (qutrit-based) models have been proposed as alternative encoding models. The Qutrit Representation of Grayscale Quantum Images (QTRQ) model22 introduced the first ternary model for representing grayscale images, followed by circuit-level optimizations that improved the image representation in the QTRQ model24. The Ternary Novel Colored Quantum Representation (TNCQR) model25 further extended ternary encoding by representing RGB images, lowering time complexity, and reducing quantum cost. However, these ternary models still suffer from several limitations: they are not fully native ternary models, as they are derived from binary models; the quantum cost remains high even after optimization; and as the image dimensions increase (Inline graphic), circuit complexity grows rapidly, making practical implementation for real-world images challenging.

Despite the growing interest in QIP, several fundamental challenges remain, including issues related to measurement-induced information loss and unintended entanglement in certain representation models. These challenges limit the practical applicability of many existing approaches. In this work, we focus on improving the efficiency and scalability of ternary quantum image representation, which is a key component in QIP pipelines.

Accordingly, this paper proposes a Novel Quantum Qutrit Representation (NQQR) model. NQQR is a pure ternary quantum representation that enables compact and scalable encoding of Inline graphic grayscale and RGB images using qutrit-based quantum computation. By minimizing multi-qutrit gate usage, and applying optimization techniques, NQQR achieves lower quantum cost and improved scalability compared to relevant ternary and binary models such as QTRQ22, TNCQR25, FRQI16, MCQI18, NEQR17 and NCQI19. The main novelty of the proposed NQQR model lies in its native ternary formulation, which differentiates it from existing qubit-based and binary-derived ternary approaches. By directly exploiting qutrit systems, the model achieves higher information density, improved scalability, and reduced the reliance on complex multi-controlled operations. In addition to efficient image representation, the robustness of quantum image encoding under noise is a critical challenge in practical quantum systems. Therefore, this work also investigates the performance of the proposed model under quantum depolarizing noise using a statistical reconstruction framework based on Monte Carlo sampling. This approach enables effective reduction of quantum noise effects without relying on quantum error correction techniques.

The rest of this paper is organized as follows: Section Preliminaries provides background on quantum ternary logic. Section Related Works reviews existing ternary quantum image representation models. Section The Proposed NQQR Model for Grayscale Images introduces the proposed representation for grayscale images, while Section The Proposed NQQR Model for RGB Images extends the representation to RGB images in ternary quantum system. Section NQQR Optimization Method presents the optimization phases used to reduce the quantum cost of the constructed circuits for both grayscale and RGB images. Section Experimental Results evaluates the performance of the proposed model and compares it with relevant qubit/qutrit-based representation models. Section Performance Evaluation of NQQR Under Quantum Noise presents the performance of the proposed model under different levels of quantum depolarizing noise for both grayscale and RGB images. Finally, Section Conclusion concludes the paper and outlines directions for future work.

Preliminaries

This section provides a brief background on the fundamental ternary quantum gates that form the basis of the proposed image representation model. These gates operate on ternary quantum system, where each quantum state can exist in 3 distinct levels (Inline graphic,Inline graphic, Inline graphic), offering greater representational capacity compared to binary qubits. This section also presents definitions of the basic computational metrics adopted in this study, namely time complexity and quantum cost in ternary quantum systems.

Definition 1

The time complexity is the number of sequential layers of gates (non-parallelized operations) that must be executed to realize the circuit (circuit depth)17,25–28.

Definition 2

Quantum cost is a metric that assigns costs to gates according to the ternary quantum system architecture. Quantum cost evaluates complex (N-qutrit) gates by decomposing them into elementary ternary gates (one-qutrit and two-qutrit gates) and summing their costs24,25,28–32.

One-qutrit gates

In ternary quantum system there are 7 one-qutrit gates: the 6 ternary shift gates (Z gates)22–25,29,30,32,33 and the ternary Hadamard gate (H)22,24,25,34. Each one-qutrit gate operates on one qutrit to change the qutrit state. The Z gates are: Inline graphic. The Inline graphic gate is the identity gate (I). The Inline graphic gate is a single-shift gate that changes the ternary state by adding 1 mod 3. The Inline graphic gate is a double-shift gate that changes the ternary state by adding 2 mod 3. The [01] gate is a self-single-shift gate that swaps the ternary state Inline graphic and Inline graphic. The [02] gate is a self-double-shift gate that swaps the ternary state Inline graphic and Inline graphic. The [12] gate is a self-shift gate that swaps the ternary state Inline graphic and Inline graphic22–25,29,30,32,33.

The ternary H gate is responsible for preparing the ternary superposition states. When applying the H gate on a ternary quantum state Inline graphic it produces the general form of the ternary superposition states, as shown in Eq (1)22,24,25,34,

graphic file with name d33e530.gif 1

To maintain reversibility in ternary quantum circuits, each one-qutrit gate must have an inverse gate to reverse its function. The Inline graphic and Inline graphic are mutual inverses, which means that they inverse each other’s function. The gates [01], [02], [12], and H are self-inverse, which mean that applying the same gate twice results in the identity function (Inline graphic)24,30,32. Figure 1 shows the symbolic notation for Z and H gates as quantum circuits, each with quantum cost equals 1 (Inline graphic)24,29–32. Table 1 presents the truth table for the 7 one-qutrit gates: the 6 ternary Z gates and the ternary H gate.

Fig. 1.

Fig. 1

The symbolic notation of one-qutrit gates as a quantum circuit: (a) The notation of any Z gate. (b) The notation of ternary H gate.

Table 1.

The Truth table for the 7 one-qutrit gates30,32,34.

Input Inline graphic Inline graphic Inline graphic Inline graphic Inline graphic Inline graphic Inline graphic
Inline graphic Inline graphic Inline graphic Inline graphic Inline graphic Inline graphic Inline graphic Inline graphic
Inline graphic Inline graphic Inline graphic Inline graphic Inline graphic Inline graphic Inline graphic Inline graphic
Inline graphic Inline graphic Inline graphic Inline graphic Inline graphic Inline graphic Inline graphic Inline graphic

Two-qutrit M-S gates

The two-qutrit gates proposed by Muthukrishnan and Stroud35 operate on 2 qutrits: a control qutrit and a target qutrit. The Z gate on the target qutrit is applied when the control qutrit satisfies the conditional state Inline graphic, where Inline graphic as shown in Figure 2a. The QC for two-qutrit gates is Inline graphic, where k is the number of controls not in state Inline graphic22,24,25,29–33,36.

Fig. 2.

Fig. 2

Symbolic notations for the two-qutrit gates as a quantum circuit: (a) The notation of generalized two-qutrit gate when the control qutrit Inline graphic is in state Inline graphic. (c) The decomposition of generalized two-qutrit gate.

Figure 2b shows the decomposition of generalized two-qutrit gate when Inline graphic into 3 gates: 2 one-qutrit gates and 1 two-qutrit gate with control qutrit in state Inline graphic. In this figure, Inline graphic and Inline graphic represent the gates Inline graphic and Inline graphic, respectively, where Inline graphic.

Generalized N-qutrit M-S gate

The generalized N-qutrit M-S gate operates on N qutrits. The Z gate on the target qutrit is activated when all Inline graphic control qutrits are in state Inline graphic, as shown in Figure 3a, with Inline graphic22,25, where Inline graphic qutrits.

Fig. 3.

Fig. 3

Symbolic notation for the N-qutrit gate as a quantum circuit: (a) The default notation of N-qutrit gate with Inline graphic control qutrits Inline graphic all in state Inline graphic, where Inline graphic (b) The decomposition of N-qutrit gate.

To decompose the N-qutrit gate, add Inline graphic ancilla qutrits in state Inline graphic, then the Inline graphic control qutrits are decomposed into Inline graphic two-qutrit gates with a target Inline graphic gate, followed by 1 two-qutrit gate with a target Z gate, and finally Inline graphic two-qutrit gates with a target Inline graphic gate. Figure 3b illustrates the decomposition of the N-qutrit M-S gate22,29,31.

While qutrit controls can operate in any state: Inline graphic, Inline graphic, or Inline graphic, an N-qutrit gate can operate with any control state, as shown in Fig. 4a. Figure 4b illustrates the decomposition of a generalized N-qutrit gate. The QC for this gate is calculated by Inline graphic22,25, where N is the number of qutrits used in the gate, and k is the number of controls not in state Inline graphic.

Fig. 4.

Fig. 4

Symbolic notation for the generalized N-qutrit gate as a quantum circuit: (a) The generalized N-qutrit gate with control qutrits Inline graphic function according to state Inline graphic, where Inline graphic (b) The decomposition of generalized N-qutrit gate.

Related works

This section presents recent relevant models for representing digital images in ternary quantum system such as: the QTRQ22 and TNCQR models25.

QTRQ representation model

The QTRQ model22 is designed to encode grayscale images into a ternary quantum system. It employs Inline graphic qutrits to represent a Inline graphic grayscale image, where the grayscale value in range Inline graphic is encoded using Inline graphic qutrits per pixel, instead of Inline graphic qubits used in binary-based models. The mathematical expression for representing a Inline graphic grayscale quantum image using the QTRQ model is expressed as follows,

graphic file with name d33e1172.gif 2

where Inline graphic denotes the grayscale value of the pixel located at position (Y, X), encoded as a ternary sequence Inline graphic, where each Inline graphic. Figure 5 presents a Inline graphic grayscale image and its corresponding quantum image state Inline graphic, where each pixel is indexed by its (Y, X) position and assigned a grayscale value in the range Inline graphic. The quantum circuit constructed using the QTRQ model records a total quantum cost of Inline graphic22. Additional optimization techniques described in 22 further reduce the quantum cost to Inline graphic.

Fig. 5.

Fig. 5

A Inline graphic grayscale image with its corresponding quantum image state Inline graphic represented using QTRQ model.

The QTRQ model can be extended to represent Inline graphic RGB digital images by adding one additional qutrit to encode the 3 color channels25. In this extension, the Red, Green, and Blue channels are represented by the 3 qutrit states (Inline graphic, Inline graphic, and Inline graphic) through the application of the ternary Hadamard (H) gate on the color qutrit. Therefore, the extended model requires Inline graphic qutrits to store a Inline graphic RGB image with a color range of Inline graphic, where Inline graphic qutrits are used to represent the color value of each channel per pixel. Figure6 presents a Inline graphic RGB image and the corresponding quantum image state Inline graphic for the RGB image. The time complexity for preparing a quantum image using the QTRQ model is Inline graphic.

Fig. 6.

Fig. 6

A Inline graphic RGB image with its corresponding quantum image state Inline graphic represented using QTRQ model25.

Although the QTRQ model provides a compact way to represent quantum images using qutrits instead of qubits, it has several limitations. First, the model is not a true ternary representation but a conversion from the NEQR binary model. Second, it uses a limited set of generalized N-qutrit gates with 2n or Inline graphic controls, which increases the circuit depth and results in a high time complexity of Inline graphic. Third, the quantum cost is still high even for small images. Finally, as the image size grows to Inline graphic, the number of qutrits and the circuit complexity increase quickly, making it difficult to scale to larger or real-world images.

TNCQR representation model

The TNCQR model is designed to encode Inline graphic RGB digital images with time complexity Inline graphic and a lower quantum cost compared to the QTRQ model25. In the TNCQR model, 7 qutrits are used to encode the color intensity of each pixel. Therefore, the model requires Inline graphic qutrits to store a Inline graphic RGB image, where Inline graphic qutrits are used to represent the color range Inline graphic for each pixel. An ancilla qutrit is used to load the position of each pixel and assign its value within the range Inline graphic using up to 5 two-qutrit gates. The inclusion of this ancilla qutrit reduces the overall circuit cost by reducing the number of complex N-qutrit gates required, where Inline graphic. The representative expression for storing a Inline graphic RGB quantum image is given in Eq (3), and the corresponding quantum image state Inline graphic for the Inline graphic RGB image in Figure 6 is shown in Eq (4). The constructed quantum circuit for this image using the TNCQR model has Inline graphic. An optimization algorithm has been applied to reduce the quantum cost to Inline graphic25.

graphic file with name d33e1423.gif 3
graphic file with name d33e1427.gif 4

The TNCQR model is also applicable to grayscale images. Implementing the Inline graphic grayscale image shown in Figure 5, results in a quantum circuit with initial quantum cost Inline graphic, which is reduced to Inline graphic using the optimization algorithm, matching the quantum cost reported in24.

Although the TNCQR model is better than the QTRQ model in terms of quantum cost and time complexity, it still has some limitations. First, the model is not fully native ternary representation but is derived from the ENEQR binary model. Second, the quantum cost remains relatively high even after optimization. To overcome these limitations, this paper proposes the NQQR model, a novel ternary representation that exploits qutrit-based computation to provide a more compact and resource-efficient encoding of Inline graphic grayscale and RGB images in quantum systems.

The proposed NQQR model for grayscale images

This section introduces the proposed Novel Qutrit Quantum Representation model (NQQR) for representing grayscale images in ternary quantum system. To validate the proposed representation at the circuit level, all quantum circuits are implemented and evaluated using Google Cirq 37 for ternary quantum systems.

NQQR image representation model

The NQQR model represents a Inline graphic grayscale image in ternary quantum system, as shown in the general ternary quantum circuit in Figure 7. The representation process consists of the following G-Steps, where each ”G-Step” refers to a specific stage in encoding the grayscale image using the proposed NQQR model.

  • G-Step I: The Inline graphic qutrits are initialized to Inline graphic, then Inline graphic gates are applied on the 2n position qutrits.

  • G-Step II: A generalized N-qutrit gate with n control qutrits (row position Y) and a Inline graphic target gate is used to update the ancilla qutrit from Inline graphic to Inline graphic (Enable row Y).

  • G-Step III: Another generalized N-qutrit gate with n control qutrits (column position X) and a Inline graphic target gate is used to update the ancilla qutrit from Inline graphic to Inline graphic (Enable column X).

  • G-Step IV: The grayscale value of the pixel (Y, X), in range Inline graphic, is assigned using up to 5 two-qutrit gates, where each gate uses the ancilla qutrit in state Inline graphic as the control qutrit and applies a Inline graphic or Inline graphic target gate to one of the q qutrits.

  • G-Step V: A generalized N-qutrit gate with n control qutrits (column position X) and a Inline graphic target gate is used to reverse the effect of G-Step III, returning the ancilla state from Inline graphic to Inline graphic, preparing the representation of the next pixel in the same row Y (Disable column X).

  • Repeat G-Steps III−V  to assign the grayscale value for all pixels in the same rowInline graphic.

  • G-Step VI: A generalized N-qutrit gate with n control qutrits (row position Y) and a Inline graphic target gate is used to reverse the effect of Step II, returning the ancilla state from Inline graphic to Inline graphic, preparing the representation of the next row of pixels in the image (Disable row Y).

  • The G-Steps II−VI  are repeated to represent all pixels in the image.

The detailed explanation for representing a Inline graphic gray image using the NQQR is presented. G-Step I initializes the grayscale image as the quantum state Inline graphic with Inline graphic qutrits all initialized to Inline graphic, as shown in Eq (5). The 6 qutrits (Inline graphic) are used to store the grayscale value for each pixel (since Inline graphic covers the range from 0 to 255), 2n qutrits are used to encode the pixel positions and 1 ancilla qutrit.

graphic file with name d33e1716.gif 5

The Inline graphic operator in Eq(6) is then applied on Inline graphic state to encode the position information for Inline graphic pixels. This operator applies Inline graphic gates on the 2n position qutrits, creating a superposition of all Inline graphic pixel positions. The operator transforms the initial state Inline graphic into the intermediate state Inline graphic as shown in Eq (7), where Inline graphic represents a pixel at position (Y, X) as row Y, column X.

graphic file with name d33e1776.gif 6
graphic file with name d33e1781.gif 7

The grayscale value for each pixel is assigned using Inline graphic operator (G-Steps II, III, IV), as shown in Eq (8). This operator operates iteratively on each row of pixels in the image, starting from RowInline graphic till RowInline graphic. For each RowInline graphic, the gray-setting quantum operation Inline graphic assigns the grayscale value for all pixels in that row, where Inline graphic represents the pixel currently being processed and Inline graphic represents the other pixels in the image that are not currently being updated. The Inline graphic operation consists of several sub-operations Inline graphic as expressed in Eq (9),

graphic file with name d33e1833.gif 8
graphic file with name d33e1837.gif 9

The sub-operation Inline graphic is an N-qutrit gate that uses the row position Y of the pixel (Y, X) as n control qutrits to update the state of the ancilla qutrit from Inline graphic to Inline graphic (G-Step II). The sub-operation Inline graphic is an N-qutrit gate that uses the column position X of the pixel (Y, X) as n control qutrits to update the state of the ancilla qutrit from Inline graphic to Inline graphic (G-Step III). The sub-operation Inline graphic assigns the grayscale value in ternary representation over the Inline graphic qutrits to the pixel (Y, X) in range Inline graphic (G-Step IV). Therefore, the sub-operation Inline graphic consists of q unitary operations as follows,

graphic file with name d33e1934.gif 10

where the Inline graphic unitary operator is a 1 two-qutrit M-S gate that is applied to 1 of the q qutrits to change its state from Inline graphic to Inline graphic or Inline graphic according to the pixel’s grayscale value as follows,

graphic file with name d33e1959.gif 11

Applying Inline graphic on the q qutrits to set the grayscale value for the pixel (Y, X) is expressed as follows,

graphic file with name d33e1978.gif 12

where the state Inline graphic represents the assigned grayscale value in ternary representation over the q qutrits for the pixel (Y, X). After assigning the grayscale value using Inline graphic, another Inline graphic gate is used to update the state of the ancilla qutrit from Inline graphic to Inline graphic to prepare the representation of the next pixel in the same row (G-Step V). Finally, the ancilla qutrit state is returned to Inline graphic by applying the Inline graphic gate, preparing it for the representation of the next row of pixels in the image (G-Step VI).

Fig. 7.

Fig. 7

The general ternary quantum circuit for representing a Inline graphic grayscale image using the NQQR model.

Note that the sub-operations Inline graphic and Inline graphic are applied iteratively on all pixels in a Inline graphic image, with Inline graphic applied row by row from RowInline graphic to RowInline graphic and Inline graphic applied column by column within each row from ColInline graphic to ColInline graphic.

Each of the Inline graphic sub-operations is implemented in the ternary quantum circuit for the NQQR model as follows: the sub-operations Inline graphic and Inline graphic are generalized N-qutrit M-S gates, each with n control and 1 target qutrits, where n determines the size of Inline graphic image. The sub-operation Inline graphic assigns the grayscale value for 1 pixel over the q qutrits and is implemented using up to 5 two-qutrit M-S gates, each with a control qutrit set to Inline graphic, since representing values from 0 to 255 in ternary requires modifying up to 5 ternary digits. Applying the Inline graphic operator on the quantum state Inline graphic updates the grayscale value of the specified pixel (Y, X), resulting in the transformed state Inline graphic, as shown in Eq (13),

graphic file with name d33e2128.gif 13

The Inline graphic operator assigns the grayscale value to each pixel in a single row of the image, with each pixel updated at its corresponding position. Therefore, Inline graphic is the quantum operator that assigns the grayscale values for all Inline graphic image pixels. The Inline graphic operator consists of Inline graphic row-wise sub-operations to assign the grayscale values for all pixels row by row for the whole image as follows,

graphic file with name d33e2154.gif 14

So, applying Inline graphic on the state Inline graphic gives the final state Inline graphic, which is the quantum gray image of the NQQR model as shown in Eq (15). The state Inline graphic represents the application of the Inline graphic operator on 1 pixel to assign its value, while Inline graphic represents the application of the Inline graphic operator which assigns the grayscale values to all Inline graphic pixels.

graphic file with name d33e2196.gif 15

The state Inline graphic, which represents a Inline graphic grayscale image, is expressed in detail in Eq (16). This equation illustrates that the NQQR model selects a row of pixels Y, and within this row, iterates over each column Inline graphic to identify the pixel at position Inline graphic and assign its corresponding grayscale value, as follows,

graphic file with name d33e2224.gif 16

NQQR grayscale image representation

In this section, an example illustrating the representation of a Inline graphic grayscale image shown in Figure 5 using the NQQR model is presented, where the grayscale value of each of the 9 pixels is shown on the corresponding pixel. The image is implemented using the NQQR model by initializing 9 qutrits to Inline graphic using the formula Inline graphic, where Inline graphic and Inline graphic. Among these, Inline graphic qutrits are used to represent the grayscale values, Inline graphic qutrits are used to encode the pixel positions, and 1 ancilla qutrit is employed. Next, Inline graphic gates are applied on the 2 position qutrits to encode all pixel positions: Inline graphic, Inline graphic, Inline graphic, Inline graphic, Inline graphic, Inline graphic, Inline graphic, Inline graphic, Inline graphic. After that, two-qutrit gates are used to determine each pixel position as Row Y and Col X and assign its grayscale value.

The state Inline graphic in Eq (17) represents the Inline graphic grayscale image shown in Figure 5 using the NQQR model. The corresponding quantum circuit for representing this image is shown in Figure 8, with a quantum cost of Inline graphic. For comparison, implementing the same image using the TNCQR25 and QTRQ models22 results in ternary quantum circuits with Inline graphic and Inline graphic, respectively. The evolution of the state vector through the NQQR grayscale quantum circuit shown in Figure 8 is provided in Section S1 of the Supplementary Materials.

graphic file with name d33e2359.gif 17

Fig. 8.

Fig. 8

The ternary quantum circuit that represents the implementation of a Inline graphic grayscale image shown in Figure 5 using the proposed NQQR model.

NQQR complexity analysis

This section presents the calculations used to analyze the performance of the proposed model, including its quantum cost and time complexity. The total quantum cost (Inline graphic) of the NQQR model is calculated using the formula shown in Eq (18),

graphic file with name d33e2389.gif 18

where Inline graphic and Inline graphic represent the QC of each generalized N-qutrit gate corresponding to the row or column position for each pixel in a Inline graphic image. The model has recorded a time complexity Inline graphic as discussed in the following Lemma 1, Lemma 2, Lemma 3 and Theorem 1.

Lemma 1

The time complexity of preparing pixel positions is O(1).

Proof

Since the Inline graphic operator prepares Inline graphic pixel positions by applying 2n ternary H gates on 2n qutrits, its time complexity is constant. Hence, the time complexity is O(1).

Inline graphic

Lemma 2

The time complexity of the quantum operator Inline graphic, which sets the grayscale value for one row of pixels is Inline graphic.

Proof

The main sub-operation in Inline graphic is Inline graphic, which is decomposed into several sub-operations. It begins with Inline graphic, a generalized N-qutrit gate with n control qutrits and 1 target qutrit (Inline graphic-qutrit M-S gate). For each row, there are Inline graphic columns, each associated with a corresponding Inline graphic operation, which is also a generalized Inline graphic-qutrit M-S gate. The operation Inline graphic consists of up to 5 two-qutrit M-S gates to assign the grayscale value for pixel (Y,X). Therefore, for each Inline graphic operator, the total number of required gates includes: 2 Inline graphic (Inline graphic-qutrit M-S gate) for the Row index + Inline graphic Inline graphic [ 2 Inline graphic (Inline graphic-qutrit M-S gate) for each Column index + 5 two-qutrit gates for the grayscale value of each pixel ].

Each generalized Inline graphic-qutrit M-S gate can be decomposed into Inline graphic two-qutrit M-S gates with Inline graphic ancilla qutrits, in addition to 2k one-qutrit gates, where k is the number of controls not in state Inline graphic and Inline graphic. Therefore, the time complexity of each generalized Inline graphic-qutrit M-S gate is O(n). Consequently, the time complexity of Inline graphic is Inline graphic, which results in Inline graphic. Inline graphic

Lemma 3

The time complexity of Inline graphic quantum operator, which assigns the grayscale values for all Inline graphic pixels, is Inline graphic.

Proof

The Inline graphic operator iterates over Inline graphic rows and each row iterates over Inline graphic columns using Inline graphic operator to assign the grayscale values for all Inline graphic pixels. According to Lemma 2, the time complexity of a single Inline graphic operation is Inline graphic. Therefore, the time complexity of Inline graphic is Inline graphic. Inline graphic

Theorem 1

The time complexity of representing Inline graphic grayscale quantum image using the NQQR model in ternary system is Inline graphic.

Proof

The time complexity of quantum image representation in the NQQR model is calculated based on the quantum operators used in preparing the position information and the grayscale values (Inline graphic). According to Lemma 1, the time complexity of preparing the pixel position is O(1). The step of assigning the grayscale value for each pixel is divided into Inline graphic row-wise sub-operations to assign the grayscale value for each pixel. Since the main operation in this step is Inline graphic with time complexity Inline graphic, then time complexity for setting the grayscale value for every pixel (Inline graphic pixels) is Inline graphic, as proved in Lemmas 2 and 3. Therefore, the time complexity of representing a Inline graphic grayscale image in the NQQR model is Inline graphic, which results Inline graphic. Inline graphic

The proposed NQQR model for RGB images

This section presents the steps (C-Steps) for representing RGB digital images using the proposed NQQR model in ternary quantum system. To represent a Inline graphic RGB image, Inline graphic qutrits are required. The 2n qutrits are used to encode the pixel positions, while Inline graphic qutrits are used to encode each color value in the range Inline graphic. An additional color qutrit differentiates between the 3 color channels in superposition, where the states Inline graphic and Inline graphic correspond to the Red, Green and Blue channels, respectively. The Inline graphic ancilla qutrit is conditionally modified after determining the pixel position (Y, X) as Row Y and Col X. After that, the Inline graphic ancilla qutrit is conditionally modified according to the state of the Inline graphic ancilla and the color qutrit to assign the RGB values to each pixel. Figure 9 illustrates the general ternary quantum circuit for representing RGB images using the NQQR model.

  • C-Step I: Initialize the Inline graphic qutrits to Inline graphic, then apply Inline graphic gates on the 2n position qutrits and the color qutrit.

  • C-Step II: A generalized N-qutrit gate with n control qutrits (row position Y) and a Inline graphic target gate is used to update the Inline graphic ancilla qutrit from Inline graphic to Inline graphic (Enable row Y).

  • C-Step III: A generalized N-qutrit gate with n control qutrits (column position X) and a Inline graphic target gate is used to update the Inline graphic ancilla qutrit from Inline graphic to Inline graphic (Enable column X).

  • C-Step IV: A two-qutrit gate, with the Inline graphic ancilla as the control qutrit in state Inline graphic, updates the Inline graphic ancilla from Inline graphic to Inline graphic using a Inline graphic target gate. This operation enables the selected pixel (Y, X), enabling the assignment of its RGB channel values (Enable pixel (Y, X)).

  • C-Step V: A two-qutrit gate detects the Red color when the control on the color qutrit is in state Inline graphic. The target Inline graphic gate updates the Inline graphic ancilla from Inline graphic to Inline graphic. Then, the Red value is assigned using up to 5 two-qutrit gates from the Inline graphic ancilla to the q qutrits. Finally, another two-qutrit gate with control Inline graphic and target Inline graphic disables the Red color and returns the Inline graphic ancilla to Inline graphic.

  • C-Step VI: A two-qutrit gate detects the Green color when the control on the color qutrit is in state Inline graphic. The target Inline graphic gate updates the Inline graphic ancilla from Inline graphic to Inline graphic. Then, the Green value is assigned using up to 5 two-qutrit gates from the Inline graphic ancilla to the q qutrits. Finally, another two-qutrit gate with control Inline graphic and target Inline graphic disables the Green color and returns the Inline graphic ancilla to Inline graphic.

  • C-Step VII: A two-qutrit gate detects the Blue color when the control on the color qutrit is in state Inline graphic. The target Inline graphic gate updates the Inline graphic ancilla from Inline graphic to Inline graphic. Then, the Blue value is assigned using up to 5 two-qutrit gates from the Inline graphic ancilla to the q qutrits. Finally, another two-qutrit gate with control Inline graphic and target Inline graphic disables the Blue color and returns the Inline graphic ancilla to Inline graphic.

  • C-Step VIII: A two-qutrit gate, where the control qutrit (Inline graphic ancilla) is in state Inline graphic, reverses the effect of C-Step IV, returning the Inline graphic ancilla from Inline graphic to Inline graphic using a Inline graphic target gate (Disable pixel (Y, X)).

  • C-Step IX: A generalized N-qutrit gate with n control qutrits (column position X) and a Inline graphic target gate is used to reverse the effect of C-Step III, returning the Inline graphic ancilla from Inline graphic to Inline graphic, preparing the representation for the next pixel in the same row Y (Disable column X).

  • Repeat C-Steps Inline graphic to assign the RGB values for all pixels in the same row.

  • C-Step X: A generalized N-qutrit gate with n control qutrits (row position Y) and a Inline graphic target gate is used to reverse the effect of C-Step II, returning the Inline graphic ancilla from Inline graphic to Inline graphic, preparing the representation for the next row of pixels (Disable row Y).

  • C-Steps Inline graphic are repeated to represent all pixels in the image.

Figure 6 shows a Inline graphic RGB image with the color value for each pixel in rage Inline graphic. To represent this image using the proposed NQQR model, set Inline graphic and Inline graphic, resulting in 11 qutrits in the initial state Inline graphic, all initialized to Inline graphic. Then, Inline graphic gates are applied on the 2 position qutrits and 1 color qutrit. After that, two-qutrit gates are used to determine each pixel position as Row Y and Col X and assign its RGB color value, as shown in the implemented circuit in Figure 10 with Inline graphic. For comparison, implementing the same image using the TNCQR 25 and QTRQ models 22 results in ternary quantum circuits with Inline graphic and Inline graphic, respectively. The corresponding Inline graphic state for this RGB image is shown in Eq (19), while the evolution of the state vector through the NQQR RGB quantum circuit shown in Figure 10 is provided in Section S2 of the Supplementary Materials.

graphic file with name d33e3294.gif 19

Fig. 9.

Fig. 9

The general ternary quantum circuit for representing a Inline graphic RGB image using the NQQR model.

Fig. 10.

Fig. 10

Quantum circuit for the NQQR representation of a Inline graphic RGB image shown in Figure 6.

NQQR optimization method

The NQQR model is optimized using the algorithm proposed in22,24,25, which consists of two main phases. Phase I (Gate Decomposition) focuses on decomposing each generalized N-qutrit gate, where Inline graphic, into its simplest form using elementary gates, as described in Section Preliminaries25. Phase II (Circuit Simplification) applies gate movement, elimination, and merging rules to reduce the overall circuit cost22,25.

Applying NQQR optimization on grayscale images

Phase I decomposition of the Inline graphic NQQR grayscale quantum circuit shown in Figure 8 is illustrated in Figure 11, where each Row and Col gates are decomposed to its simplest form.

Fig. 11.

Fig. 11

Phase I decomposition of the NQQR quantum circuit shown in Figure 8.

Phase II decomposition is presented in Figure 12. In this phase, redundant (green boxes) or equivalent (red boxes) elementary gates in Figure 11 are merged or eliminated, resulting in an optimized quantum circuit with a total quantum cost Inline graphic.

Fig. 12.

Fig. 12

Phase II decomposition of the NQQR quantum circuit shown in Figure 8.

The circuit cost is further reduced by combining gates that share the same control Y and target Z22,25. This is achieved for Inline graphic with Inline graphic, Inline graphic, and Inline graphic, and for Inline graphic with Inline graphic, Inline graphic, and Inline graphic, as shown in Eq (20). In each case, the 3 two-qutrit gates are replaced by a single two-qutrit gate with the corresponding control Y and target Z. This gate is then decomposed into its elementary components, resulting in a fully optimized quantum circuit with a total quantum cost Inline graphic, as shown in Figure 13.

graphic file with name d33e3457.gif 20

Fig. 13.

Fig. 13

The optimized quantum circuit for the NQQR representation of a Inline graphic grayscale image (shown in Figure 5), with a total quantum cost Inline graphic.

Applying NQQR optimization on RGB images

Phase I decomposed each two-qutrit gate in Figure 10 to its elementary gates. Phase II then applies the gate elimination and merging rules, reducing the overall quantum cost to Inline graphic. The optimized RGB quantum circuit obtained after applying Phases I and II is shown in Figure 14.

Fig. 14.

Fig. 14

The optimized quantum circuit for the NQQR representation of a Inline graphic RGB image (shown in Figure 6), with a total quantum cost Inline graphic.

Experimental results

This section presents a comparative evaluation of the proposed NQQR model against existing quantum image representation models, including ternary models such as TNCQR25 and QTRQ22, as well as binary models such as FRQI16, NEQR17, MCQI18 and NCQI 19. The evaluation is conducted analytically based on quantum cost (QC) and circuit complexity for representing Inline graphic grayscale and RGB images in ternary quantum systems, which are standard metrics in quantum circuit design. The proposed model has been implemented and evaluated using Google Cirq37 to verify the correctness of the circuit construction and state evolution, as well as to analyze circuit behavior and estimate computational characteristics.

Table 2 summarizes the comparison terms among the compared models, including the equations used to calculate the total quantum cost of representing Inline graphic grayscale and RGB images for each model in Tables 3 and 4, respectively, as well as the time complexity. In terms of time complexity, the binary FRQI model records Inline graphic for representing grayscale images, while the NEQR records Inline graphic. For RGB images, the binary MCQI model records Inline graphic, while the NCQI records Inline graphic. The ternary QTRQ model records Inline graphic for representing grayscale or RGB images with a color range of Inline graphic, where Inline graphic. The ternary TNCQR model achieves Inline graphic for representing a Inline graphic grayscale or RGB image, which is the same time complexity achieved by the proposed NQQR model. The proposed NQQR model has a time complexity of Inline graphic, which is higher than qubit-based models due to the richer structure of qutrits, where each unit encodes three levels instead of two. This increased complexity reflects higher information density rather than reduced efficiency. Additionally, the model improves scalability for grayscale and RGB image representation by reducing redundant encoding operations.

Table 2.

Comparison between the proposed NQQR model with FRQI16, MCQI18, NEQR17, NCQI19, QTRQ22,25 and TNCQR25 models in terms of total quantum cost and time complexity.

Model Image Size Image mode Qudit type Quantum Cost (QC) Time Complexity
FRQI16 Inline graphic Grayscale qubit Inline graphic Inline graphic
MCQI18 Inline graphic RGB qubit Inline graphic Inline graphic
NEQR17 Inline graphic Grayscale qubit Inline graphic Inline graphic
NCQI19 Inline graphic RGB qubit Inline graphic Inline graphic
QTRQ22,25 Inline graphic Grayscale qutrit Inline graphic Inline graphic
RGB Inline graphic
TNCQR25 Inline graphic Grayscale qutrit Inline graphic Inline graphic
RGB Inline graphic
NQQR Inline graphic Grayscale qutrit Inline graphic Inline graphic
RGB Inline graphic

Table 3.

Comparison of the proposed NQQR model with FRQI16, NEQR17, QTRQ22 and TNCQR25 models for representing Inline graphic grayscale images, in terms of the total number of qudits (M) required by each model and the total quantum cost (QC) under the worst-case scenario.

Inline graphic Image Size Inline graphic FRQI16 NEQR17 QTRQ22,25 TNCQR25 NQQR
Inline graphic Inline graphic Inline graphic Inline graphic Inline graphic Inline graphic Inline graphic Inline graphic Inline graphic Inline graphicoptimized Inline graphic Inline graphic Inline graphicoptimized
1 Inline graphic 2 5 212 12 2,092 8 347 9 185 113 9 103 83
2 Inline graphic 4 9 64,776 16 329,840 10 7,429 11 3,379 2,635 11 1,789 1,069
3 Inline graphic 5 11 1,045,514 18 11,926,450 12 105,711 13 45,933 35,361 13 23,307 18,351
4 Inline graphic 7 15 268,386,318 22 1,719,769,334 14 1,301,273 15 553,319 423,191 15 276,353 215,345
5 Inline graphic 8 17 4,294,770,704 24 61,915,947,064 16 14,860,675 17 6,239,521 4,753,453 17 3,101,743 2,399,755
6 Inline graphic 10 21 1,099,508,482,068 28 8,916,087,693,692 18 162,089,517 19 67,493,019 51,284,067 19 33,523,077 25,805,517
7 Inline graphic 12 25 281,474,926,379,032 32 1,283,918,349,757,632 20 1,713,897,239 21 709,473,749 538,084,025 21 352,495,571 270,347,111

Table 4.

Comparison of the proposed NQQR model with MCQI 18, NCQI 19, QTRQ 22 and TNCQR 25 models for representing Inline graphic RGB images, in terms of the total number of qudits (M) required by each model and the total quantum cost (QC) under the worst-case scenario.

Inline graphic Image Size Inline graphic MCQI 18 NCQI 19 QTRQ 22,25 TNCQR 25 NQQR
Inline graphic Inline graphic Inline graphic Inline graphic Inline graphic Inline graphic Inline graphic Inline graphic Inline graphic Inline graphicoptimized Inline graphic Inline graphic Inline graphicoptimized
1 Inline graphic 2 7 628 28 6,268 9 1,758 10 402 284 11 338 272
2 Inline graphic 4 11 194312 32 989,504 11 28,760 12 5,324 4,174 13 3,896 2,770
3 Inline graphic 5 13 3136522 34 35,779,330 13 375,442 14 63,430 49,212 15 42,262 33,660
4 Inline graphic 7 17 805158926 38 5,159,307,974 15 4,428,684 16 710,784 547,850 17 446,940 353,126
5 Inline graphic 8 19 12884312080 40 185,747,841,160 17 49,305,926 18 7,656,698 5,875,384 19 4,637,018 3,639,784
6 Inline graphic 10 23 3298525446164 44 26,748,263,081,036 19 528,783,808 20 80,247,604 61,381,446 21 47,340,544 36,965,778
7 Inline graphic 12 27 844424779137048 48 3,851,755,049,272,848 21 5,524,329,210 22 824,265,006 628,960,436 23 476,852,766 370,789,460

To illustratively evaluate quantum cost efficiency, the Inline graphic grayscale image shown in Figure 5 was encoded using different ternary quantum image representation models. The proposed NQQR model represents the image using 9 qutrits with an initial quantum cost of Inline graphic, which is reduced to Inline graphic after optimization. The TNCQR model also uses 9 qutrits, with an initial quantum cost of Inline graphic, reduced to Inline graphic after optimization25. The QTRQ model uses 8 qutrits with an initial quantum cost of Inline graphic, which is reduced to Inline graphic after optimization22. While this example focuses on ternary representations to clarify the encoding mechanism, a comprehensive comparison with both binary/ternary-based models across different image sizes is provided in Table 3.

Table 3 presents the total quantum cost for representing Inline graphic grayscale images with Inline graphic under a worst-case scenario, assuming that 5 ternary digits are modified to encode each pixel’s grayscale value. The quantum cost of the NQQR model is calculated using the Inline graphic equation in Table 2, where Inline graphic determines the image size, Inline graphic and Inline graphic represents the quantum cost of the N-qutrit gates used to encode the row and column positions, respectively. The total number of qutrits required by NQQR model is Inline graphic, where Inline graphic qutrits for ternary models. The quantum costs of the TNCQR and QTRQ models are computed using the equations Inline graphic and Inline graphic, respectively, where Inline graphic represents the quantum cost of the N-qutrit gate used to encode the position of the pixel (Y, X). The total number of qutrits required by each model is Inline graphic for the TNCQR model and Inline graphic for the QTRQ model. For binary-based models, the quantum cost of the NEQR and the FRQI models is calculated using the equations Inline graphic and Inline graphic, respectively, where Inline graphic which represents the required number of qubits to represent Inline graphic image. The total number of qubits required by each model is Inline graphic and Inline graphic, where Inline graphic qubits. These results demonstrate the efficiency of the proposed NQQR model in terms of both number of qudits (qubits or qutrits) required and the quantum cost. By comparing the proposed model with the ternary-based models (QTRQ and TNCQR), the proposed model is nearly close to the number of qutrits used (M) and shows a significant improvement in the quantum cost (QC), particularly as the image size increases. By comparing the proposed model with the binary-based models (FRQI and NEQR), the proposed model requires less number of qudits and significant improvement in the quantum cost as the image size increases.

In order to present the achieved improvement more clearly, the NQQR model (Inline graphic) achieves quantum cost improvement of Inline graphic, Inline graphic, Inline graphic, Inline graphic and Inline graphic compared to the optimized TNCQR (Inline graphicoptimized), the original TNCQR (Inline graphic), the QTRQ (Inline graphic), the NEQR (Inline graphic), the FRQI models (Inline graphic), respectively. Furthermore, the optimized NQQR model (Inline graphicoptimized) achieves additional improvements of Inline graphic, Inline graphic, Inline graphic, Inline graphic, Inline graphic and Inline graphic over the original NQQR (Inline graphic), the optimized TNCQR (Inline graphicoptimized), the TNCQR (Inline graphic) and the QTRQ (Inline graphic), the NEQR (Inline graphic), the FRQI models (Inline graphic), respectively. This comparison demonstrates that the proposed NQQR model is better in quantum cost than the existing models before and after optimization, confirming that its circuit structure is inherently more efficient and more amenable to optimization.

The RGB image shown in Figure 6 is represented using ternary representations to clarify the encoding mechanism, a comprehensive comparison with both binary/ternary models across different image sizes is provided in Table 4. The NQQR model represents the RGB image using 11 qutrits with an initial quantum cost of Inline graphic, which is reduced to Inline graphic after optimization. The TNCQR model requires 10 qutrits with an initial quantum cost of Inline graphic, reduced to Inline graphic 25. The QTRQ model uses 9 qutrits with an initial quantum cost of Inline graphic, without optimization 25.

Table 4 presents the total quantum cost under a worst-case scenario for representing Inline graphic RGB images using the ternary NQQR, TNCQR, QTRQ models, as well as the binary MCQI and the NCQI models, along with the total number of qudits (qutrits or qubits) required by each model. The quantum cost for the NQQR model is calculated using the Inline graphic equation in Table 2 with Inline graphic qutrits, where Inline graphic. The quantum cost for the TNCQR model is computed using the Inline graphic equation with Inline graphic qutrits, while the quantum cost for the QTRQ model is calculated using the Inline graphic equation with Inline graphic qutrits, where Inline graphic, Inline graphic, and Inline graphic are the quantum cost of the N-qutrit gates applied to the Red, Green, and Blue channels, respectively. The quantum cost for the NCQI model for representing Inline graphic RGB image is calculated using the Inline graphic equation with Inline graphic qubits, where Inline graphic. Moreover, the quantum cost for the MCQI model is calculated using the Inline graphic equation with Inline graphic qubits. As shown in the table, the proposed NQQR model demonstrates a clear reduction in quantum cost (QC) compared with the ternary models (TNCQR and QTRQ) and the binary models (MCQI and NCQI), particularly as the image size increases. In addition, by comparing the number of required qudits (qubits or qutrits), the proposed model uses a number of qutrits close to the ternary models and less than the qubits used in the binary models.

A similar evaluation procedure is followed for RGB images. Based on the comparisons presented in Table 4, the proposed NQQR model achieves quantum cost improvement of Inline graphic, Inline graphic, Inline graphic, Inline graphic and Inline graphic compared to the optimized TNCQR, the original TNCQR, the QTRQ , the NCQI and the MCQI models, respectively. Moreover, the optimized NQQR model further reduces the quantum cost by Inline graphic, Inline graphic, Inline graphic, Inline graphic, Inline graphic and Inline graphic compared to the original NQQR, the optimized TNCQR, the original TNCQR, and the QTRQ, the NCQI and the MCQI models, respectively. This confirms that the efficiency and optimization advantages of the NQQR model naturally extend to multi-channel RGB image representation. The improvement arises because each N-qutrit gate in the NQQR model is constructed using n control qutrits and one target qutrit for both grayscale and RGB images. In contrast, the TNCQR model uses N-qutrit gates with 2n control qutrits and one target qutrit for both grayscale and RGB images, while the QTRQ model uses 2n control qutrits for grayscale images and Inline graphic control qutrits for RGB images, resulting in higher quantum cost and time complexity. Moreover, the FRQI, the NEQR, the MCQI and the NCQI models use 2n-CNOT gates each with 2n control qubits and one target qubit for grayscale and RGB images, respectively, where the quantum cost for each 2n-CNOT gate is calculated according to reversible benchmarks38.

An additional point of comparison related to NEQRX scheme28, which proposes an encryption algorithm that integrates the NEQR encoding model17, a generalized affine transformation for scrambling pixel positions, and a logistic map to modify pixel intensity values39. In addition, NEQRX presents circuit-level optimization techniques for NEQR-based circuits representing a Inline graphic grayscale image, leading to reductions in both quantum cost and time complexity compared to the original NEQR model.

In this study, the proposed NQQR model is used to represent the same Inline graphic grayscale image at the representation level. The results indicate that ternary image representation using NQQR achieves a lower quantum cost and reduced time complexity when compared with the NEQR encoding stage prior to encryption, as shown in Table 5. After applying circuit optimization to the NQQR constructed circuit, the quantum cost is further reduced. A slight increase in time complexity is observed due to the decomposition of multi-controlled N-qutrit gates into elementary gates, resulting in deeper circuit layers. These results follow a standard circuit-level optimization strategy and highlight the advantage of qutrit-based image representation in enabling more efficient and compact encoding compared to qubit-based approaches.

Table 5.

Circuit-level comparison between the proposed NQQR representation and NEQR-based encoding optimized in NEQRX 28 for a Inline graphic grayscale image, in terms of quantum cost and time complexity.

Circuit Quantum Cost Time Complexity
Normal NEQR 234 147
NQQR 42 21
After Optimization NEQR 91 52
NQQR 28 25

In addition to computational efficiency, it is important to clarify the implications of the proposed representation on image retrieval accuracy. It is important to note that the proposed NQQR model represents image data in a lossless and deterministic manner, where each pixel value is explicitly encoded in the quantum state. Therefore, unlike approximate image processing techniques, no information loss or reconstruction error is introduced. Thus the evaluation focuses on computational efficiency metrics such as quantum cost and time complexity.

Experimental results show that the proposed NQQR model achieves lower quantum cost than comparable ternary and binary quantum image representation models, while exhibiting time complexity comparable to ternary models. Although the NQQR model requires a larger number of elementary gates, this design choice simplifies circuit structures and significantly reduces quantum cost, making it more suitable for scalable grayscale and RGB image representation in ternary quantum systems.

Performance evaluation of NQQR under quantum noise

This section presents the performance evaluation of the proposed NQQR model under different levels of quantum depolarizing noise using Google Cirq27,37,40. The objective of this study is to investigate the reconstruction quality of encoded images in the presence of quantum noise and to evaluate the robustness of the proposed representation against quantum state degradation.

Quantum depolarizing noise is applied to qutrit states to simulate realistic quantum channel imperfections27,40. Monte Carlo sampling is employed to approximate the expectation values of noisy quantum measurement outcomes, resulting in more stable estimates of the reconstructed pixel intensities41,42. A median-based Monte Carlo estimation is employed to improve the reconstructed image, effectively reducing the impact of quantum noise without relying on quantum error correction techniques. The experiments are conducted on both grayscale and RGB images with multiple Monte Carlo repetitions.

The reconstruction performance is evaluated using Mean Squared Error (MSE) and Peak Signal-to-Noise Ratio (PSNR), computed between the original, noisy, and enhanced images43–45. The PSNR metric is computed according to Eq (21)43–45. Since grayscale and RGB images differ in the number of channels, the MSE formulation is adapted accordingly for each image representation.

graphic file with name d33e5306.gif 21

The evaluation demonstrates the impact of quantum noise on the encoded image representation and confirms the effectiveness of the proposed statistical reconstruction approach. Complete removal of quantum depolarizing noise is not the objective of this method; instead, the proposed statistical reconstruction combined with median-based processing effectively reduces its impact. Figure 15 illustrates the overall NQQR reconstruction pipeline under quantum depolarizing noise, highlighting the interaction between the quantum processing layer and the classical post-processing stage.

Fig. 15.

Fig. 15

NQQR reconstruction pipeline under quantum depolarizing noise. The blue blocks represent the quantum layer, including image encoding and noise application, while the green blocks represent the classical layer, including Monte Carlo sampling and statistical estimation of pixel intensities. The process yields two reconstructed outputs: a noisy (mean-based) and an enhanced (median-based) image, both evaluated using MSE and PSNR metrics.

Grayscale image reconstruction results

The reconstruction performance for grayscale images is evaluated using the standard image quality metrics, MSE and PSNR. The MSE is computed as defined in Eq (22) 43–45, which provides a quantitative measure of the reconstruction error between the original and reconstructed images.

graphic file with name d33e5336.gif 22

where Inline graphic for the proposed NQQR image representation. Img(y, x) and Inline graphic represent the pixel values at row y and column x in the original image and the reconstructed image, respectively. Table 6 presents the MSE and PSNR values for the noisy and enhanced reconstructions of the Inline graphic grayscale image shown in Figure 5, as well as for the Inline graphic and Inline graphic grayscale standard Lena image 46. This comparison illustrates the performance of the proposed method under different image sizes.

Table 6.

Comparison of MSE and PSNR values for noisy and enhanced reconstructions of Inline graphic, Inline graphic and Inline graphic grayscale images under different levels of depolarizing noise and Monte Carlo repetitions.

Image Size Image Mode Repetitions Noise (%) Inline graphic Inline graphic Inline graphic Inline graphic
Inline graphic Grayscale 1000 0 0.0000 Inline graphic 0.0000 Inline graphic
10 3399.2222 12.82 0.0000 Inline graphic
20 9212.3704 8.49 3049.6667 13.29
Inline graphic Grayscale 3000 0 0.0000 Inline graphic 0.0000 Inline graphic
10 1658.5926 15.93 1.6049 46.08
20 4219.0370 11.88 243.6914 24.26
Inline graphic Grayscale 7000 0 0.0000 Inline graphic 0.0000 Inline graphic
10 2548.4333 14.06 354.3748 22.63
20 6313.4125 10.12 1782.4343 15.62

Figure 16 presents the visual comparison for the Inline graphic grayscale version of the standard Lena image between the noisy and enhanced reconstructions at Inline graphic and Inline graphic noise levels.

Fig. 16.

Fig. 16

Visual reconstruction results for a Inline graphic grayscale Lena image under Inline graphic and Inline graphic depolarizing noise levels.

The results indicate that the enhanced reconstruction significantly improves image quality at low noise levels and continues to provide noticeable improvements over the noisy reconstruction under higher depolarizing noise conditions. This behavior suggests that the proposed statistical reconstruction and median-based processing can effectively approximate the original image across different image sizes under low depolarizing noise levels.

RGB image reconstruction results

The reconstruction performance for RGB images is evaluated using the same statistical framework adopted for grayscale images, extending the analysis to multi-channel image representations. Similar to the grayscale case, the reconstruction quality is assessed using MSE and PSNR. For RGB images, the MSE is computed by averaging the squared error across all three color channels (R, G, and B), following the formula in Eq (23).

graphic file with name d33e5657.gif 23

where Inline graphic, Inline graphic and Inline graphic represent the pixel values of channel c at row y and column x in the original image and the reconstructed image, respectively. Table 7 presents the MSE and PSNR values for the noisy and enhanced reconstructions of the Inline graphic RGB example shown in Figure 6, as well as for the Inline graphic and Inline graphic RGB standard Lena image 46.

Table 7.

Comparison of MSE and PSNR values for noisy and enhanced reconstructions of Inline graphic, Inline graphic and Inline graphic RGB images under different levels of depolarizing noise and Monte Carlo repetitions.

Image Size Image Mode Repetitions Noise (%) Inline graphic Inline graphic Inline graphic Inline graphic
Inline graphic RGB 1000 0 0.0000 Inline graphic 0.0000 Inline graphic
10 2870.7407 13.55 2.4815 44.18
20 9286.4074 8.45 4180.6296 11.92
Inline graphic RGB 3000 0 0.0000 Inline graphic 0.0000 Inline graphic
10 1821.4691 15.53 102.0453 28.04
20 5426.1111 10.79 1015.6132 18.06
Inline graphic RGB 7000 0 0.0000 Inline graphic 0.0000 Inline graphic
10 3694.6023 12.45 2409.9333 14.31
20 6635.2041 9.92 4603.5389 11.50

Figure 17 presents the visual comparison for the Inline graphic RGB version of the standard Lena image between the noisy and enhanced reconstructions at Inline graphic and Inline graphic noise levels.

Fig. 17.

Fig. 17

Visual reconstruction results for a Inline graphic RGB Lena image under Inline graphic and Inline graphic depolarizing noise levels.

The results in this section confirm that the proposed NQQR representation model provides stable and scalable reconstruction performance under quantum noise, with median-based Monte Carlo estimation improves reconstruction quality without relying on quantum error correction techniques.

Conclusion

Ternary quantum image processing (TQIP) arises from integrating qutrit-based quantum computing with image representation and offers an alternative direction to conventional qubit-based encoding models. In this context, this paper introduced Novel Qutrit Quantum Representation (NQQR) model, a scalable representation model for encoding grayscale and RGB images of size Inline graphic within a ternary quantum system.

The proposed model encodes pixel positions using a superposition of 2n qutrits and represents grayscale or color intensity values using 6 qutrits corresponding to the range Inline graphic. For RGB images, an additional color qutrit is employed to distinguish color channels, while an ancilla qutrit is utilized to simplify multi-controlled N-qutrit gates, thereby reducing circuit complexity at the representation level.

Experimental results show that the NQQR model achieves a time complexity of Inline graphic by iteratively encoding all Inline graphic pixel positions and corresponding color intensity row by row. The optimized NQQR formulation further reduces quantum cost through the increased use of elementary one-qutrit and two-qutrit gates. Compared to non-optimized qubit/qutrit-based encoding models, quantum cost reductions of up to Inline graphic for grayscale images and Inline graphic for RGB images are achieved, while preserving scalability for large ternary quantum systems.

The results presented in this work are implemented and evaluated using Google Cirq for ternary quantum systems, including circuit construction and complexity analysis. This is consistent with most existing quantum image representation studies, due to the current limitations of available quantum hardware for native ternary (qutrit-based) systems. Furthermore, the noise resilience of the encoded images using the proposed model is evaluated under different levels of quantum depolarizing noise. The reconstructed images are obtained using Monte Carlo sampling, and the results demonstrate that the proposed statistical reconstruction approach effectively reduces the impact of quantum noise. In particular, the median-based Monte Carlo estimation significantly improves reconstruction quality across different image sizes and noise levels while maintaining scalability. As quantum technologies continue to evolve, future work can include validation of the proposed model using experimental platforms. While the present work focuses on image representation, future work can also explore the way that ternary encoding can be used for developing quantum image processing algorithms for TQIP, such as encryption or filtering.

Supplementary Information

Supplementary Material (190.5KB, pdf)

Author contributions

Conceptualization, M.R.; supervision, A.Y. and R.M.; software M.R.; validation M.R., R.M. and A.Y.; writing the paper, M.R., R.M. and A.Y. All authors have read and agreed to the published version of the manuscript.

Funding

Open access funding provided by The Science, Technology & Innovation Funding Authority (STDF) in cooperation with The Egyptian Knowledge Bank (EKB). ”Alexandria University, Egypt” is included in the Open access agreement for STDF & EKB.

Data availability

The complete Cirq-based implementation of the proposed NQQR representation model, including noise modeling and reconstruction procedures, is publicly available at Zenodo: https://doi.org/10.5281/zenodo.20357973

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.

Rasha Montaser and Ahmed Younes contributed equally to this work.

Change history

7/10/2026

The original online version of this Article was revised: In the original version of this Article, the Supplementary Material file, which was included with the initial submission, was omitted. The correct Supplementary Material file now accompanies the original Article.

References

  • 1.Forcer, T. M., Hey, A. J. G., Ross, D. A. & Smith, P. G. R. Superposition, entanglement and quantum computation. Quantum Inf. Comput.2, 97–116, 10.26421/qic2.2-1 (2002).
  • 2.Gyongyosi, L. & Imre, S. A survey on quantum computing technology. Comput. Sci. Rev.31, 51–71. 10.1016/j.cosrev.2018.11.002 (2019). [Google Scholar]
  • 3.Chae, E., Choi, J. & Kim, J. An elementary review on basic principles and developments of qubits for quantum computing. Nano Converg.11, 11. 10.1186/s40580-024-00418-5 (2024). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 4.Balamurugan, K. S., Sivakami, A., Mathankumar, M., Yalla, J. D. S. P. & Ahmad, I. Quantum computing basics, applications and future perspectives. J. Mol. Struct.1308, 137917. 10.1016/j.molstruc.2024.137917 (2024). [Google Scholar]
  • 5.Lund, B. D. & Shahriar, S. Quantum computing: A concise introduction. Encyclopedia. Diamond5, 173. 10.3390/encyclopedia5040173 (2025). [Google Scholar]
  • 6.Richards, R. K. Arithmetic Operations in Digital Computers. Van Nostrand’s University Series in Higher Mathematics (Van Nostrand, addressNew York, 1955).
  • 7.Bocharov, A., Roetteler, M. & Svore, K. M. Factoring with qutrits: Shor’s algorithm on ternary and metaplectic quantum architectures. Phys. Rev. A96, 012306. 10.1103/PhysRevA.96.012306 (2017). [Google Scholar]
  • 8.Wang, Y., Hu, Z., Sanders, B. C. & Kais, S. Qudits and high-dimensional quantum computing. Front. Phys.8, 10.3389/fphy.2020.589504 (2020).
  • 9.Morvan, A. et al. Qutrit randomized benchmarking. Phys. Revi. Lett.126, 210504. 10.1103/PhysRevLett.126.210504 (2021). [DOI] [PubMed] [Google Scholar]
  • 10.Sridharan, S., TS, G., Amirtharajan, R. & Praveenkumar, P. Quantum scrambling and dna based multilayer image encryption with qtrng and 6d hyperchaotic keys. Sci. Rep.15, 33933. 10.1038/s41598-025-10133-8 (2025). [DOI] [PMC free article] [PubMed]
  • 11.Inam, S., Kanwal, S., Amir, R., Ksibi, A. & Matloob, I. Quantum color image encryption using a novel 4d hyperchaotic lorenz system and fibonacci transform. Sci. Rep.15, 41439. 10.1038/s41598-025-25760-4 (2025). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 12.Majumdar, R. & Sur-Kolay, S. Designing ternary quantum error correcting codes from binary codes. J. Multiple-Valued Logic Soft Comput.40, 179–201. 10.1142/S0218126620501923 (2023). [Google Scholar]
  • 13.Wang, C., Yu, J., Pei, Z., Wang, Q. & Hong, C. A first successful factorization of rsa-2048 integer by d-wave quantum computer. Tsinghua Sci. Technol.30, 1270–1282 (2025). [Google Scholar]
  • 14.Cao, S. et al. Encoding optimization for quantum machine learning demonstrated on a superconducting transmon qutrit. Quantum Sci. Technol.9, 045037. 10.1088/2058-9565/ad7315 (2024). [Google Scholar]
  • 15.Verma, P. et al. V3dqutrit: A volumetric medical image segmentation based on 3d qutrit optimized modified tensor ring model. Sci. Rep.15, 15785. 10.1038/s41598-025-00537-x (2025). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 16.Le, P. Q., Dong, F. & Hirota, K. A flexible representation of quantum images for polynomial preparation, image compression, and processing operations. Quantum Inf. Process.10, 63–84. 10.1007/s11128-010-0177-y (2011). [Google Scholar]
  • 17.Zhang, Y., Lu, K., Gao, Y. & Wang, M. Neqr: A novel enhanced quantum representation of digital images. Quantum Inf. Process.12, 2833–2860. 10.1007/s11128-013-0567-z (2013). [Google Scholar]
  • 18.Xianhua, S., Shen, W. & Xiamu, N. Multi-channel quantum image representation based on phase transform and elementary transformations. J. Inf. Hiding Multimed. Signal Process.5, 574–585 (2014). [Google Scholar]
  • 19.Sang, J., Wang, S. & Li, Q. A novel quantum representation of color digital images. Quantum Inf. Process.16, 42. 10.1007/s11128-016-1463-0 (2016). [Google Scholar]
  • 20.Su, J., Guo, X., Liu, C., Lu, S. & Li, L. An improved novel quantum image representation and its experimental test on ibm quantum experience. Sci. Rep.11, 13879. 10.1038/s41598-021-93471-7 (2021). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 21.Hu, Y., Lu, D., Zhang, Q. & Xu, M. Quantum image representations based on density matrices in open quantum systems. EPJ Quantum Technol.11, 28. 10.1140/epjqt/s40507-024-00241-1 (2024). [Google Scholar]
  • 22.Dong, H., Lu, D. & Li, C. A novel qutrit representation of quantum image. Quantum Inf. Process.21, 108. 10.1007/s11128-022-03450-8 (2022). [Google Scholar]
  • 23.Das, S. & Caruso, F. A hybrid-qudit representation of digital rgb images. Sci. Rep.13, 13671. 10.1038/s41598-023-39906-9 (2023). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 24.Taheri, A. M., Ciriani, V. & Haghparast, M. Qutrit representation of quantum images: new quantum ternary circuit design. Quantum Inf. Process.23, 288. 10.1007/s11128-024-04484-w (2024). [Google Scholar]
  • 25.Rofail, M., Montaser, R. & Younes, A. A novel qutrit representation for rgb digital images. Sci. Rep.10.1038/s41598-025-27910-0 (2025). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 26.Barenco, A. et al. Elementary gates for quantum computation. Phys. Rev. A52, 3457–3467. 10.1103/PhysRevA.52.3457 (1995). [DOI] [PubMed] [Google Scholar]
  • 27.Nielsen, M. A. & Chuang, I. L. Quantum Computation and Quantum Information: 10th Anniversary Edition (Cambridge University Press, addressCambridge, 2010).
  • 28.Saini, R., Behera, B. K., Al-Kuwari, S. & Farouk, A. Neqrx: Efficient quantum image encryption with reduced circuit complexity (2024). arXiv:2204.07996.
  • 29.Khan, M. H. A., Perkowski, M. A., Khan, M. R. & Kerntopf, P. Ternary gfsop minimization using kronecker decision diagrams and their synthesis with quantum cascades. J. Multiple-Valued Logic Soft Comput.11, 567–602 (2005). [Google Scholar]
  • 30.Khan, M. H. A. Design of reversible/quantum ternary multiplexer and demultiplexer. Eng. Lett.13, 65–69 (2006). [Google Scholar]
  • 31.Khan, M. H. A. & Perkowski, M. A. Quantum ternary parallel adder/subtractor with partially-look-ahead carry. J. Syst. Archit.53, 453–464. 10.1016/j.sysarc.2007.01.007 (2007). [Google Scholar]
  • 32.Monfared, A. T. & Haghparast, M. Quantum ternary multiplication gate (qtmg): Toward quantum ternary multiplier and a new realization for ternary toffoli gate. J. Circuits, Syst. Comput.29, 2050071. 10.1142/S0218126620500711 (2020). [Google Scholar]
  • 33.Rani, P. M. N. & Datta, K. Improved ternary reversible logic synthesis using group theoretic approach. J. Circuits, Syst. Comput.29, 2050192. 10.1142/S0218126620501923 (2020). [Google Scholar]
  • 34.Chen, G., Wang, Y., Jian, L., Zhou, Y. & Liu, S. Ternary quantum key distribution protocol based on hadamard gate. Int. J. Theor. Phys.61, 26. 10.1007/s10773-022-05041-w (2022). [Google Scholar]
  • 35.Muthukrishnan, A. & Stroud, C. R. Multivalued logic gates for quantum computation. Phys. Rev. A62, 052309. 10.1103/PhysRevA.62.052309 (2000). [Google Scholar]
  • 36.Fan, F., Yang, G., Yang, G. & Hung, W. N. N. A synthesis method of quantum reversible logic circuit based on elementary qutrit quantum logic gates. J. Circuits, Syst. Comput.24, 1550121. 10.1142/S0218126615501212 (2015). [Google Scholar]
  • 37.Developers, Cirq. Cirq10.5281/zenodo.11398180 (2025). [Google Scholar]
  • 38.Reversible Benchmarks. Definitions of quantum and reversible circuit metrics. howpublishedhttps://reversiblebenchmarks.github.io/definitions.html. noteAccessed: April 2026.
  • 39.Liang, H.-R., Tao, X.-Y. & Zhou, N.-R. Quantum image encryption based on generalized affine transform and logistic map. Quantum Inf. Process.15, 2701–2724. 10.1007/s11128-016-1304-1 (2016). [Google Scholar]
  • 40.Daffer, S., Wódkiewicz, K., Cresser, J. D. & McIver, J. K. Depolarizing channel as a completely positive map with memory. Phys. Rev. A70, 010304(R). 10.1103/PhysRevA.70.010304 (2004). [Google Scholar]
  • 41.Metropolis, N. & Ulam, S. The monte carlo method. J. Am. Stat. Assoc.44, 335–341. 10.1080/01621459.1949.10483310 (1949). [DOI] [PubMed] [Google Scholar]
  • 42.Kroese, D. P., Taimre, T. & Botev, Z. I. Handbook of Monte Carlo Methods (Wiley, 2011).
  • 43.Wang, Z., Bovik, A., Sheikh, H. & Simoncelli, E. Image quality assessment: from error visibility to structural similarity. IEEE Trans. Image Process.13, 600–612. 10.1109/TIP.2003.819861 (2004). [DOI] [PubMed] [Google Scholar]
  • 44.Pedersen, M. & Hardeberg, J. Y. Full-reference image quality metrics: Classification and evaluation. Found. Trends Comput. Graph. Vis.7, 1–80. 10.1561/0600000037 (2012). [Google Scholar]
  • 45.Gonzalez, R. C. & Woods, R. E. Digital Image Processing (Pearson, 2018), edition4th edn.
  • 46.University of Southern California, S. & Institute, I. P. Usc-sipi image database. howpublishedhttps://sipi.usc.edu/database/. noteAccessed: 2026.

Associated Data

This section collects any data citations, data availability statements, or supplementary materials included in this article.

Supplementary Materials

Supplementary Material (190.5KB, pdf)

Data Availability Statement

The complete Cirq-based implementation of the proposed NQQR representation model, including noise modeling and reconstruction procedures, is publicly available at Zenodo: https://doi.org/10.5281/zenodo.20357973


Articles from Scientific Reports are provided here courtesy of Nature Publishing Group

RESOURCES