Optimization of circuits is an essential task for both quantum and classical computers to improve their efficiency. In contrast, classical logic optimization is known to be difficult, and a lot of heuristic approaches have been developed so far. In this paper, we define and construct a quantum algorithmic primitive called quantum circuit unoptimization, which makes a given quantum circuit complex by introducing some redundancies while preserving circuit equivalence, i.e., the inverse operation of circuit optimization. Using quantum circuit unoptimization, we propose the quantum circuit equivalence test, a decision problem contained both in NP and BQP classes, but is not trivially included in the P class. Furthermore, as a practical application, we construct concrete unoptimization recipes to generate compiler benchmarks and evaluate circuit optimization performance using and . Our numerical simulations demonstrate that the quantum circuit unoptimizer systematically generates redundant circuits that are challenging for compilers to optimize, which can be used to compare the performance of different compilers and improve them. We also offer potential applications of quantum circuit unoptimization, such as generating quantum advantageous machine learning data sets and quantum computer fidelity benchmarks.
Optimization of circuits is an essential task for both quantum and classical computers to improve their efficiency. In contrast, classical logic optimization is known to be difficult, and a lot of heuristic approaches have been developed so far. In this paper, we define and construct a quantum algorithmic primitive called quantum circuit unoptimization, which makes a given quantum circuit complex by introducing some redundancies while preserving circuit equivalence, i.e., the inverse operation of circuit optimization. Using quantum circuit unoptimization, we propose the quantum circuit equivalence test, a decision problem contained both in NP and BQP classes, but is not trivially included in the P class. Furthermore, as a practical application, we construct concrete unoptimization recipes to generate compiler benchmarks and evaluate circuit optimization performance using and . Our numerical simulations demonstrate that the quantum circuit unoptimizer systematically generates redundant circuits that are challenging for compilers to optimize, which can be used to compare the performance of different compilers and improve them. We also offer potential applications of quantum circuit unoptimization, such as generating quantum advantageous machine learning data sets and quantum computer fidelity benchmarks.
Quantum circuit unoptimization is an algorithm that transforms a quantum circuit into a different circuit that uses more gate operations while maintaining the same unitary transformation. We demonstrate that this method can implement digital zero-noise extrapolation (ZNE), a quantum error mitigation technique. By employing quantum circuit unoptimization as a form of circuit folding, noise can be systematically amplified. The key advantages of this approach are twofold. First, its ability to generate an exponentially increasing number of distinct circuit variants as the noise level is amplified, which allows noise averaging over many circuit variants with slightly different circuit structure. Averaging over these variants can mitigate the effect of biased error propagation due to the significantly altered circuit structure from quantum circuit unoptimization, or biased noise sources on a quantum processor. Second, quantum circuit unoptimization by design resists circuit simplification back to the original unmodified circuit, making it plausible to use ZNE in contexts where circuit compiler optimization is applied server-side. We evaluate the effectiveness of quantum circuit unoptimization as a noise-scaling method for ZNE in two test cases using depolarizing noise numerical simulations: random quantum volume circuits, where the observable is the heavy output probability, and QAOA circuits for the (unweighted) maximum cut problem on random 3-regular graphs, where the observable is the cut value. We show that using quantum circuit unoptimization to perform ZNE can approximately recover signal from noisy quantum simulations.
Quantum-mechanical phenomena are playing an increasing role in information processing as transistor sizes approach the nanometer level, while the securest forms of communication rely on quantum data encoding. When they involve a finite number of basis states, these phenomena can be modeled as quantum circuits, the quantum analogue of conventional or classical logic circuits. Simulation of quantum circuits can therefore be used as a tool to evaluate issues in the design of quantum information processors. Unfortunately, simulating such phenomena efficiently is exceedingly difficult. The matrices representing quantum operators (gates) and vectors modeling quantum states grow exponentially with the number of quantum bits. The information represented by quantum states and operators often exhibits structure that can be exploited when simulating certain classes of quantum circuits. We study the development of simulation methods that run on classical computers and take advantage of such repetitions and redundancies. In particular, we define a new data structure for simulating quantum circuits called the quantum information decision diagram (QuIDD). A QuIDD is a compressed graph representation of a vector or matrix and permits computations to be performed directly on the compressed data. We develop a comprehensive set of algorithms for operating on QuIDDs in both the state-vector and density-matrix formats, and evaluate their complexity. These algorithms have been implemented in a general-purpose simulator program for quantum-mechanical applications called QuIDDPro. Through extensive experiments conducted on representative quantum simulation applications, including Grover's search algorithm, error characterization, and reversible circuits, we demonstrate that QuIDDPro is faster than other existing quantum-mechanical simulators such as the National Institute of Standards and Technology's QCSim program, and is far more memory-efficient. Using QuIDDPro, we explore the advantages of quantum computation over classical computation, simulate quantum errors and error correction, and study the impact of numerical precision on the fidelity of simulations. We also develop several novel algorithms for testing quantum circuit equivalence and compare them empirically. The QuIDDPro software is equipped with a user-friendly interface and is distributed with numerous example scripts. It has been used as a laboratory supplement for quantum computing courses at several universities.
Quantum circuit optimization is essential for improving the performance of quantum algorithms, particularly on Noisy Intermediate-Scale Quantum (NISQ) devices with limited qubit connectivity and high error rates. Pattern matching has proven to be an effective technique for identifying and optimizing subcircuits by replacing them with functionally equivalent, efficient versions, including reducing circuit depth and facilitating platform portability. However, existing approaches face challenges in handling large-scale circuits and numerous transformation rules, often leading to redundant matches and increased compilation time. In this study, we propose a novel framework for quantum circuit optimization based on pattern matching to enhance its efficiency. Observing redundancy in applying existing transformation rules, our method employs a pattern tree structure to organize these rules, reducing redundant operations during the execution of the pattern-matching algorithm and improving matching efficiency. We design and implement a compilation framework to demonstrate the practicality of the pattern tree approach. Experimental results show that pattern-tree-based pattern matching can reduce execution time by an average of 20% on a well-accepted benchmark set. Furthermore, we analyze how to build a pattern tree to maximize the optimization of compilation time. The evaluation results demonstrate that our approach has the potential to optimize compilation time by 90%.
Quantum computing is a new and advanced topic that refers to calculations based on the principles of quantum mechanics. It makes certain kinds of problems be solved easier compared to classical computers. This advantage of quantum computing can be used to implement many existing problems in different fields incredibly effectively. One important field that quantum computing has shown great results in machine learning. Until now, many different quantum algorithms have been presented to perform different machine learning approaches. In some special cases, the execution time of these quantum algorithms will be reduced exponentially compared to the classical ones. But at the same time, with increasing data volume and computation time, taking care of systems to prevent unwanted interactions with the environment can be a daunting task and since these algorithms work on machine learning problems, which usually includes big data, their implementation is very costly in terms of quantum resources. Here, in this paper, we have proposed an approach to reduce the cost of quantum circuits and to optimize quantum machine learning circuits in particular. To reduce the number of resources used, in this paper an approach including different optimization algorithms is considered. Our approach is used to optimize quantum machine learning algorithms for big data. In this case, the optimized circuits run quantum machine learning algorithms in less time than the original ones and by preserving the original functionality. Our approach improves the number of quantum gates by 10.7% and 14.9% in different circuits respectively. This is the amount of reduction for one iteration of a given sub-circuit U in the main circuit. For cases where this sub-circuit is repeated more times in the main circuit, the optimization rate is increased. Therefore, by applying the proposed method to circuits with big data, both cost and performance are improved.
Quantum computing has the potential to tackle complex problems that are intractable for classical computers, thanks to its unique properties, such as superposition and entanglement. Nevertheless, developing efficient quantum programs remains challenging because of the diversity and rapid evolution of hardware, and limited access to quantum devices. To tackle these issues, we propose an open-source, profile-guided development flow that allows programmers to refine and optimize quantum code using quantum circuit simulators to evaluate program performance without the need for physical quantum hardware. In the proposed flow, the performance data collected in previous simulation runs helps guide compiler optimizations to generate efficient quantum circuits. An integrated visualization tool further aids programmers by associating performance data with the quantum program code, making it easier to pinpoint code regions for potential improvement. This development flow offers a practical path toward the development of novel and efficient quantum algorithms for various quantum computing platforms.
Quantum algorithms for computational linear algebra promise up to exponential speedups for applications such as simulation and regression, making them prime candidates for hardware realization. But these algorithms execute in a model that cannot efficiently store matrices in memory like a classical algorithm does, instead requiring developers to implement complex expressions for matrix arithmetic in terms of correct and efficient quantum circuits. Among the challenges for the developer is navigating a cost model in which conventional optimizations for linear algebra, such as subexpression reuse, can be inapplicable or unprofitable.
In this work, we present Cobble, a language for programming with quantum computational linear algebra. Cobble enables developers to express and manipulate the quantum representations of matrices, known as block encodings, using high-level notation that automatically compiles to correct quantum circuits. Cobble features analyses that compute the time and space usage of programs, as well as optimizations that reduce overhead and generate efficient circuits using state-of-the-art techniques such as the quantum singular value transformation. We evaluate Cobble on benchmark kernels for simulation, regression, search, and other applications, showing 2.6x-25.4x speedups on these benchmarks compared to the unoptimized baseline.