1 Introduction

According to Moore’s law [1], traditional computer architectures will reach their physical limits in the near future. Quantum computers [2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24] provide a tool to solve problems more efficiently than ever would be possible with traditional computers [2,3,4,5,6,7,8,9,10,11, 16]. The power of quantum computing is based on the fundamentals of quantum mechanics. In a quantum computer, information is represented by quantum information, and information processing is achieved by quantum gates that realize quantum operations [2,3,4,5,6,7,8,9,10,11, 16, 25, 26]. These quantum operations are performed on the quantum states, which are then outputted and measured in a measurement phase. The measurement process is applied to each quantum state where the quantum information conveyed by the quantum states is converted into classical bits. Quantum computers have been demonstrated in practice [2,3,4,5,6,7,8,9], and several implementations are currently in progress [2,3,4,5,6,7,8,9,10,11, 16,17,18,19,20].

In the physical layer of a gate-model quantum computer, the device contains quantum gates, quantum ports (of quantum gates), and quantum wires for the quantum circuit. (Note: The term quantum circuit, in general, refers to software, not hardware; it is a description or prescription for what quantum operations should be applied and when and does not refer to a physically implemented circuit analogous to a printed electronic circuit. In our setting, it refers to the hardware layer.) In contrast to traditional automated circuit design [27,28,29,30,31,32,33], a quantum system cannot participate in more than one quantum gate simultaneously. As a corollary, the quantum gates of a quantum circuit are applied in several rounds in the physical layer of the quantum circuit [2,3,4,5,6,7,8,9,10,11, 16,17,18,19,20].

The physical layout design and optimization of quantum circuits have different requirements with several open questions and currently represent an active area of study [2,3,4,5,6,7,8,9,10,11, 16,17,18,19,20]. Assuming that the goal is to construct a reduced quantum circuit that can simulate the original system, the reduction process should be taken on the number of input quantum states, gate operations of the quantum circuit, and the number of output measurements. Another important question is the maximization of objective function associated with an arbitrary computational problem that is fed into the quantum computer. These parallel requirements must be satisfied simultaneously, which makes the optimization procedure difficult and is an emerging issue in present and future quantum computer developments.

In the proposed QTAM method, the goal is to determine a topology for the quantum circuits of quantum computer architectures that can solve arbitrary computational problems such that the quantum circuit is minimized in the physical layer, and the objective function of an arbitrary selected computational problem is maximized. The physical layer minimization covers the simultaneous minimization of the quantum circuit area (quantum circuit height and depth of the quantum gate structure, where the depth refers to the number of time steps required for the quantum operations making up the circuit to be run on quantum hardware), the total area of the quantum wires of the quantum circuit, the maximization of the objective function, and the minimization of the required number of input quantum systems and output measurements. An important aim of the physical layout minimization is that the resulting quantum circuit should be identical to a high-complexity reference quantum circuit (i.e., the reduced quantum circuit should be able to simulate a nonreduced quantum circuit).

The minimization of the total quantum wire length in the physical layout is also an objective in QTAM. It serves to improve the processing in the topology of the quantum circuit. However, besides the minimization of the physical layout of the quantum circuit, the quantum computer also has to solve difficult computational problems very efficiently (such as the maximization of an arbitrary combinatorial optimization objective function [17,18,19,20]). To achieve this goal in the QTAM method, we also defined an objective function that provides the maximization of objective functions of arbitrary computational problems. The optimization method can be further tuned by specific input constraints on the topology of the quantum circuit (paths in the quantum circuit, organization of quantum gates, required number of rounds of quantum gates, required number of measurement operators, Hamiltonian minimization, entanglement between quantum states, etc.) or other hardware restrictions of quantum computers, such as the well-known no-cloning theorem [23]. The various restrictions on quantum hardware, such as the number of rounds required to be integrated into the quantum gate structure, or entanglement generation between the quantum states is included in the scheme. These constraints and design attributes can be handled in the scheme through the definition of arbitrary constraints on the topology of the quantum circuit or by constraints on the computational paths.

The combinatorial objective function is measured on a computational basis, and an objective function value is determined from the measurement result to quantify the current state of the quantum computer. Quantum computers can be used for combinatorial optimization problems. These procedures aim to use the quantum computer to produce a quantum system that is dominated by computational basis states such that a particular objective function is maximized.

Recent experimental realizations of quantum computers are qubit architectures [2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20], and the current quantum hardware approaches focus on qubit systems (i.e., the dimension d of the quantum system is two, \(d=2\)). However, while the qubit layout is straightforwardly inspirable by ongoing experiments, the method is developed for arbitrary dimensions to make it applicable for future implementations. Motivated by these assumptions, we therefore would avoid the term ‘qubit’ in our scheme to address the quantum states and instead use the generalized term, ‘quantum states’ throughout, which refers to an arbitrary-dimensional quantum system. We also illustrate the results through superconducting quantum circuits [2,3,4,5,6]; however, the framework is general and flexible, allowing a realization for near-term gate-model quantum computer implementations.

The novel contributions of this paper are as follows:

  • We define a method for designing quantum circuits for gate-model quantum computers.

  • We conceive the QTAM algorithm, which provides a quantum circuit minimization on the physical layout (circuit depth and area), quantum wire length minimization, objective function maximization, input size and measurement size minimization for quantum circuits.

  • We define a multilayer structure for quantum computations using the hardware restrictions on the topology of gate-model quantum computers.

This paper is organized as follows. In Sect. 2, the related works are summarized. Section 3 proposes the system model. In Sect. 4, the details of the optimization method are discussed, while Sect. 5 studies the performance of the model. Finally, Sect. 6 concludes the paper. Supplemental information is included in “Appendix.”

2 Related works

The related works are summarized as follows.

A strong theoretical background on the logical model of gate-model quantum computers can be found in [17,18,19]. In [16], the model of a gate-model quantum neural network model is defined. The gate-model quantum neural network refers to a quantum neural network implemented on gate-model quantum computers.

In [34], the authors defined a hierarchical approach to computer-aided design of quantum circuits. The proposed model was designed for the synthesis of permutation class of quantum logic circuits. The method integrates evolutionary and genetic approaches to evolve arbitrary quantum circuit specified by a target unitary matrix. Instead of circuit optimization, the work focuses on circuit synthesis.

In [35], the authors propose a simulation of quantum circuits by low-rank stabilizer decompositions. The work focuses on the problem of simulation of quantum circuits containing a few non-Clifford gates. The framework focuses on the theoretical description of the stabilizer rank. The authors also derived the simulation cost.

A method for the designing of a T-count optimized quantum circuit for integer multiplication with \(4n+1\) qubits was defined in [36]. The T-count [37] measures the number of T-gates and has relevance because of the implementation cost of a T-gate is high. The aim of the T-count optimization is to reduce the number of T-gates without substantially increasing the number of qubits. The method also applied for quantum circuit designs of integer division [38]. The optimization takes into consideration both the T-count and T-depth, since T-depth is also an important performance measure to reduce the implementation costs. Another method for designing of reversible floating point divider units was proposed in [39].

In [40], a methodology for quantum logic gate construction was defined. The main purpose of the scheme was to construct fault-tolerant quantum logic gates with a simple technique. The method is based on the quantum teleportation method [41].

A method for the synthesis of depth-optimal quantum circuits was defined in [42]. The aim of the proposed algorithm is to compute the depth-optimal decompositions of logical operations via an application of the so-called meet-in-the-middle technique. The authors also applied their scheme for the factorizations of some quantum logical operations into elementary gates in the Clifford+T set.

A framework to the study the compilation and description of fault-tolerant, high-level quantum circuits is proposed in [43]. The authors defined a method to convert high-level quantum circuits consisting of commonly used gates into a form employing all decompositions and ancillary protocols needed for fault-tolerant error correction. The method also represents a useful tool for quantum hardware architectures with topological quantum codes.

An optimization algorithm for quantum computers is defined in [18]. The optimization algorithm is called Quantum Approximate Optimization Algorithm (QAOA). The goal of QAOA is to output approximate solutions for combinatorial optimization problems fed into the quantum computer. The algorithm is implementable via gate-model quantum computers. It also has been found in this work that the depth of the quantum circuit grows linearly with a particular control parameter. The authors also studied the performance of the algorithm in function of the control parameters.

In [44], the authors studied the attributes of the QAOA algorithm. As they concluded, at some particular setting and conditions the objective function values could become concentrated. As a result, the number of running sequences of the quantum computer can be reduced.

In [45], the authors analyzed the performance, working mechanism, and the experimental implementation of the QAOA algorithm on near-term gate-model quantum devices. The work also defined a parameter optimization procedure for the QAOA and evaluated the performance of QAOA and compared it with quantum annealing. As the authors found, the QAOA can learn via optimization to utilize non-adiabatic mechanisms.

The implementation of QAOA with parallelizable gates is studied in [46]. The work defines a scheme to parallelize the QAOA for arbitrary all-to-all connected problem graphs in a layout of qubits. The proposed method is defined by single-qubit operations, and the interactions are set by pair-wise CNOT gates among nearest neighbors. As the work concluded, this structure allows for a parallelizable implementation in quantum devices with a square lattice geometry.

In [47], the performance of QAOA is studied on different problems. The analysis covers the MaxCut combinatorial optimization problem and the problem of quantum circuit optimizations on a classical computer using automatic differentiation and stochastic gradient descent. The work also revealed that QAOA can exceed the performance of a classical polynomial time algorithm (Goemans–Williamson algorithm [48]) with modest circuit depth. The work also concluded that the performance of QAOA with fixed circuit depth is insensitive to problem size.

In [49], the authors studied the problem of ultrafast state preparation via the QAOA with long-range interactions. The works provide an application for the QAOA in near-term gate-model quantum devices. As the authors concluded, the QAOA-based approach leads to an extremely efficient state preparation, for example the method allows us to prepare Greene–Horne–Zeilinger (GHZ) states with \(\mathcal {O}\left( 1 \right) \) circuit depth. The results were also demonstrated by several other examples.

Another experimental approach for the implementation of qubit entanglement and parallel logic operations with a superconducting circuit was presented in [50]. In this work, the authors generated entangled GHZ states with up to 10 qubits connecting to a bus resonator in a superconducting circuit. In the proposed implementation, the resonator-mediated qubit–qubit interactions are used to control the entanglement between the qubits and to operate on different pairs in parallel.

A review on the noisy intermediate-scale quantum (NISQ) era and its technological effects and impacts on quantum computing can be found in [51].

The subject of quantum computational supremacy (tasks and problems that quantum computers can solve but are beyond the capability of any classical computer) and its practical implications are discussed in [52]. For a work on the complexity-theoretic foundations of quantum supremacy, see [53].

A comprehensive survey on quantum channels can be found in [11], while for a survey on quantum computing technology, see [54].

3 System model

The simultaneous physical layer minimization and the maximization of the objective function are achieved by the Quantum Triple Annealing Minimization (QTAM) algorithm. The QTAM algorithm utilizes the framework of simulated annealing (SA) [27,28,29,30,31,32,33], which is a stochastic point-to-point search method.

The procedure of the QTAM algorithm with the objective functions are depicted in Fig. 1. The detailed descriptions of the methods and procedures are included in the next sections.

Fig. 1
figure 1

The QTAM method for quantum computers. The quantum gate (QG) circuit computation model consists of an input array of n quantum states (depicted by the green box), layers of quantum gates integrated into a quantum circuit (depicted by the purple box), and a measurement phase (depicted by the orange box). The quantum gates that act on the quantum states formulate a quantum circuit with a given circuit height and depth. The area of the quantum circuit is minimized by objective function \(F_{{1}} \), while the total quantum wire area of the quantum circuit is minimized by \(F_{{2}} \) (\(F_{{1}} \wedge F_{{2}} \) is referred via the quantum circuit minimization). The result of the minimization is a quantum circuit of quantum gates with minimized quantum circuit area, minimized total quantum wire length, and a minimized total Hamiltonian operator. The maximization of a corresponding objective function of arbitrary selected computational problems for the quantum computer is achieved by \(F_{{3}} \) (referred via the objective function maximization). Objective functions \(F_{{4}} \) and \(F_{{5}} \) are defined for the minimization of the number of quantum states (minimization of input size), and the total number of measurements (minimization of measurements) (Color figure online)

3.1 Computational model

By theory, in an SA-based procedure a current solution \(s_{A} \) is moved to a neighbor \(s_{B} \), which yields an acceptance probability [27,28,29,30,31,32,33]

$$\begin{aligned} {\Pr }\left( f\left( s_{A} \right) ,f\left( s_{B} \right) \right) =\frac{{1}}{{1}+\text {e}^{\left( \frac{f\left( s_{A} \right) -f\left( s_{B} \right) }{Tf\left( s_{A} \right) } \right) } } , \end{aligned}$$
(1)

where \(f\left( s_{A} \right) \) and \(f\left( s_{B} \right) \) represent the relative performances of the current and neighbor solutions, while T is a control parameter, \(T\left( t\right) =T_{\max } \mathrm{exp}\left( -R\left( t/k\right) \right) \), where R is the temperature decreasing rate, t is the iteration counter, k is a scaling factor, while \(T_{\max } \) is an initial temperature.

Since SA is a probabilistic procedure it is important to minimize the acceptance probability of unfavorable solutions and avoid getting stuck in a local minima.

Without loss of generality, if T is low, (1) can be rewritten in function of \(f\left( s_{A} \right) \) and \(f\left( s_{B} \right) \) as

$$\begin{aligned} {\Pr }\left( f\left( s_{A} \right) ,f\left( s_{B} \right) \right) =\left\{ \begin{array}{ll} 1,&{}\text {if }f\left( s_{A}\right) >f\left( s_{B} \right) \\ 0,&{}\text {if }f\left( s_{A} \right) \le f\left( s_{B} \right) \end{array} \right. \end{aligned}$$
(2)

In the QTAM algorithm, we take into consideration that the objectives, constraints, and other functions of the method, by some fundamental theory, are characterized by different magnitude ranges [27,28,29,30,31,32,33]. To avoid issues from these differences in the QTAM algorithm, we define three annealing temperatures, \(T_{f} \left( t\right) \) for objectives, \(T_{g} \left( t\right) \) for constraints and \(T_{c} \left( t\right) \) for the probability distribution closeness (distance of the output distributions of the reference quantum circuit and the reduced quantum circuit).

In the QTAM algorithm, the acceptance probability of a new solution \(s_{B} \) at a current solution \(s_{A} \) is as

$$\begin{aligned} {\Pr }\left( s_{A} ,s_{B} \right) =\frac{{1}}{{1}+\text {e}^{\tilde{d}\left( f\right) T_{f} \left( t\right) } \text {e}^{\tilde{d}\left( g\right) T_{g} \left( t\right) } \text {e}^{\tilde{d}\left( c\right) T_{c} \left( t\right) } } , \end{aligned}$$
(3)

where \(\tilde{d}\left( f\right) \), \(\tilde{d}\left( g\right) \) and \(\tilde{d}\left( c\right) \) are the average values of objective, constraint and distribution closeness domination, see Algorithm 1.

The aim of the QTAM algorithm is to minimize the cost function

$$\begin{aligned} \min f\left( \mathrm{x}\right) =\alpha _{{1}} F_{{1}} \left( \mathrm{x}\right) +\cdots +\alpha _{N_{obj} } F_{N_{obj} } \left( \mathrm{x}\right) +F_{s} , \end{aligned}$$
(4)

where \(\mathrm{x}\) is the vector of design variables, while \(\alpha \) is the vector of weights, while \(N_{obj} \) is the number of primarily objectives. Other i secondary objectives (aspect ratio of the quantum circuit, overlaps, total net length, etc.) are minimized simultaneously via the single-objective function \(F_{s} \) in (4) as

$$\begin{aligned} F_{s} =\sum _{i} \alpha _{i} F_{i} \left( x\right) . \end{aligned}$$
(5)

3.2 Objective functions

We defined \(N_{obj} =5\) objective functions for the QTAM algorithm. Objective functions \(F_{{1}} \) and \(F_{{2}} \) are defined for minimization of QG quantum circuit in the physical layer. The aim of objective function \(F_{{1}} \) is the minimization of the \(A_{QG} \) quantum circuit area of the QG quantum gate structure,

$$\begin{aligned} F_{{1}} :\min \left( A_{QG} \right) =\min \left( H'_{QG} \cdot D'_{QG} \right) , \end{aligned}$$
(6)

where \(H'_{QG} \) is the optimal circuit height of QG, while \(D'_{QG} \) is the optimal depth of QG.

Focusing on superconducting quantum circuits [2,3,4,5,6], the aim of \(F_{{2}} \) is the physical layout minimization of the \(w_{QG} \) total quantum wire area of QG, as

$$\begin{aligned} F_{{2}} :w_{QG} =\min \sum _{k=1}^{h} \left( \sum _{i=1}^{p} \sum _{j=1}^{q} \ell _{ij} \cdot \delta _{ij} \left( \psi _{ij} \right) \right) , \end{aligned}$$
(7)

where h is the number of nets of the QG circuit, p is the number of quantum ports of the QG quantum circuit considered as sources of a condensate wave function amplitude [2,3,4,5,6], and q the number of quantum ports considered as sinks of a condensate wave function amplitude, \(\ell _{ij} \) is the length of the quantum wire ij, \(\delta _{ij} \) is the effective width of the quantum wire ij, while \(\psi _{ij} \) is the (root-mean-square) condensate wave function amplitude [2,3,4,5,6] associated with the quantum wire ij.

Objective function \(F_{{3}} \) is defined for the maximization of the expected value of an objective function \(C_{L} (\vec {\Phi })\) as

$$\begin{aligned} F_{3} :\max {C_{L} (\vec {\Phi })}=\max {\langle \vec {\Phi }|C|\vec {\Phi }\rangle }, \end{aligned}$$
(8)

where C is an objective function, \(\vec {\Phi }\) is a collection of L parameters

$$\begin{aligned} \vec {\Phi }=\Phi _{{1}} ,\ldots ,\Phi _{L} \end{aligned}$$
(9)

such that with L unitary operations, state \(|\vec {\Phi }\rangle \) is evaluated as

$$\begin{aligned} |\vec {\Phi }\rangle =U_{L} \left( \Phi _{L} \right) ,\ldots ,U_{{1}} \left( \Phi _{{1}} \right) \left| \varphi \right\rangle , \end{aligned}$$
(10)

where \(U_{i} \) is an ith unitary that depends on a set of parameters \(\Phi _{i} \), while \(\left| \varphi \right\rangle \) is an initial state. Thus the goal of \(F_{{3}} \) is to determine the L parameters of \(\vec {\Phi }\) [see (9)] such that \(\langle \vec {\Phi }|C|\vec {\Phi }\rangle \) is maximized.

Objective functions \(F_{{4}} \) and \(F_{{5}} \) are defined for the minimization of the number of input quantum states and the number of required measurements. The aim of objective function \(F_{{4}} \) is the minimization of the number of quantum systems on the input of the QG circuit,

$$\begin{aligned} F_{{4}} :\min \left( n\right) . \end{aligned}$$
(11)

The aim of objective function \(F_{{5}} \) is the minimization of the total number of measurements in the M measurement block,

$$\begin{aligned} F_{{5}} :\min \left( m\right) =\min {\left( N_{M} \left| M\right| \right) }, \end{aligned}$$
(12)

where \(m=N_{M} \left| M\right| \), where \(N_{M} \) is the number of measurement rounds, \(\left| M\right| \) is the number of measurement gates in the M measurement block.

3.3 Constraint violations

The optimization at several different objective functions results in different Pareto fronts [27,28,29,30] of placements of quantum gates in the physical layout. These Pareto fronts allow us to find feasible tradeoffs between the optimization objectives of the QTAM method. The optimization process includes diverse objective functions, constraints, and optimization criteria to improve the performance of the quantum circuit and to take into consideration the hardware restrictions of quantum computers. In the proposed QTAM algorithm, the constraints are endorsed by the modification of the Pareto dominance [27,28,29,30] values by the different sums of constraint violation values. We defined three different constraint violation values.

3.3.1 Distribution closeness dominance

In the QTAM algorithm, the Pareto dominance is first modified with the sum of distribution closeness violation values, denoted by \(c_{s} \left( \cdot \right) \). The aim of this iteration is to support the closeness of output distributions of the reduced quantum circuit QG to the output distribution of the reference quantum circuit \(QG_{R} \).

Let \(P_{QG_{R} } \) the output distribution after the M measurement phase of the reference (original) quantum circuit \(QG_{R} \) to be simulated by QG, and let \(Q_{QG} \) be the output distribution of the actual, reduced quantum circuit QG. The distance between the quantum circuit output distributions \(P_{QG_{R} } \) and \(Q_{QG} \) (distribution closeness) is straightforwardly yielded by the relative entropy function, as

$$\begin{aligned} D\left( \left. P_{QG_{R} } \right\| Q_{QG} \right) =\sum _{i} P_{QG_{R} } \left( i\right) \log _{2} \frac{P_{QG_{R} } \left( i\right) }{Q_{QG} \left( i\right) } . \end{aligned}$$
(13)

For two solutions x and y, the \(d_{x,y} \left( c\right) \) distribution closeness dominance function is defined as

$$\begin{aligned} d_{x,y} \left( c\right) =c_{s} \left( x\right) -c_{s} \left( y\right) , \end{aligned}$$
(14)

where \(c_{s} \left( \cdot \right) \) is evaluated for a given solution z as

$$\begin{aligned} c_{s} \left( z\right) =\sum _{i=1}^{N_{v} } v_{i}^{c} , \end{aligned}$$
(15)

where \(v_{i}^{c} \) is an ith distribution closeness violation value, \(N_{v} \) is the number of distribution closeness violation values for a solution z.

In terms of distribution closeness dominance, x dominates y if the following relation holds:

$$\begin{aligned} \begin{aligned}&{\left( \left( c_{s} \left( x\right)<0\right) \wedge \left( c_{s} \left( y\right)<0\right) \wedge \left( c_{s} \left( x\right) >c_{s} \left( y\right) \right) \right) } \\&\quad \vee {\left( \left( c_{s} \left( x\right) =0\right) \wedge \left( c_{s} \left( y\right) <0\right) \right) ,} \end{aligned} \end{aligned}$$
(16)

thus (16) states that x dominates y if both x and y are unfeasible, and x is closer to feasibility than y, or x is feasible and y is unfeasible.

By similar assumptions, y dominates x if

$$\begin{aligned} \begin{aligned}&{\left( \left( c_{s} \left( x\right)<0\right) \wedge \left( c_{s} \left( y\right)<0\right) \wedge \left( c_{s} \left( x\right)<c_{s} \left( y\right) \right) \right) } \\&\quad \vee {\left( \left( c_{s} \left( x\right) <0\right) \wedge \left( c_{s} \left( y\right) =0\right) \right) .} \end{aligned} \end{aligned}$$
(17)

3.3.2 Constraint dominance

The second modification of the Pareto dominance is by the sum of constraint violation values,

$$\begin{aligned} d_{x,y} \left( g\right) =g_{s} \left( x\right) -g_{s} \left( y\right) , \end{aligned}$$
(18)

where \(g_{s} \left( \cdot \right) \) is the sum of all constraint violation values, evaluated for a given solution z as

$$\begin{aligned} g_{s} \left( z\right) =\sum _{i=1}^{N_{g} } v_{i}^{g} , \end{aligned}$$
(19)

where \(v_{i}^{g} \) is an ith constraint violation value, \(N_{g} \) is the number of constraint violation values for a solution z.

Similar to (16) and (17), in terms of constraint dominance, x dominates y if the following relation holds:

$$\begin{aligned} \begin{aligned}&{\left( \left( g_{s} \left( x\right)<0\right) \wedge \left( g_{s} \left( y\right)<0\right) \wedge \left( g_{s} \left( x\right) >g_{s} \left( y\right) \right) \right) } \\&\quad \vee {\left( \left( g_{s} \left( x\right) =0\right) \wedge \left( g_{s} \left( y\right) <0\right) \right) ,} \end{aligned} \end{aligned}$$
(20)

thus (16) states that x dominates y if both x and y are unfeasible, and x is closer to feasibility than y, or x is feasible and y is unfeasible.

By similar assumptions, y dominates x with respect to \(g_{s} \left( \cdot \right) \) if

$$\begin{aligned} \begin{aligned}&{\left( \left( g_{s} \left( x\right)<0\right) \wedge \left( g_{s} \left( y\right)<0\right) \wedge \left( g_{s} \left( x\right)<g_{s} \left( y\right) \right) \right) } \\&\quad \vee {\left( \left( g_{s} \left( x\right) <0\right) \wedge \left( g_{s} \left( y\right) =0\right) \right) .} \end{aligned} \end{aligned}$$
(21)

3.3.3 Objective dominance

Let x and y refer to two solutions, then, by theory, the \(d_{x,y} \left( f\right) \) objective dominance function is defined as

$$\begin{aligned} d_{x,y} \left( f\right) =\prod _{i=1,f_{{1}} \left( x\right) \ne f_{{1}} \left( y\right) }^{N_{obj} } \frac{\left| f_{i} \left( x\right) -f_{i} \left( y\right) \right| }{R_{i} } , \end{aligned}$$
(22)

where \(N_{obj} \) is the number of objectives (in our setting \(N_{obj} =5\)), \(R_{i} \) is the range of objective i, while x dominates y if \(f_{i} \left( x\right) \le f_{i} \left( y\right) \) for \(\forall _{i} =1,\ldots ,N_{obj} \), and for at least one i the relation \(f_{i} \left( x\right) <f_{i} \left( y\right) \) holds.

3.4 Objective function maximization

The quantum circuit QG executes operations in the \({{\mathcal {H}}}\) Hilbert space. The dimension of the \({{\mathcal {H}}}\) space is

$$\begin{aligned} \mathrm{dim}\left( {{\mathcal {H}}}\right) =d^{n} , \end{aligned}$$
(23)

where d is the dimension of the quantum system (\(d=2\) for a qubit system), while n is the number of quantum states.

Using the formalism of [17,18,19], let assume that the computational problem fed into the quantum circuit QG is specified by n bits and m constraints. Then, the objective function is defined as

$$\begin{aligned} C\left( z\right) =\sum _{\alpha =1}^{m} C_{\alpha } \left( z\right) , \end{aligned}$$
(24)

where

$$\begin{aligned} z=z_{{1}} \ldots z_{n} \end{aligned}$$
(25)

is an n-length bitstring, and \(C_{\alpha } \left( z\right) =1\) if z satisfies constraint \(\alpha \), and \(C_{\alpha } \left( z\right) =0\) otherwise [17,18,19].

Assuming a Hilbert space of n qubits, \(\mathrm{dim}\left( {{\mathcal {H}}}\right) ={2}^{n} \), using the computational basis vectors \(\left| z\right\rangle \), operator \(C\left( z\right) \) in (24) is a diagonal operator in the computational basis [17,18,19]. Then, at a particular angle \(\gamma \), \(\gamma \in \left[ 0, \pi \right] \), unitary \(U\left( C,\gamma \right) \) is evaluated as

$$\begin{aligned} U\left( C,\gamma \right) =\text {e}^{-i\gamma C} =\prod _{\alpha =1}^{m} \text {e}^{-i\gamma C_{\alpha } } , \end{aligned}$$
(26)

such that all terms in the product are diagonal in the computational basis.

Then, for the \(\mu \) dependent product of commuting operators, \(\mu \in \left[ 0,\pi \right] \) [17,18,19], a unitary \(U\left( B,\mu \right) \) is defined as

$$\begin{aligned} U\left( B,\mu \right) =\text {e}^{-i\mu B} =\prod _{j=1}^{n} \text {e}^{-i\mu \sigma _{x}^{j} } , \end{aligned}$$
(27)

where \(B=\sum _{i} X_{i} \), \(X_{i} =\sigma _{x}^{i} \), \(\sigma _{x} \) is the Pauli X-operation, while \(\mu \) is a control parameter [17,18,19,20], \(\mu \in \left[ 0,\pi \right] \). For a qubit setting, the \(\left| s\right\rangle \) initial state of the quantum computer is the uniform superposition over computational basis states,

$$\begin{aligned} \left| s\right\rangle =\frac{{1}}{\sqrt{{2}^{n} } } \sum _{z} \left| z\right\rangle . \end{aligned}$$
(28)

Let us assume that the \(G_{QG}^{k,r} \) multilayer structure of the QG quantum circuit contains n quantum ports of several quantum gates, and edge set

$$\begin{aligned} {{\mathcal {S}}}_{E} =\left\{ \left\langle jk\right\rangle \right\} \end{aligned}$$
(29)

of size m. Then, the aim of the optimization is to identify a string z (25) that the maximizes the objective function

$$\begin{aligned} C=\sum _{\left\langle jk\right\rangle } C_{\left\langle jk\right\rangle } , \end{aligned}$$
(30)

where

$$\begin{aligned} C_{\left\langle jk\right\rangle } =\frac{{1}}{{2}} \left( {1}-z_{i} z_{j} \right) , \end{aligned}$$
(31)

where \(z_{i} =\pm 1\).

In \(G_{QG}^{k,r} \) different unitary operations can be defined for the single quantum ports (qubits) and the connected quantum ports, as follows.

Let \(U_{q_{s} } \left( \mu _{j} \right) \) be a unitary operator on a \(q_{s} \) single port (qubits) in \(G_{QG}^{k,r} \), be defined such that for each quantum ports a \(\mu _{j} \) parameter is associated as

$$\begin{aligned} U_{q_{s} } \left( \mu _{j} \right) =\text {e}^{-i\mu _{j} X_{j} } . \end{aligned}$$
(32)

For the collection

$$\begin{aligned} \vec {\mu }=\left( \mu _{{1}} ,\ldots ,\mu _{n} \right) , \end{aligned}$$
(33)

the resulting unitary is

$$\begin{aligned} U_{q_{s} } \left( \vec {\mu }\right) =\prod _{j} U_{q_{s} } \left( \mu _{j} \right) . \end{aligned}$$
(34)

The unitary \(U_{q_{s} } \left( \vec {\mu }\right) \) therefore represents the applications of the unitary operations at once in the quantum ports of the QG quantum circuit.

Then, let unitary \(U_{q_{jk} } \left( \gamma _{jk} \right) \) be defined for connected quantum ports \(q_{jk} \) in \(G_{QG}^{k,r} \), as

$$\begin{aligned} U_{q_{jk} } \left( \gamma _{jk} \right) =\text {e}^{i\gamma _{jk} Z_{j} Z_{k} } , \end{aligned}$$
(35)

where \(Z_{i} =\sigma _{z}^{i} \), where \(\sigma _{z} \) is the Pauli Z-operation. Since the eigenvalues of \(X_{i} \) and \(Z_{j} Z_{k} \) are \(\pm 1\), it allows us to restrict the values [17,18,19] of parameters \(\gamma \) and \(\mu \) to the range of \(\left[ 0,\pi \right] \).

Then, defining collection

$$\begin{aligned} \vec {\gamma }=(\gamma _{jk}^{{1}} ,\ldots ,\gamma _{jk}^{h} ), \end{aligned}$$
(36)

where h is the number of individual \(\gamma _{jk} \) parameters, the unitary \(U_{q_{jk} } \left( \vec {\gamma }\right) \) is yielded as

$$\begin{aligned} U_{q_{jk} } \left( \vec {\gamma }\right) =\prod _{\left\langle jk\right\rangle \in G_{QG}^{k,r} } U_{q_{jk} } \left( \gamma _{jk} \right) . \end{aligned}$$
(37)

Assuming that there exists a set \({{\mathcal {S}}}_{\vec {\mu }}^{u} \) of u collections of \(\vec {\mu }\)’s

$$\begin{aligned} {{\mathcal {S}}}_{\vec {\mu }}^{u} :\vec {\mu }^{\left( {1}\right) } ,\ldots ,\vec {\mu }^{\left( u\right) } \end{aligned}$$
(38)

and a set \({{\mathcal {S}}}_{\vec {\gamma }}^{u} \) of u collections of \(\vec {\gamma }\)’s,

$$\begin{aligned} {{\mathcal {S}}}_{\vec {\gamma }}^{u} :\vec {\gamma }^{\left( {1}\right) } ,\ldots ,\vec {\gamma }^{\left( u\right) } , \end{aligned}$$
(39)

a \(\left| \phi \right\rangle \) system state of the QG quantum circuit is evaluated as

$$\begin{aligned} \begin{aligned} \left| \phi \right\rangle&=\left| \mathcal {S}_{{\vec {\mu }}}^{u},\mathcal {S}_{{\vec {\gamma }}}^{u},C \right\rangle \\&={{U}_{{{q}_{s}}}}\left( {{{\vec {\mu }}}^{\left( u \right) }} \right) {{U}_{{{q}_{jk}}}}\left( {{{\vec {\gamma }}}^{\left( u \right) }} \right) \ldots {{U}_{{{q}_{s}}}}\left( {{{\vec {\mu }}}^{\left( 1 \right) }} \right) {{U}_{{{q}_{jk}}}}\left( {{{\vec {\gamma }}}^{\left( 1 \right) }} \right) \left| s \right\rangle , \end{aligned} \end{aligned}$$
(40)

where \(\left| s\right\rangle \) is given in (28).

The maximization of objective function (24) in the multilayer \(G_{QG}^{k,r} \) structure is therefore analogous to the problem of finding the parameters of sets \({{\mathcal {S}}}_{\vec {\mu }}^{u} \) (38) and \({{\mathcal {S}}}_{\vec {\gamma }}^{u} \) (39) in the system state \(\left| \phi \right\rangle \) (40) of the QG quantum circuit.

3.5 The QTAM algorithm

Theorem 1

The QTAM algorithm utilizes annealing temperatures \(T_{f} \left( t\right) \), \(T_{g} \left( t\right) \) and \(T_{c} \left( t\right) \) to evaluate the acceptance probabilities, where \(T_{f} \left( t\right) \) is the annealing temperature for the objectives, \(T_{g} \left( t\right) \) is the annealing temperature for the constraints, and \(T_{c} \left( t\right) \) is the annealing temperature for the distribution closeness.

Proof

The detailed description of the QTAM procedure is given in Algorithm 1.

figure a
figure b

The related steps are detailed in sub-procedures 1–4. In Step 3 of sub-procedure 1, the best \({{\mathcal {A}}_{s}}\) solutions refer to those solutions from \(\mathcal {A}\) that have the largest values of the crowding distance [30]. Particularly, in this step, the solutions are also sorted and compared by a crowded comparison operator to find the best solution.

figure c
figure d
figure e
figure f

\(\square \)

3.5.1 Computational complexity of QTAM

Following the complexity analysis of [27,28,29,30], the computational complexity of QTAM is evaluated as

$$\begin{aligned} {\mathcal {O}}\left( N_{d} N_{it} \left| {{\mathcal {P}}}\right| \left( N_{obj} +\log _{2} \left( \left| {{\mathcal {P}}}\right| \right) \right) \right) , \end{aligned}$$
(54)

where \(N_{d} \) is the number of dominance measures, \(N_{it}\) is the number of total iterations, \(\left| {{\mathcal {P}}}\right| \) is the population size, while \(N_{obj}\) is the number of objectives.

4 Wiring optimization and objective function maximization

4.1 Multilayer quantum circuit grid

An ith quantum gate of QG is denoted by \(g_{i} \), a kth port of the quantum gate \(g_{i} \) is referred to as \(g_{i,k} \). Due to the hardware restrictions of gate-model quantum computer implementations [17,18,19,20], the quantum gates are applied in several rounds. Thus, a multilayer, k-dimensional (for simplicity we assume \(k=2\)), n-sized finite square-lattice grid \(G_{QG}^{k,r} \) can be constructed for QG, where r is the number of layers, \(l_{z} \), \(z=1,\ldots ,r\) . A quantum gate \(g_{i} \) in the zth layer \(l_{z} \) is referred to as \(g_{i}^{l_{z} } \), while a kth port of \(g_{i}^{l_{z} } \) is referred to as \(g_{i,k}^{l_{z} } \).

4.2 Method

Theorem 2

There exists a method for the parallel optimization of quantum wiring in physical layout of the quantum circuit and for the maximization of an objective function \(C_{\alpha } \left( z\right) \).

Proof

The aim of this procedure (Method 1) is to provide a simultaneous physical layer optimization and Hamiltonian minimization via the minimization of the wiring lengths in the multilayer structure of QG and the maximization of the objective function (see also Sect. 3.4). Formally, the aim of Method 1 is the \(F_{{2}} \wedge F_{{3}} \) simultaneous realization of the objective functions \(F_{{2}} \) and \(F_{{3}} \).

Using the \(G_{QG}^{k,r} \) multilayer grid of the QG quantum circuit determined via \(F_{{1}} \) and \(F_{{2}} \), the aim of \(F_{{3}} \) maximization of the objective function \(C\left( z\right) \), where \(z=z_{{1}} \ldots z_{n} \) in an n-length input string, where each \(z_{i} \) is associated with an edge of \(G_{QG}^{k,r} \) connecting two quantum ports. The objective function \(C\left( z\right) \) associated with an arbitrary computational problem is defined as

$$\begin{aligned} C\left( z\right) =\sum _{\left\langle i,j\right\rangle \in G_{QG}^{k,r} } C_{\left\langle i,j\right\rangle } \left( z\right) , \end{aligned}$$
(55)

where \(C_{\left\langle i,j\right\rangle } \) is the objective function for an edge of \(G_{QG}^{k,r} \) that connects quantum ports i and j.

The \(C^{{*}} \left( z\right) \) maximization of objective function (55) yields a system state \(\Psi \) for the quantum computer [17,18,19,20] as

$$\begin{aligned} \Psi =\left\langle \left. \gamma ,\mu ,C^{{*}} \left( z\right) \right| \right. C^{{*}} \left( z\right) \left| \gamma ,\mu ,C^{{*}} \left( z\right) \right\rangle , \end{aligned}$$
(56)

where

$$\begin{aligned} {\left| \gamma ,\mu ,C^{*} \left( z\right) \right\rangle } =U\left( B,\mu \right) U\left( C^{*} \left( z\right) ,\gamma \right) {\left| s \right\rangle } , \end{aligned}$$
(57)

while

$$\begin{aligned} U\left( C^{{*}} \left( z\right) ,\gamma \right) \left| z\right\rangle =\text {e}^{-i\gamma C^{{*}} \left( z\right) } \left| z\right\rangle , \end{aligned}$$
(58)

where \(\gamma \) is a single parameter [17,18,19,20].

The objective function (55) without loss of generality can be rewritten as

$$\begin{aligned} C\left( z\right) =\sum _{\alpha } C_{\alpha } \left( z\right) , \end{aligned}$$
(59)

where \(C_{\alpha } \) each act on a subset of bits, such that \(C_{\alpha } \in \left\{ \mathrm{0,1}\right\} \). Therefore, there exists a selection of parameters of \(\vec {\Phi }\) in (9) such that (59) picks up a maximized value \(C^{{*}} \left( z\right) \), which yields system state \(\Upsilon \) as

$$\begin{aligned} \Upsilon =\langle \vec {\Phi }|C^{{*}} (z)|\vec {\Phi }\rangle . \end{aligned}$$
(60)

Therefore, the resulting Hamiltonian H associated with the system state (60) is minimized via \(F_{{2}} \) [see (72)] as

$$\begin{aligned} E_{L} (\vec {\Phi })=\min {\langle \vec {\Phi }|H|\vec {\Phi }\rangle }, \end{aligned}$$
(61)

since the physical layer optimization minimizes the \(\ell _{ij} \) physical distance between the quantum ports; therefore, the energy \(E_{L} (\vec {\Phi })\) of the Hamiltonian associated with \(\vec {\Phi }\) is reduced to a minima.

The steps of the method \(F_{{2}} \wedge F_{{3}} \) are given in Method 1. The method minimizes the number of quantum wires in the physical layout of QG and also achieves the desired system state \(\Psi \) of (56).

figure g

\(\square \)

The steps of Method 1 are illustrated in Fig. 2, using the \(G_{QG}^{k,r} \) multilayer topology of the QG quantum gate structure, \(l_{i} \) refers to the ith layer of \(G_{QG}^{k,r} \).

Fig. 2
figure 2

The aim is to find the optimal wiring in \(G_{QG}^{k,r} \) for the QG quantum circuit (minimal path length with maximal overlapped path between \(g_{i,1} \) and \(g_{j,1} \),\(g_{j,2} \)) such that the \(C_{\alpha } \) objective function associated with the paths \({{\mathcal {P}}}_{{1}} :g_{i,1} \rightarrow g_{j,1} \), and \({{\mathcal {P}}}_{{2}} :g_{i,1} \rightarrow g_{j,2} \) is maximal. a The initial objective function value is \(C_{\alpha _{0} } \). A physical layer blockage \(\beta \) in the quantum circuit allows no to use paths \({{\mathcal {P}}}_{{1}} \) and \({{\mathcal {P}}}_{{2}} \). b The wire length is optimized via the selection point \(\Delta \). The path cost is \(f_{p,c} =11+3f_{l} \), where \(f_{l} \) is the cost function of the path between the layers \(l_{{1}} \) and \(l_{{2}} \) (depicted by the blue vertical line), and the path overlap from \(g_{i,1} \) to \(\Delta \) is \(\tau _{o} =5+f_{l} \). The objective function value is \(C_{\alpha _{{1}} } \). c The path cost is \(f_{p,c} =10\); the path overlap from \(g_{i,1} \) to \(\Delta \) is \(\tau _{o} =4\). The objective function value is \(C_{\alpha _{{2}} } \). d The path cost is \(f_{p,c} =12\); the path overlap from \(g_{i,1} \) to \(\Delta \) is \(\tau _{o} =6\). The objective function value is \(C_{\alpha _{{3}} } \). The selected connection topology from (bd) is that which yields the maximized objective function \(C_{\alpha }^{{*}} \) (Color figure online)

4.3 Quantum circuit minimization

For objective function \(F_{{1}} \), the area minimization of the QG quantum circuit requires the following constraints. Let \(S_{v} \left( P_{i} \right) \) be the vertical symmetry axis of a proximity group \(P_{i} \) [27,28,29] on QG, and let \(x_{S_{v} \left( P_{i} \right) } \) refer to the x-coordinate of \(S_{v} \left( P_{i} \right) \). Then, by some symmetry considerations for \(x_{S_{v} \left( P_{i} \right) } \),

$$\begin{aligned} x_{S_{v} \left( P_{i} \right) } =\frac{{1}}{{2}} \left( x_{i}^{{1}} +x_{i}^{{2}} +\kappa _{i} \right) , \end{aligned}$$
(62)

where \(x_{i} \) is the bottom-left x coordinate of a cell \(\sigma _{i} \), \(\kappa _{i} \) is the width of \(\sigma _{i} \), and

$$\begin{aligned} y_{i}^{{1}} +\frac{h_{i} }{{2}} =y_{i}^{{2}} +\frac{h_{i} }{{2}} , \end{aligned}$$
(63)

where \(y_{i} \) is the bottom-left y coordinate of a cell \(\sigma _{i} \), \(h_{i} \) is the height of \(\sigma _{i} \).

Let \(\left( \sigma ^{{1}} ,\sigma ^{{2}} \right) \) be a symmetry pair [27,28,29] that refers to two matched cells placed symmetrically in relation to \(S_{v} \left( P_{i} \right) \), with bottom-left coordinates \(\left( \sigma ^{{1}} ,\sigma ^{{2}} \right) =\left( \left( x_{i}^{{1}} ,y_{i}^{{1}} \right) ,\left( x_{i}^{{2}} ,y_{i}^{{2}} \right) \right) \). Then, \(x_{S_{v} \left( P_{i} \right) } \) can be rewritten as

$$\begin{aligned} x_{S_{v} \left( P_{i} \right) } =x_{i}^{{1}} -x_{i} =x_{i}^{{2}} +x_{i} +\kappa _{i} , \end{aligned}$$
(64)

with the relation \(y_{i}^{{1}} =y_{i}^{{2}} =y_{i} \).

Let \(\sigma ^{S} =\left( x_{i}^{S} ,y_{i}^{S} \right) \) be a cell which is placed centered [27,28,29] with respect to \(S_{v} \left( P_{i} \right) \). Then, \(x_{S_{v} \left( P_{i} \right) } \) can be evaluated as

$$\begin{aligned} x_{S_{v} \left( P_{i} \right) } =x_{i}^{S} +\frac{\kappa _{i}}{{2}}, \end{aligned}$$
(65)

along with \(y_{i}^{S} =y_{i} \). Note that it is also possible that for some cells in QG there is no symmetry requirements, and these cells are denoted by \(\sigma ^{0} \).

As can be concluded, using objective function \(F_{{1}} \) for the physical layer minimization of QG, a d-dimensional constraint vector \({\mathbf {x}}_{F_{{1}} }^{d} \) can be formulated with the symmetry considerations as follows:

$$\begin{aligned} {\mathbf {x}}_{F_{{1}} }^{d} =\sum _{N_{\left( \sigma ^{{1}} ,\sigma ^{{2}} \right) } } \left( x_{i} ,y_{i} ,r_{i} \right) +\sum _{N_{\sigma ^{S} } } \left( y_{i} ,r_{i} \right) +\sum _{N_{\sigma ^{0}}} \left( x_{i} ,y_{i} ,r_{i} \right) , \end{aligned}$$
(66)

where \(N_{\left( \sigma ^{{1}} ,\sigma ^{{2}} \right) } \) is the number of \(\left( \sigma ^{{1}} ,\sigma ^{{2}} \right) \) symmetry pairs, \(N_{\sigma ^{S} } \) is the number of \(\sigma ^{S} \)-type cells, \(N_{\sigma ^{0} } \) is the number of \(\sigma ^{0} \)-type cells, while \(r_{i} \) is the rotation angle of an ith cell \(\sigma _{i} \), respectively.

4.3.1 Quantum wire area minimization

Objective function \(F_{{2}} \) provides a minimization of the total quantum wire length of the QG circuit. To achieve it, we define a procedure that yields the minimized total quantum wire area, \(w_{QG} \), of QG as given by (7). Let \(\delta _{ij} \) be the effective width of the quantum wire ij in the QG circuit, defined as

$$\begin{aligned} \delta _{ij} =\frac{\psi _{ij} }{J_{\max } \left( T_{ref} \right) h_{nom}}, \end{aligned}$$
(67)

where \(\psi _{ij} \) is the (root-mean-square) condensate wave function amplitude, \(J_{\max } \left( T_{ref} \right) \) is the maximum allowed current density at a given reference temperature \(T_{ref} \), while \(h_{nom} \) is the nominal layer height. Since drops in the condensate wave function phase \(\varphi _{ij} \) also could present in the QG circuit environment, the \(\delta '_{ij} \) effective width of the quantum wire ij can be rewritten as

$$\begin{aligned} \delta '_{ij} =\frac{\psi _{ij} \ell _{eff} r_{0} \left( T_{ref} \right) }{\chi _{\varphi _{ij} } } , \end{aligned}$$
(68)

where \(\chi _{\varphi _{ij} } \) is a maximally allowed value for the phase drops, \(\ell _{eff} \) is the effective length of the quantum wire, \(\ell _{eff} \le \left( \chi _{\varphi _{ij} } \delta _{ij} \right) /\psi _{ij} r_{0} \left( T_{ref} \right) ,\) while \(r_{0} \left( T_{ref} \right) \) is a conductor sheet resistance [2,3,4,5,6].

In a \(G_{QG}^{k,r} \) multilayer topological representation of QG, the \(\ell _{ij} \) distance between the quantum ports is as

$$\begin{aligned} \ell _{ij} =\left| x_{i} -x_{j} \right| +\left| y_{i} -y_{j} \right| +\left| z_{i} -z_{j} \right| f_{l} , \end{aligned}$$
(69)

where \(f_{l} \) is a cost function between the layers of the multilayer structure of QG.

During the evaluation, let \(w_{QG} \left( k\right) \) be the total quantum wire area of a particular net k of the QG circuit,

$$\begin{aligned} w_{QG} \left( k\right) =\sum _{i=1}^{p} \sum _{j=1}^{q} \ell _{ij} \cdot \delta _{ij} \left( \psi _{ij} \right) , \end{aligned}$$
(70)

where q quantum ports are considered as sources of condensate wave function amplitudes, while p of QG are sinks, thus (7) can be rewritten as

$$\begin{aligned} F_{{2}} :w_{QG} =\min {\sum _{k=1}^{h} w_{QG} \left( k\right) }. \end{aligned}$$
(71)

Since \(\psi _{ij} \) is proportional to \(\delta _{ij} \left( \psi _{ij} \right) \), (71) can be simplified as

$$\begin{aligned} F_{{2}} :w'_{QG} =\min {\sum _{k=1}^{h} w'_{QG} \left( k\right) }, \end{aligned}$$
(72)

where

$$\begin{aligned} w'_{QG} \left( k\right) =\sum _{i=1}^{p} \sum _{j=1}^{q} \ell _{ij} \cdot \psi _{ij} , \end{aligned}$$
(73)

where \(\ell _{ij} \) is given in (69).

In all quantum ports of a particular net k of QG, the source quantum ports are denoted by positive sign [27,28,29] in the condensate wave function amplitude, \(\psi _{ij} \) assigned to quantum wire ij between quantum ports i and j, while the sink ports are depicted by negative sign in the condensate wave function amplitude, \(-\psi _{ij} \) with respect to a quantum wire ij between quantum ports i and j.

Thus the aim of \(w_{QG} \left( k\right) \) in (70) is to determine a set of port-to-port connections in the QG quantum circuit, such that the number of long connections is reduced in a particular net k of QG as much as possible. The result in (71) therefore extends these requirements for all nets of QG.

Wave function amplitudes With respect to a particular quantum wire ij between quantum ports i and j of QG, let \(\psi _{i\rightarrow j} \) refer to the condensate wave function amplitude in direction \(i\rightarrow j\), and let \(\psi _{j\rightarrow i} \) refer to the condensate wave function amplitude in direction \(j\rightarrow i\) in the quantum circuit. Then, the let be \(\phi _{ij} \) defined for the condensate wave function amplitudes of quantum wire ij as

$$\begin{aligned} \phi _{ij} =\min {\left( \left| \psi _{i\rightarrow j} \right| ,\left| \psi _{j\rightarrow i} \right| \right) }, \end{aligned}$$
(74)

with a residual condensate wave function amplitude

$$\begin{aligned} \xi _{i\rightarrow j} =\phi _{ij} -\psi _{i\rightarrow j} , \end{aligned}$$
(75)

where \(\psi _{i\rightarrow j} \) is an actual amplitude in the forward direction \(i\rightarrow j\). Thus, the maximum amount of condensate wave function amplitude injectable to of quantum wire ij in the forward direction \(i\rightarrow j\) at the presence of \(\psi _{i\rightarrow j} \) is \(\xi _{i\rightarrow j} \) [see (75)]. The following relations holds for a backward direction, \(j\rightarrow i\), for the decrement of a current wave function amplitude \(\psi _{i\rightarrow j} \) as

$$\begin{aligned} \bar{\xi }_{j\rightarrow i} =-\psi _{i\rightarrow j} , \end{aligned}$$
(76)

with residual quantum wire length

$$\begin{aligned} \Gamma _{j\rightarrow i} =-\delta _{ij} , \end{aligned}$$
(77)

where \(\delta _{ij} \) is given in (67).

By some fundamental assumptions, the \({{\mathcal {N}}}_{R} \) residual network of QG is therefore a network of the quantum circuit with forward edges for the increment of the wave function amplitude \(\psi \) and backward edges for the decrement of \(\psi \). To avoid the problem of negative wire lengths, the Bellman–Ford algorithm [27,28,29] can be utilized in an iterative manner in the residual directed graph of the QG topology.

To find a path between all pairs of quantum gates in the directed graph of the QG quantum circuit, the directed graph has to be strongly connected. The strong connectivity of the h nets with the parallel minimization of the connections of the QG topology can be achieved by a minimum spanning tree method such as Kruskal’s algorithm [27,28,29].

Lemma 1

The objective function \(F_{{2}} \) is feasible in a multilayer QG quantum circuit structure. \(\square \)

Proof

The procedure defined for the realization of objective function \(F_{{2}} \) on a QG quantum circuit is summarized in Method 2. The proof assumes a superconducting architecture.

figure h

The sub-procedures of Method 2 are detailed in sub-methods 2.1, 2.2 and 2.3.

figure i
figure j
figure k

These conclude the proof. \(\square \)

4.3.2 Processing in the multilayer structure

The \(G_{QG}^{k,z} \) grid consists of all \(g_{i} \) quantum gates of QG in a multilayer structure, such that the \(g_{i,k}^{l_{z} } \) appropriate ports of the quantum gates are associated via an directed graph \(\mathrm{\mathrm{G}}=\left( V,E,f_{c} \right) \), where V is the set of ports, \(g_{i,k}^{l_{z} } \subseteq V\), E is the set of edges, and \(f_{c} \) is a cost function, to achieve the gate-to-gate connectivity.

As a hardware restriction, we use a constraint on the quantum gate structure, and it is assumed in the model that a given quantum system cannot participate in more than one quantum gate at a particular time.

The distance in the rectilinear grid \(G_{QG}^{k,z} \) of QG is measured by the \(d_{\mathrm{L1}} \left( \cdot \right) \) \(\mathrm{L1}\)-distance function. Between two network ports \(x,y\in V\), \(x=\left( j,k\right) \), \(y=\left( m,o\right) \), \(d_{\mathrm{L1}} \left( \cdot \right) \) is as

$$\begin{aligned} d_{\mathrm{L1}} \left( x,y\right) =d_{\mathrm{L1}} \left( \left( j,k\right) ,\left( m,o\right) \right) =\left| m-j\right| +\left| o-k\right| . \end{aligned}$$
(78)

The quantum port selection in the \(G_{QG}^{k,r} \) multilayer structure of QG, with r layers \(l_{z} \), \(z=1,\ldots ,r\), and \(k=2\) dimension in each layers is illustrated in Fig. 3.

Fig. 3
figure 3

The method of port allocation of the quantum gates in the \(G_{QG}^{k,r} \) multilayer structure, with r layers \(l_{z} \), \(z=1,\ldots ,r\), and \(k=2\) dimension in each layers. The aim of the multiport selection is to find the shortest path between ports of quantum gates \(g_{i} \) (blue rectangle) and \(g_{j} \) (green rectangle) in the \(G_{QG}^{\mathrm{2,}r} \) multilayer structure. a The quantum ports needed to be connected in QG are port \(g_{i,1} \) in quantum gate \(g_{i} \) in layer \(l_{{1}} \), and ports \(g_{j,1} \) and \(g_{j,2} \) of quantum gate \(g_{j} \) in layer \(l_{{3}} \). b Due to a hardware restriction on quantum computers, the quantum gates are applied in several rounds in the different layers of the quantum circuit QG. Quantum gate \(g_{j} \) is applied in two rounds in two different layers that is depicted \(g_{j}^{l_{{3}} } \) and \(g_{j}^{l_{{2}} } \). For the layer-\(l_{{3}} \) quantum gate \(g_{j}^{l_{{3}} } \), the active port is \(g_{j,1}^{l_{{3}} } \) (red), while the other port is not accessible (gray) in \(l_{{3}} \). The \(g_{j,1}^{l_{{3}} } \) port, due to a physical layer blockage \(\beta \) in the quantum circuit of the above layer \(l_{{2}} \) does not allow to minimize the path cost between ports \(g_{i,1} \) and \(g_{j,1}^{l_{{3}} } \). The target port \(g_{j,1}^{l_{{3}} } \) is therefore referred to as a blocked port (depicted by pink), and a new port of is \(g_{j}^{l_{{3}} } \) selected for \(g_{j,1}^{l_{{3}} } \) (new port depicted by red). c For the layer-\(l_{{2}} \) quantum gate \(g_{j}^{l_{{2}} } \), the active port is \(g_{j,2}^{l_{{2}} } \) (red), while the remaining port is not available (gray) in \(l_{{2}} \). The white dots (vertices) represent auxiliary ports in the grid structure of the quantum circuit. In \(G_{QG}^{\mathrm{2,}r} \), each vertices could have a maximum of 8 neighbors; thus, for a given port \(g_{j,k} \) of a quantum gate \(g_{j} \), \(\mathrm{deg}\left( g_{j,k} \right) \le \mathrm{8}\) (Color figure online)

Algorithm

Theorem 3

The Quantum Shortest Path Algorithm finds shortest paths in a multilayer QG quantum circuit structure.

Proof

The steps of the shortest path determination between the ports of the quantum gates in a multilayer structure are included in Algorithm 2.

figure l

\(\square \)

Complexity analysis The complexity analysis of Algorithm 2 is as follows. Since the QSPA algorithm (Algorithm 2) is based on the \(A^{{*}} \) search method [27,28,29], the complexity is trivially yielded by the complexity of the \(A^{{*}} \) search algorithm.

5 Performance evaluation

In this section, we compare the performance of the proposed QTAM method with a multiobjective evolutionary algorithm called NSGA-II [55]. We selected this multiobjective evolutionary algorithm for the comparison, since the method can be adjusted for circuit designing.

The computational complexity of NSGA-II is proven to be \({{\mathcal {O}}}\left( N_{it} N_{obj} \left| {{\mathcal {P}}}\right| ^{2} \right) \) in general, while at an optimized non-dominated procedure, the complexity can be reduced to \({{\mathcal {O}}}\left( N_{it} N_{obj} \left| {{\mathcal {P}}}\right| \log _{2} \left| {{\mathcal {P}}}\right| \right) \). We take into consideration both situations for a comparison. The complexity of QTAM is given in (54).

The complexity of the methods in terms of the number of iterations, \(N_{O}\), is compared in Fig. 4. The performance of QTAM is depicted in Fig. 4a, while b, c illustrate the performances of the NSGA-II and optimized NSGA-II, respectively.

For the comparison, the \(N_{obj} \) parameter is set to \(N_{obj} =5\), while for the QTAM method, \(N_{d} \) is set to \(N_{d} =3\).

Fig. 4
figure 4

a The computational complexity (\(N_{O} \): number of operations) of QTAM in function of \(N_{it} \) and \(\left| {{\mathcal {P}}}\right| \), \(N_{it} \in \left[ 1,100\right] \), \(\left| {{\mathcal {P}}}\right| \in \left[ 1,500\right] \). b The computational complexity of the NSGA-II method in function of \(N_{it} \) and \(\left| {{\mathcal {P}}}\right| \), \(N_{it} \in \left[ 1,100\right] \), \(\left| {{\mathcal {P}}}\right| \in \left[ 1,500\right] \). c The computational complexity of the optimized NSGA-II in function of \(N_{it} \) and \(\left| {{\mathcal {P}}}\right| \), \(N_{it} \in \left[ 1,100\right] \), \(\left| {{\mathcal {P}}}\right| \in \left[ 1,500\right] \)

In the analyzed range, the maximized values of \(N_{O} \) are \(N_{O} \left( \mathrm{QTAM}\right) \approx 2\cdot 10^{6} \), \(N_{O} (\text {NSGA-II})\approx 1.25\cdot 10^{8} \), and for the optimized NSGA-II scenario, \(N'_{O} \left( {\text {NSGA-II}}\right) \approx 2.25\cdot 10^{6} \), respectively. In comparison with NSGA-II, the complexity of QTAM is significantly lower. Note, while the performance of QTAM and the optimized NSGA-II is closer, QTAM requires no any optimization of the complexity of the non-dominated procedure.

6 Conclusions

The algorithms and methods presented here provide a framework for quantum circuit designs for near-term gate-model quantum computers. Since our aim was to define a scheme for present and future quantum computers, the developed algorithms and methods were tailored for arbitrary-dimensional quantum systems and arbitrary quantum hardware restrictions. We demonstrated the results through gate-model quantum computer architectures; however, due to the flexibility of the scheme, arbitrary implementations and input constraints can be integrated into the quantum circuit minimization. The objective function that is the subject of the maximization in the method can also be selected arbitrarily. This allows a flexible implementation to solve any computational problem for experimental quantum computers with arbitrary hardware restrictions and development constraints.