Power system faults could result in widespread power outages, leading to significant economic losses and safety concerns1. To identify faulty equipment and process, the power system fault diagnosis analyzes the action behaviors of protective relays (PRs) and circuit breakers (CBs) based on alarm information collected by the control center. The fault diagnosis result helps to reconstruct the fault process and provides decision-making support for dispatchers. However, with the increasing complexity of modern power grids, power system faults are displaying more intricate patterns2. Hence, there is an urgent need for faster and more reliable power system fault diagnosis technologies to support power system operation.

Various kinds of methods have been developed for power system fault diagnosis and can be generally divided into two main categories, data-driven and optimization-based methods. For the data-driven methods, expert systems (ESs) and artificial neural networks (ANNs) are most widely used. The ES captures the behavior of the protection system through powerful logical reasoning3,4. However, the learning capability and fault tolerance of ES-based methods are weak, and the establishment and maintenance of the knowledge base are challenging. The ANN-based methods utilize sample data to model the complex internal logic of the protection system and are of advantages in fast diagnosis speed, strong learning ability, and good fault tolerance. Various types of ANNS and related algorithms, such as the radial basis function (RBF)5, multilayer perception (MLP)6, support vector machine (SVM)7, and parameter selection8, have been applied for automatic fault detection and diagnosis. However, the ANN-based methods have limitations due to the dependency on the fault sample volume and quality. Also, it is difficult to establish a complete set of fault samples due to the small probability of power system faults.

The optimization-based method models the power system fault diagnosis as a binary integer programming problem and uses optimization technology to solve it, which has a strict mathematical foundation and theoretical basis. Power system fault diagnosis can be expressed as an NP-hard problem9,10 and various kinds of heuristic algorithms are often used to obtain approximate optimal solutions, such as tabu search (TS)11, particle swarm optimization algorithm (PSO)12, generic algorithm-II (NSGA-II)13, binary coded brain storm optimization (BCBSO)14. Although these classical heuristic algorithms can effectively diagnose faulty components, they still suffer limitations in terms of inaccurate solution, time-consuming, memory overhead, and computational complexity, especially for large-scale power grids. Meanwhile, with the continuous development of quantum computing, its computational advantages are expected to well address these challenges.

Quantum computing is considered to be a new computing paradigm with a disruptive impact on the future15. For combinatorial optimization problems, methods such as the quantum annealing algorithm (QA) and quantum approximate optimization algorithm (QAOA) have appeared in the field of quantum computing16. QA uses the quantum tunneling effect to complete the optimization process through a guided quantum evolution. QAOA is a quantum–classical hybrid algorithm based on the gate structure and has a potential exponential speedup in solving combinatorial optimization problems17. In addition to the potential computational speed advantage, the accuracy of QAOA optimization results for large-scale problems cannot be ignored when considering the noise in actual quantum devices. Although in the short term, the capabilities of quantum devices are limited by the number of qubits, gate fidelity, and error correction capabilities, QAOA has the potential to be applied to large-scale fault diagnosis problems.

QAOA has been applied to various kinds of combinatorial optimization problems, such as the maximum cut problem18,19,20, the exact coverage problem21,22,23,24,25,26,27, and the Hamilton path problem28. However, there are few researches on the application of the QAOA algorithm in power systems at present, and existing researches mainly focus on the unit commitment problem29,30,31,32. The limitation of the aforementioned research works is that they only focus on the Quadratic Unconstrained Binary Optimization (QUBO) problem, and do not consider the more intricate Polynomial Unconstrained Binary Optimization (PUBO) problem. This is largely due to the current hardware’s limitations and error-proneness in implementing multi-qubit gates. However, the power system fault diagnosis problem is normally formulated as a PUBO problem10 and this issue should be overcome. Less research has been conducted on using QAOA to solve the PUBO problem. Herrman et al.33 uses a global variable substitution method to convert the PUBO problem into a QUBO problem by adding auxiliary qubits, and then solves the Boolean satisfiability problem through QAOA. However, the algorithm requires a considerable number of qubits and results in a complex equivalent circuit.

Aiming at the above problems, this paper proposes a quantum computing based power system fault diagnosis method using QAOA and gate decomposition method. Four major contributions of this paper are summarized as follows. First, a quantum computing-based power system fault diagnosis framework is proposed. To the best of our knowledge, we are among the first to apply quantum computing to the power system fault diagnosis problem. Compared with the classical higher-order solver provided by D-Wave, the proposed method has potential to obtain the same optimal results with shorter computational time for large-scale power systems. Second, the Ising model considering PR and CB failed/mal operation and contradictory logic is proposed to express the Hamiltonian of power system fault diagnosis, and the quantum logic gate corresponding to the Hamiltonian is derived. Third, the Symmetric Equivalent Decomposition (SED) of the multi-z-rotation gate34,35 is utilized to efficiently solve the QAOA-based PUBO problem. Compared with the global variable substitution method using auxiliary qubits, the proposed method requires less qubits, and shows better performance with lower complexity. Fourth, a quantum circuit simplifying method is proposed by using the small probability event characteristic (SPEC) of power system faults, which reduces the high-order terms in the Hamiltonian. Simulation results shows that the proposed method can improve both operating speed and accuracy.

Results

Fault hypothesis

The fault hypothesis (FH) describes the fault assumptions in a fault-tolerant system, and in this paper, we consider suspicious faulty component and the related PR and CB as hypothesis conditions36. Suppose that there are \({n}_{d}\) suspected faulty components in the faulty region, and the number of related PR and CB are \({n}_{r}\) and \({n}_{c}\), respectively. Then, the FH can be expressed as follows:

$$H = \left( {D,R,C,F,M} \right)$$
(1)

where \(D=\left({d}_{1}, \dots ,{d}_{i}, \dots , {d}_{{n}_{d}}\right)\) is the set of suspected faulty components. \({d}_{i}=1\) means that the \(i\) th component is fault, while \({d}_{i}=0\) means normal. \(R=\left({r}_{1}, \dots ,{r}_{i}, \dots , {r}_{{n}_{r}}\right)\) is the set of PRs. \({r}_{i}=1\) means that the \(i\) th PR operates, while \({r}_{i}=0\) means not operates. \(C=\left({c}_{1}, \dots ,{c}_{i}, \dots , {c}_{{n}_{c}}\right)\) is the set of CBs. \({c}_{i}=1\) means that the \(i\) th CB is tripped, while \({c}_{i}=0\) means not tripped. \(F=\left({f}_{{r}_{1}}, \dots ,{f}_{{r}_{{n}_{r}}}, {f}_{{c}_{1}}\dots , {f}_{{c}_{{n}_{c}}}\right)\) is the set of failed operation information. If \({r}_{i}\) or \({c}_{i}\) has performed a failed operation, then \({f}_{{r}_{i}}\) or \({f}_{{c}_{i}}\) equals to 1. Otherwise, it is 0. \(M=\left({m}_{{r}_{1}}, \dots ,{m}_{{r}_{{n}_{r}}}, {m}_{{c}_{1}}\dots , {m}_{{c}_{{n}_{c}}}\right)\) is the set of mal operation information. If \({r}_{i}\) or \({c}_{i}\) has performed a mal operation, then \({m}_{{r}_{i}}\) or \({m}_{{c}_{i}}\) equals to 1. Otherwise, it is 0.

Fault diagnosis problem formulation

The fault diagnosis problem can be formulated as a combinatorial optimization problem. The objective function describes the criteria and factors for judging the expected fault diagnosis37,38. Based on the work of Liu et al.12, this paper completely preserves the coupling relationship between the faulty components and the operation of PR and CB. Considering the failed/mal operation of PR and CB, as well as the contradictory logic, the objective function is formulated as:

$$\begin{gathered} \min E\left( H \right) = \omega_{1} \mathop \sum \limits_{i = 1}^{{n_{r} }} \left( {r_{i} \oplus r_{i}^{*} } \right) + \omega_{1} \mathop \sum \limits_{i = 1}^{{n_{c} }} \left( {c_{i} \oplus c_{i}^{*} } \right) + \omega_{2} \mathop \sum \limits_{i = 1}^{{n_{r} }} \left( {r_{i} \oplus r_{i}^{\prime } } \right) + \omega_{2} \mathop \sum \limits_{i = 1}^{{n_{c} }} \left( {c_{i} \oplus c_{i}^{\prime } } \right) + \omega_{3} \mathop \sum \limits_{i = 1}^{{n_{r} }} \left( {f_{{r_{i} }} + m_{{r_{i} }} } \right) \hfill \\ \quad \quad \quad \quad \quad \quad + \omega_{3} \mathop \sum \limits_{i = 1}^{{n_{c} }} \left( {f_{{c_{i} }} + m_{{c_{i} }} } \right) + \omega_{4} \mathop \sum \limits_{i = 1}^{{n_{r} }} \left( {f_{{r_{i} }} m_{{r_{i} }} + r_{i} f_{{r_{i} }} + \overline{{r_{i} }} m_{{r_{i} }} + p_{{r_{i} }} m_{{r_{i} }} + \overline{{p_{{r_{i} }} }} f_{{r_{i} }} } \right) + \omega_{4} \mathop \sum \limits_{i = 1}^{{n_{c} }} \left( {f_{{c_{i} }} m_{{c_{i} }} + c_{i} f_{{c_{i} }} + \overline{{c_{i} }} m_{{c_{i} }} + p_{{c_{i} }} m_{{c_{i} }} + \overline{{p_{{c_{i} }} }} f_{{c_{i} }} } \right) \hfill \\ \end{gathered}$$
(2)

where \({r}_{i}\), \({r}_{i}^{*}\), \({r}_{i}^{\prime}\), \({p}_{{r}_{i}}\) represent the actual state, expected state, alarm, and action expectation of PR, \({c}_{i}\), \({c}_{i}^{*}\), \({c}_{i}^{\prime}\), \({p}_{{c}_{i}}\) represent the actual state, expected state, alarm, and action expectation of CB. \(\oplus\) is exclusive-or operator. \(\overline{\cdot }\) is NOT operator. \(\omega_{1}\), \(\omega_{2}\), \(\omega_{3}\), \(\omega_{4}\) represent the weight of each term, which must satisfy \(\omega_{4} \gg \omega_{1} , \omega_{2} , \omega_{3} ,\) since the logic constraint is a strong constraint condition.

The first two terms \(\mathop \sum \limits_{i = 1}^{{n_{r} }} \left( {r_{i} \oplus r_{i}^{*} } \right)\) and \(\mathop \sum \limits_{i = 1}^{{n_{c} }} \left( {c_{i} \oplus c_{i}^{*} } \right)\) describe the difference between the actual state and the expected state of PR and CB, respectively. The third and fourth terms \(\mathop \sum \limits_{i = 1}^{{n_{r} }} \left( {r_{i} \oplus r_{i}^{\prime } } \right)\) and \(\mathop \sum \limits_{i = 1}^{{n_{c} }} \left( {c_{i} \oplus c_{i}^{\prime } } \right)\) describe the difference between the actual state and the alarm state of PR and CB, respectively. The terms \(\sum_{i=1}^{{n}_{r}}\left({f}_{{r}_{i}}+{m}_{{r}_{i}}\right)\) and \({\sum }_{i=1}^{{n}_{c}}({f}_{{c}_{i}}+{m}_{{c}_{i}})\) describe the failed/mal operation of PR and CB, respectively. The last two terms \(\sum_{i=1}^{{n}_{r}}\left({f}_{{r}_{i}}{m}_{{r}_{i}}+{r}_{i}{f}_{{r}_{i}}+\overline{{r}_{i}}{m}_{{r}_{i}}+{p}_{{r}_{i}}{m}_{{r}_{i}}+\overline{{p}_{{r}_{i}}}{f}_{{r}_{i}}\right)\) and \(\sum_{i=1}^{{n}_{c}}({f}_{{c}_{i}}{m}_{{c}_{i}}+{c}_{i}{f}_{{c}_{i}}+\overline{{c}_{i}}{m}_{{c}_{i}}+{p}_{{c}_{i}}{m}_{{c}_{i}}+\overline{{p}_{{c}_{i}}}{f}_{{c}_{i}})\) describe the number of contradictions that do not satisfy the action logic of PR and CB. The contradictory logic of the last two terms includes: failed operation with mal operation, operate with fail to operate, no operation with mal operation, incentive (expected to operate) with mal operation, no incentive with failed operation.

Action logic model

The action logic model is used to describe the expected state according to the protection principle. The action logic for PR and CB in this paper is shown as follows.

  1. (1)

    Action logic of main PR

Let \({r}_{i}\) be the main PR of the component \({d}_{n}\). If \({d}_{n}\) is failed (\({d}_{n}=1\)) and \({r}_{i}\) does not fail to operate, or there is a mal operation on \({r}_{i}\), then \({r}_{i}\) should operate. The action expectation and expected state of main PR are:

$${p}_{{r}_{i}}={d}_{n}$$
(3)
$${r}_{i}^{*}={d}_{n}\overline{{f}_{{r}_{i}}}\bigvee {m}_{{r}_{i}}$$
(4)
  1. (2)

    Action logic of first back-up PR

Let \({r}_{i}\) be the first back-up PR of the component \({d}_{n}\), if \({d}_{n}\) is failed and its main PR \({r}_{j}\) does not operate, then \({r}_{i}\) should operate. Consider the failed/mal operation, the action expectation and expected state of first back-up PR are:

$${p}_{{r}_{i}}={d}_{n}\overline{{r}_{j}}$$
(5)
$${r}_{i}^{*}={d}_{n}\overline{{r}_{j}}\overline{{f}_{{r}_{i}}}\bigvee {m}_{{r}_{i}}$$
(6)
  1. (3)

    Action logic of second back-up PR

Let \({r}_{i}\) be the second back-up PR of the component \({d}_{n}\), \(D({r}_{i},{d}_{n})\) be the set of neighboring devices of \({d}_{n}\) within the protection range of \({r}_{i}\), \(C({r}_{i},{d}_{m})\) be the CBs on the path from \({d}_{m}\) to \({d}_{n}\). If the component \({d}_{m}\in D({r}_{i},{d}_{n})\) is failed and there is no \({c}_{t}\in C\left({r}_{i}, {d}_{m}\right)\) trips, then \({r}_{i}\) should operate. Considering the failed/mal operation, the action expectation and expected state of second back-up PR are:

$${p}_{{r}_{i}}=\underset{{d}_{m}\in D\left({r}_{i}, {d}_{n}\right)}{\bigvee }( {d}_{m}\underset{{c}_{t}\in C\left({r}_{i},{ d}_{m}\right)}{\bigwedge }\overline{{c}_{t}} )$$
(7)
$${r}_{i}^{*}=(\underset{{d}_{m}\in D\left({r}_{i}, {d}_{n}\right)}{\bigvee }( {d}_{m}\underset{{c}_{t}\in C\left({r}_{i},{ d}_{m}\right)}{\bigwedge }\overline{{c}_{t}} ))\overline{{f}_{{r}_{i}}}\bigvee {m}_{{r}_{i}}$$
(8)
  1. (4)

    Action logic of CB

Let \(R({c}_{i})\) be the set of PRs which can trigger \({c}_{i}\). If any \({r}_{i}\in R({c}_{i})\) operate, then \({c}_{i}\) should trip. Considering the failed/mal operation, the action expectation and expected state of CB are:

$${p}_{{c}_{i}}=\underset{{r}_{i}\in R\left({c}_{i}\right)}{\bigvee }{r}_{i}$$
(9)
$${c}_{i}^{*}=(\underset{{r}_{i}\in R\left({c}_{i}\right)}{\bigvee }{r}_{i})\overline{{f}_{{c}_{i}}}\bigvee {m}_{{c}_{i}}$$
(10)

QAOA-based fault diagnosis framework

The proposed QAOA-based fault diagnosis framework is shown in Fig. 1. In our proposed framework, the coupling relationship between the suspected faulty components and the operation of PR and CB is completely preserved and the failed/mal operation of PR and CB, as well as the contradictory logic, is considered. To reduce the dimensionality of the original problem, the small probability event characteristic of power system failure is utilized, which can reduce the number of qubits to be used and simplify the quantum circuit. Additionally, the SED method of the multi-z-rotation gate is proved, which enables QAOA to solve the power system fault diagnosis problem in PUBO form.

Figure 1
figure 1

The QAOA-based fault diagnosis framework.

The QAOA-based power system fault diagnosis framework consists of two main components: mathematical model construction and SED-QAOA. In the first part, the mathematical model of power system fault diagnosis problem is generated, and then, the model is reformulated into the form of the Ising model and cost Hamiltonian in turn. In the SED-QAOA part, the quantum circuit is created using the SED method of the multi-z-rotation gate, then the problem can be solved with QAOA. The specific procedure of each component is as follows.

In the mathematical model construction part, the power outage area is first identified to determine the suspected faulty components and related PRs and CBs, using the real-time information of the CB. The tie-line analysis method is used to identify the system topology before and after the fault, and find the difference between the two topology structures39. The mathematical model is then constructed, taking into account small probability event characteristics and alarms from control center. After the mathematical model is reformulated into the Ising model, the cost Hamiltonian of the fault diagnosis problem is determined.

In the SED-QAOA part, the quantum circuit is first generated with the cost Hamiltonian \({H}_{C}\), mixer Hamiltonian \({H}_{B}\), and the SED of the multi-z-rotation gate. The quantum circuit is equivalent to a parametric unitary transformation \(U\)(\({H}_{C}\), \({H}_{B}\), \(\overrightarrow{\gamma }\), \(\overrightarrow{\beta }\), \(k\)), which is in the following form:

$$U\left({H}_{C},{H}_{B},\overrightarrow{\gamma },\overrightarrow{\beta },k\right)=U\left({H}_{B},{\beta }_{k}\right)U\left({H}_{C},{\gamma }_{k}\right)\cdots U\left({H}_{B},{\beta }_{1}\right)U\left({H}_{C},{\gamma }_{1}\right)$$
(11)

where \(\overrightarrow{\gamma }=({\gamma }_{1},\dots ,{\gamma }_{k})\) and \(\overrightarrow{\beta }=({\beta }_{1},\dots ,{\beta }_{k})\) are parametric vectors, and \(k\) is the number of alternations, also known as the level of the circuit. \(U\left({H}_{C},{\gamma }_{i}\right)\) and \(U\left({H}_{B},{\beta }_{i}\right)\) are two parametric unitary transformation correspond to the cost Hamiltonian and mixer Hamiltonian, which can be expressed as:

$$\left\{ \begin{gathered} U\left( {H_{C} ,\gamma_{i} } \right) = e^{{ - i\gamma_{i} H_{C} }} \hfill \\ U\left( {H_{B} ,\beta_{i} } \right) = e^{{ - i\beta_{i} H_{B} }} \hfill \\ \end{gathered} \right.,\quad i = 1,2, \ldots ,k$$
(12)

The \({H}_{C}\) is generated from the Ising model, which is attained from the mathematical model of the problem. The derivation method is introduced in the next subsection. The mixer Hamiltonian is \({\sum }_{n=1}^{N}{X}_{n}\), where \(N\) is the number of qubits, and \({X}_{n}\) is the Pauli-X operator acting on qubit \(n\), which means that an RX gate on the \(n\) th qubit in the corresponding quantum circuit. The mathematical equation of the RX gate is shown as follows:

$$RX(\theta )= \left[\begin{array}{cc}\text{cos}(\frac{\theta }{2})& -isin(\frac{\theta }{2})\\ -isin(\frac{\theta }{2})& \text{cos}(\frac{\theta }{2})\end{array}\right]$$
(13)

After the construction of the quantum circuit, the quantum initial superposition state is prepared as \(|{+\rangle }^{\otimes N}\). Through the quantum circuit, the quantum final state can be obtained:

$$|{\psi }_{k}\rangle = U({H}_{C},{H}_{B},\overrightarrow{\gamma },\overrightarrow{\beta },k)|{+\rangle }^{\otimes N}$$
(14)

The quantum final state is measured by standard calculation basis and the expected value is:

$${F}_{k}\left(\overrightarrow{\gamma },\overrightarrow{\beta }\right)=\langle {\psi }_{k}|{H}_{C}|{\psi }_{k}\rangle$$
(15)

According to the above formula, the smaller the expected value \({F}_{k}\left(\overrightarrow{\gamma },\overrightarrow{\beta }\right)\) is, the higher the probability of the eigenstate corresponding to lower eigenvalue is. An eigenstate is a stable state of the quantum system that corresponds to a particular eigenvalue and refers to a possible solution in the context of QAOA. Therefore, the optimal solution of the problem can be obtained with the highest probability. The above process can be implemented with quantum processor.

And then, the expected value is minimized using classic processor:

$$\left({\overrightarrow{\gamma }}^{*},{\overrightarrow{\beta }}^{*}\right)=argmi{n}_{\overrightarrow{\gamma }, \overrightarrow{\beta }} {F}_{k}\left(\overrightarrow{\gamma },\overrightarrow{\beta }\right)$$
(16)

The solution to the fault diagnosis problem is obtained upon the convergence of the expectation of cost Hamiltonian. Otherwise, it is required to come back to generate a new quantum circuit that incorporates the updated parameters, and to repeat the process iteratively until convergence.

Ising formulation of fault diagnosis problem

The binary optimization problem can be transformed into the quantum Ising model by the spin variable quantity, and the Hamiltonian of the quantum system can be expressed by the quantum Ising model40,41. In this section, the quantum Ising model of the power system fault diagnosis problem is deduced according to the mathematical model in Sect. 2. The deduced Ising model contains higher-order terms, such as \(\frac{{s}_{r}^{i}{s}_{d}^{n}{s}_{{f}_{r}}^{i}{s}_{{m}_{r}}^{i}}{8}\) in \({r}_{i}\oplus {r}_{i}^{*}\), which leads fault diagnosis to the PUBO problem. The Ising model of each term in the objective function is introduced in detail below.

Assume the index of \({r}_{i}\), \({d}_{n}\), \({f}_{{r}_{i}}\), \({m}_{{r}_{i}}\) in FH is \({t}_{r}^{i}\), \({t}_{d}^{n}\), \({t}_{{f}_{r}}^{i}\), \({t}_{{m}_{r}}^{i}\). By substituting the binary variable \({r}_{i}\), \({d}_{n}\), \({f}_{{r}_{i}}\), \({m}_{{r}_{i}}\in \{\text{0,1}\}\) with spin variable quantity \({s}_{r}^{i}\), \({s}_{d}^{n}\), \({s}_{{f}_{r}}^{i}\) \({s}_{{m}_{r}}^{i}\in \{-\text{1,1}\}\), that is:

$${r}_{i}=\frac{1-{s}_{r}^{i}}{2}, {d}_{n}=\frac{1-{s}_{d}^{n}}{2}, {f}_{{r}_{i}}=\frac{1-{s}_{{f}_{r}}^{i}}{2}, {m}_{{r}_{i}}=\frac{1-{s}_{{m}_{r}}^{i}}{2}$$
(17)
  • The Ising model for the first term \({r}_{i}\oplus {r}_{i}^{*}\)

  1. (a)

    If \({r}_{i}\) is the main PR of \({d}_{n}\). Then, we have:\({r}_{i}^{*}={d}_{n}\overline{{f}_{{r}_{i}}}\bigvee {m}_{{r}_{i}}\). Therefore:

    $${r}_{i}\oplus {r}_{i}^{*}={r}_{i}\left(1-{d}_{n}\overline{{f}_{{r}_{i}}}\right)\overline{{m}_{{r}_{i}}}+\overline{{r}_{i}}(1-(1-{d}_{n}\overline{{f}_{{r}_{i}}})\overline{{m}_{{r}_{i}}})$$
    (18)

    Then, the quantum Ising model is obtained:

    $$ISING1=\frac{1}{2}+\frac{{s}_{r}^{i}}{8}-\frac{3{s}_{r}^{i}{s}_{{m}_{r}}^{i}}{8}+\frac{{s}_{r}^{i}{s}_{{f}_{r}}^{i}}{8}-\frac{{s}_{r}^{i}{s}_{d}^{n}}{8}+\frac{{s}_{r}^{i}{s}_{{f}_{r}}^{i}{s}_{{m}_{r}}^{i}}{8}-\frac{{s}_{r}^{i}{s}_{d}^{n}{s}_{{f}_{r}}^{i}}{8}-\frac{{s}_{r}^{i}{s}_{d}^{n}{s}_{{m}_{r}}^{i}}{8}-\frac{{s}_{r}^{i}{s}_{d}^{n}{s}_{{f}_{r}}^{i}{s}_{{m}_{r}}^{i}}{8}$$
    (19)
  2. (b)

    If \({r}_{i}\) is the first back-up PR of \({d}_{n}\). Consider \({r}_{j}\) is the main PR of \({d}_{n}\). Then, we have: \({r}_{i}^{*}={d}_{n}\overline{{r}_{j}}\overline{{f}_{{r}_{i}}}\bigvee {m}_{{r}_{i}}\). Therefore:

    $${r}_{i}\oplus {r}_{i}^{*}={r}_{i}\left(1-{d}_{n}\overline{{r}_{j}}\overline{{f}_{{r}_{i}}}\right)\overline{{m}_{{r}_{i}}}+\overline{{r}_{i}}(1-\left(1-{d}_{n}\overline{{r}_{j}}\overline{{f}_{{r}_{i}}}\right)\overline{{m}_{{r}_{i}}})$$
    (20)

    Then, the quantum Ising model is obtained:

    $$ISING1=\frac{1}{2}+\frac{{s}_{r}^{i}}{16}-\frac{7{s}_{r}^{i}{s}_{{m}_{r}}^{i}}{16}+\frac{{s}_{r}^{i}{s}_{{f}_{r}}^{i}}{16}+\frac{{s}_{r}^{i}{s}_{r}^{j}}{16}-\frac{{s}_{r}^{i}{s}_{d}^{n}}{16}+\frac{{s}_{r}^{i}{s}_{{f}_{r}}^{i}{s}_{{m}_{r}}^{i}}{16}+\frac{{s}_{r}^{i}{s}_{r}^{j}{s}_{{f}_{r}}^{i}}{16}+\frac{{s}_{r}^{i}{s}_{r}^{j}{s}_{{m}_{r}}^{i}}{16}-\frac{{s}_{r}^{i}{s}_{d}^{n}{s}_{{f}_{r}}^{i}}{16}-\frac{{s}_{r}^{i}{s}_{d}^{n}{s}_{{m}_{r}}^{i}}{16}-\frac{{s}_{r}^{i}{s}_{d}^{n}{s}_{r}^{j}}{16}+\frac{{s}_{r}^{i}{s}_{r}^{j}{s}_{{f}_{r}}^{i}{s}_{{m}_{r}}^{i}}{16}-\frac{{s}_{r}^{i}{s}_{d}^{n}{s}_{{f}_{r}}^{i}{s}_{{m}_{r}}^{i}}{16}-\frac{{s}_{r}^{i}{s}_{d}^{n}{s}_{r}^{j}{s}_{{f}_{r}}^{i}}{16}-\frac{{s}_{r}^{i}{s}_{d}^{n}{s}_{r}^{j}{s}_{{m}_{r}}^{i}}{16}-\frac{{s}_{r}^{i}{s}_{d}^{n}{s}_{r}^{j}{s}_{{f}_{r}}^{i}{s}_{{m}_{r}}^{i}}{16}$$
    (21)
  3. (c)

    If \({r}_{i}\) is the second back-up PR of \({d}_{n}\). Then, we have: \({r}_{i}^{*}=(\underset{{d}_{m}\in D({r}_{i}, { d}_{n})}{\bigvee }( {d}_{m}\underset{{c}_{t}\in C({r}_{i},{ d}_{m})}{\bigwedge }\overline{{c}_{t}} ))\overline{{f}_{{r}_{i}}}\bigvee {m}_{{r}_{i}}\). Therefore:

    $${r}_{i}\oplus {r}_{i}^{*}={r}_{i}\overline{{m}_{{r}_{i}}}(1-\overline{{f}_{{r}_{i}}}(1-\underset{{d}_{m}\in D\left({r}_{i}, { d}_{n}\right)}{\bigwedge }( 1-{d}_{m}\underset{{c}_{t}\in C\left({r}_{i},{ d}_{m}\right)}{\bigwedge }\overline{{c}_{t}} ))) +\overline{{r}_{i}}(1-\overline{{m}_{{r}_{i}}}(1-\overline{{f}_{{r}_{i}}}(1-\underset{{d}_{m}\in D({r}_{i}, { d}_{n})}{\bigwedge }( 1-{d}_{m}\underset{{c}_{t}\in C({r}_{i},{ d}_{m})}{\bigwedge }\overline{{c}_{t}} ))))$$
    (22)

    Then, the quantum Ising model is obtained:

    $$ISING1=\frac{1-{s}_{r}^{i}{s}_{{m}_{r}}^{i}}{2}+\frac{{s}_{r}^{i}+{s}_{r}^{i}{s}_{{f}_{r}}^{i}+{s}_{r}^{i}{s}_{{m}_{r}}^{i}+{s}_{r}^{i}{s}_{{f}_{r}}^{i}{s}_{{m}_{r}}^{i}}{4}(1-\prod_{{d}_{m}\in D\left({r}_{i}, { d}_{n}\right)}(1-\frac{{1-s}_{d}^{m}}{2}\prod_{{c}_{t}\in C\left({r}_{i},{ d}_{m}\right)}\frac{1+{s}_{c}^{t}}{2}))$$
    (23)
  • The Ising model for the second term \({c}_{j}\oplus {c}_{j}^{*}\)

    We have: \({c}_{j}^{*}=(\underset{{r}_{i}\in R({c}_{j})}{\bigvee }{r}_{i})\overline{{f}_{{c}_{j}}}\bigvee {m}_{{c}_{j}}\). Therefore:

    $${c}_{j}\oplus {}_{j}^{*}={c}_{j}\overline{{m}_{{c}_{j}}}(1-\overline{{f}_{{c}_{j}}}(1-\underset{{r}_{i}\in R\left({c}_{j}\right)}{\bigwedge }\overline{{r}_{i}}))+\overline{{c}_{j}}(1-\overline{{m}_{{c}_{j}}}(1-\overline{{f}_{{c}_{j}}}(1-\underset{{r}_{i}\in R\left({c}_{j}\right)}{\bigwedge }\overline{{r}_{i}})))$$
    (24)

    Then, the quantum Ising model is obtained:

    $$ISING2=\frac{1-{s}_{c}^{j}{s}_{{m}_{c}}^{j}}{2}+\frac{{s}_{c}^{j}+{s}_{c}^{j}{s}_{{f}_{c}}^{j}+{s}_{c}^{j}{s}_{{m}_{c}}^{j}+{s}_{c}^{j}{s}_{{f}_{c}}^{j}{s}_{{m}_{c}}^{j}}{4}(1-\prod_{{r}_{i}\in R\left({c}_{j}\right)}\frac{1+{s}_{r}^{i}}{2})$$
    (25)
  • The Ising model for the third term \({r}_{i}\oplus {r}_{i}^{\prime}\)

    If the alarm \({r}_{i}^{\prime}=1\), we have:\({r}_{i}\oplus {r}_{i}^{\prime}=\overline{{r}_{i}}\)

    Therefore, the quantum Ising model:

    $$ISING3=\frac{1+{s}_{r}^{i}}{2}$$
    (26)

    If the alarm \({r}_{i}^{\prime}=0\), then the quantum Ising model:

    $$ISING3=\frac{1-{s}_{r}^{i}}{2}$$
    (27)
  • The Ising model for the fourth term \({c}_{j}\oplus {c}_{j}^{\prime}\)

    If the alarm \({c}_{j}^{\prime}=1\), we have:\({c}_{j}\oplus {c}_{j}^{\prime}=\overline{{c}_{j}}\)

    Therefore, the quantum Ising model:

    $$ISING4=\frac{1+{s}_{c}^{j}}{2}$$
    (28)

    If the alarm \({c}_{j}^{\prime}=0\), then the quantum Ising model:

    $$ISING4=\frac{1-{s}_{c}^{j}}{2}$$
    (29)
  • The Ising model for the fifth term \({f}_{{r}_{i}}+{m}_{{r}_{i}}\)

    The quantum Ising model:

    $$ISING5=\frac{1-{s}_{{f}_{r}}^{i}}{2}+\frac{1-{s}_{{m}_{r}}^{i}}{2}$$
    (30)
  • The Ising model for the sixth term \({f}_{{c}_{j}}+{m}_{{c}_{j}}\)

    The quantum Ising model:

    $$ISING6=\frac{1-{s}_{{f}_{c}}^{j}}{2}+\frac{1-{s}_{{m}_{c}}^{j}}{2}$$
    (31)
  • The Ising model for the seventh term \({f}_{{r}_{i}}{m}_{{r}_{i}}+{r}_{i}{f}_{{r}_{i}}+\overline{{r}_{i}}{m}_{{r}_{i}}+{p}_{{r}_{i}}{m}_{{r}_{i}}+\overline{{p}_{{r}_{i}}}{f}_{{r}_{i}}\)

  1. (a)

    If \({r}_{i}\) is the main PR of \({d}_{n}\). Then, we have:\({p}_{{r}_{i} }={d}_{n}\). Therefore:

    $${f}_{{r}_{i}}{m}_{{r}_{i}}+{r}_{i}{f}_{{r}_{i}}+\overline{{r}_{i}}{m}_{{r}_{i}}+{p}_{{r}_{i}}{m}_{{r}_{i}}+\overline{{p}_{{r}_{i}}}{f}_{{r}_{i}}={f}_{{r}_{i}}{m}_{{r}_{i}}+{r}_{i}{f}_{{r}_{i}}+\overline{{r}_{i}}{m}_{{r}_{i}}+{d}_{n}{m}_{{r}_{i}}+\overline{{d}_{n}}{f}_{{r}_{i}}$$
    (32)

    Then, the quantum Ising model:

    $$ISING7=\frac{1}{4}(5-3{s}_{{f}_{r}}^{i}-3{s}_{{m}_{r}}^{i}+{s}_{{f}_{r}}^{i}{s}_{{m}_{r}}^{i}+{s}_{r}^{i}{s}_{{f}_{r}}^{i}-{s}_{r}^{i}{s}_{{m}_{r}}^{i}+{s}_{d}^{n}{s}_{{m}_{r}}^{i}-{s}_{d}^{n}{s}_{{f}_{r}}^{i})$$
    (33)
  2. (b)

    If \({r}_{i}\) is the first back-up PR of \({d}_{n}\). Consider \({r}_{j}\) is the main PR of \({d}_{n}\). Then, we have: \({p}_{{r}_{i}}={d}_{n}\overline{{r}_{j}}\). Therefore:

    $${f}_{{r}_{i}}{m}_{{r}_{i}}+{r}_{i}{f}_{{r}_{i}}+\overline{{r}_{i}}{m}_{{r}_{i}}+{p}_{{r}_{i}}{m}_{{r}_{i}}+\overline{{p}_{{r}_{i}}}{f}_{{r}_{i}}={f}_{{r}_{i}}{m}_{{r}_{i}}+{r}_{i}{f}_{{r}_{i}}+\overline{{r}_{i}}{m}_{{r}_{i}}+{d}_{n}\overline{{r}_{j}}{m}_{{r}_{i}}+(1-{d}_{n}\overline{{r}_{j}}){f}_{{r}_{i}}$$
    (34)

    Then, the quantum Ising model:

    $$ISING7=\frac{1}{8}(10-7{s}_{{f}_{r}}^{i}-5{s}_{{m}_{r}}^{i}+2{s}_{{f}_{r}}^{i}{s}_{{m}_{r}}^{i}+2{s}_{r}^{i}{s}_{{f}_{r}}^{i}-2{s}_{r}^{i}{s}_{{m}_{r}}^{i}+{s}_{d}^{n}{s}_{{m}_{r}}^{i}-{s}_{r}^{j}{s}_{{m}_{r}}^{i}+{s}_{r}^{j}{s}_{{f}_{r}}^{i}-{s}_{d}^{n}{s}_{{f}_{r}}^{i}+{s}_{d}^{n}{s}_{r}^{j}{s}_{{m}_{r}}^{i}-{s}_{d}^{n}{s}_{r}^{j}{s}_{{f}_{r}}^{i})$$
    (35)
  3. (c)

    If \({r}_{i}\) is the second back-up PR of \({d}_{n}\). Then, we have: \({p}_{{r}_{i}}=\underset{{d}_{m}\in D({r}_{i}, { d}_{n})}{\bigvee }( {d}_{m}\underset{{c}_{t}\in C({r}_{i},{ d}_{m})}{\bigwedge }\overline{{c}_{t}} )\). Therefore:

    $${f}_{{r}_{i}}{m}_{{r}_{i}}+{r}_{i}{f}_{{r}_{i}}+\overline{{r}_{i}}{m}_{{r}_{i}}+{p}_{{r}_{i}}{m}_{{r}_{i}}+\overline{{p}_{{r}_{i}}}{f}_{{r}_{i}}={f}_{{r}_{i}}{m}_{{r}_{i}}+{r}_{i}{f}_{{r}_{i}}+\overline{{r}_{i}}{m}_{{r}_{i}}+{m}_{{r}_{i}}\underset{{d}_{m}\in D({r}_{i}, { d}_{n})}{\bigvee }( {d}_{m}\underset{{c}_{t}\in C({r}_{i},{ d}_{m})}{\bigwedge }\overline{{c}_{t}} )+{f}_{{r}_{i}}(1-\underset{{d}_{m}\in D({r}_{i}, { d}_{n})}{\bigvee }( {d}_{m}\underset{{c}_{t}\in C({r}_{i},{ d}_{m})}{\bigwedge }\overline{{c}_{t}} ))$$
    (36)

    Then, the quantum Ising model:

    $$ISING7=\frac{5}{4}-\frac{{s}_{{f}_{r}}^{i}}{2}-{s}_{{m}_{r}}^{i}+\frac{{s}_{{f}_{r}}^{i}{s}_{{m}_{r}}^{i}}{4}+\frac{{s}_{r}^{i}{s}_{{f}_{r}}^{i}}{4}-\frac{{s}_{r}^{i}{s}_{{m}_{r}}^{i}}{4}+\frac{{s}_{{m}_{r}}^{i}-{s}_{{f}_{r}}^{i}}{2}\prod_{{d}_{m}\in D\left({r}_{i}, { d}_{n}\right)}(1-\frac{{1-s}_{d}^{m}}{2}\prod_{{c}_{t}\in C\left({r}_{i},{ d}_{m}\right)}\frac{1+{s}_{c}^{t}}{2} )$$
    (37)
  • The Ising model and Hamiltonian for the eighth term \({f}_{{c}_{j}}{m}_{{c}_{j}}+{c}_{j}{f}_{{c}_{j}}+\overline{{c}_{j}}{m}_{{c}_{j}}+{p}_{{c}_{j}}{m}_{{c}_{j}}+\overline{{p}_{{c}_{j}}}{f}_{{c}_{j}}\)

    We have: \({p}_{{c}_{j}}=\underset{{r}_{i}\in R({c}_{j})}{\bigvee }{r}_{i}\). Therefore:

    $${f}_{{c}_{j}}{m}_{{c}_{j}}+{c}_{j}{f}_{{c}_{j}}+\overline{{c}_{j}}{m}_{{c}_{j}}+{p}_{{c}_{j}}{m}_{{c}_{j}}+\overline{{p}_{{c}_{j}}}{f}_{{c}_{j}}={f}_{{c}_{j}}{m}_{{c}_{j}}+{c}_{j}{f}_{{c}_{j}}+\overline{{c}_{j}}{m}_{{c}_{j}}+{m}_{{c}_{j}}\left(1-\underset{{r}_{i}\in R\left({c}_{j}\right)}{\bigwedge }\overline{{r}_{i}}\right)+{f}_{{c}_{j}}\underset{{r}_{i}\in R\left({c}_{j}\right)}{\bigwedge }\overline{{r}_{i}}$$
    (38)

    Then, the quantum Ising model:

    $$ISING8=\frac{1}{4}(5-2{s}_{{f}_{c}}^{j}-4{s}_{{m}_{c}}^{j}+{s}_{{f}_{c}}^{j}{s}_{{m}_{c}}^{j}+{s}_{c}^{j}{s}_{{f}_{c}}^{j}-{s}_{c}^{j}{s}_{{m}_{c}}^{j}+\left(2{s}_{{m}_{c}}^{j}-2{s}_{{f}_{c}}^{j}\right)\prod_{{r}_{i}\in R\left({c}_{j}\right)}\frac{1+{s}_{r}^{i}}{2})$$
    (39)

The Hamiltonian of the problem can be simply obtained according to deduced Ising model, by replacing the spin variable quantity to the quantum operator. In this paper, the Pauli-Z operator is utilized to construct the cost Hamiltonian. By summing the above-mentioned terms, the cost Hamiltonian of fault diagnosis problem considering the failed/mal operation of PR and CB, as well as the contradictory logic, is constructed.

Experiments settings

In this paper, case studies are conducted on the test system used by Wen39, as shown in Fig. 2. The system consists of 28 components, 40 CBs and 84 PRs:

  • 28 components: A1, …, A4, B1, …, B8, T1, …, T8, L1, …, L8.

  • 40 CBs: CB1, CB2, …, CB40.

  • 84 PRs: 36 main PRs (A1m, …, A4m, B1m, …, B8m, T1m, …, T8m, L1m, …, L8m), 48 back-up PRs (T1p, …, T8p, L1Sp, L1Rp, …, L8Sp, L8Rp, L1Ss, L1Rs, …, L8Ss, L8Rs)

Figure 2
figure 2

The test system which consists of 28 components, 40 CBs and 84 PRs.

where A and B represent the busbar, T represents the transformer, L represents the line, S and R represent the beginning and end of the line respectively (from top to bottom and from left to right), m represents the main protection, p represents the first back-up PR, s represents the second back-up PR. The hyper-parameters of objective functions are \({\omega }_{1}=1, {\omega }_{2}=1, {\omega }_{3}=1, {\omega }_{4}=40\).

Consider the hardware limits of quantum computer, complex cases cannot be tested using the completed model presented in the Sect. 2. Therefore, this paper also conducted cases based on a simplified model, which do not consider the failed/mal operation information and contradictory logic explicitly42. The simplified model’s objective function is:

$$\text{min}E\left({\varvec{H}}\right)= \sum_{i=1}^{{n}_{r}}\left({r}_{i}\oplus {r}_{i}^{*}\right)+\sum_{i=1}^{{n}_{c}}\left({c}_{i}\oplus {c}_{i}^{*}\right)$$
(40)

In this way, the number of qubits is equal to the number of suspected components, which greatly reduces the number of qubits required, allowing us to analyze cases with larger number of components.

The quantum simulation environment is PennyLane’s “default.qubit” device, which provides a pure state simulation of a qubit-based quantum circuit architecture. The classical solver provided by D-Wave, which can accurately solve the PUBO problem and serve as a benchmark43.

Feasibility analysis of proposed method—completed model

In this test, two fault diagnosis cases are simulated to verify the feasibility of proposed method. The first case considering the failed operation on CB. Suppose a failed operation occurs on a CB. The alarm information is the main PR A1m of busbar A1 operates, CB1 and CB3 trip.

Using topological analysis, the suspected component is the busbar A1, denoted by \(D=({d}_{0})\). The related PR is A1m, denoted by \(R=({r}_{1})\). The related CBs are CB1, CB2 and CB3, denoted by \(C=({c}_{1}, {c}_{2}, {c}_{3})\). The received alarm information includes \({r}_{1}, {c}_{1},{c}_{3}\). Therefore, the observed states of PRs and CBs are \({R}^{\prime}=\left(1\right), {C}^{\prime}=\left(1, 0, 1\right).\) According to the small probability event characteristic: \({f}_{{r}_{1}}=0\), \({f}_{{c}_{1}}=0\), \({m}_{{c}_{2}}=0\), \({f}_{{c}_{3}}=0\). The fault hypothesis \(H\) is (\({d}_{0}\), \({r}_{1}\), \({c}_{1}\), \({c}_{2}\), \({c}_{3}\), \({f}_{{c}_{2}}\), \({m}_{{r}_{1}}\), \({m}_{{c}_{1}}\), \({m}_{{c}_{3}}\)). The level of QAOA is set to be 10 and the number of iterations is 100.

The test result of proposed method is shown in Fig. 3. The abscissa is the probability of occurrence of each fault hypothesis, and the ordinate is the bit string of fault hypothesis. The optimal fault hypothesis \({H}^{*}\) is (\(1\), \(1\), \(1\), \(0\), \(1\), \(1\), \(0\), \(0\), \(0\)), which means the busbar A1 is faulty, the main PR A1m operates, CB1 and CB3 are tripped, CB2 is failed to trip. The output result is reasonable and consistent with the classical solver.

Figure 3
figure 3

Top 32 probable fault hypotheses of Case 1 using proposed method.

The second case considering the failed operation on PR. Suppose a failed operation occurs on a PR. The alarm information is the first back-up PR of transformer T1 operate, CB2 and CB4 trip.

Using topological analysis, the suspected component is the transformer T1, denoted by \(D=({d}_{0})\). The related PR is T1m and T1p denoted by \(R=({r}_{1},{r}_{2})\). The related CBs are CB2 and CB4, denoted by \(C=({c}_{1}, {c}_{2})\). The received alarm information includes \({r}_{2}, {c}_{1},{c}_{2}\). Therefore, the observed states of PRs and CBs are \({R}^{\prime}=\left(0, 1\right), {C}^{\prime}=\left(1, 1\right)\). According to the small probability event characteristic: \({m}_{{r}_{1}}=0\), \({f}_{{r}_{2}}=0\), \({f}_{{c}_{1}}=0\), \({f}_{{c}_{2}}=0\). The fault hypothesis \(H\) is (\({d}_{0}\), \({r}_{1}\), \({r}_{2}\), \({c}_{1}\), \({c}_{2}\), \({f}_{{r}_{1}}\), \({m}_{{r}_{2}}\), \({m}_{{c}_{1}}\), \({m}_{{c}_{2}}\)). The level of QAOA is set to be 10 and the number of iterations is 130.

The test result of proposed method is shown in Fig. 4. The abscissa is the probability of occurrence of each fault hypothesis, and the ordinate is the bit string of fault hypothesis. The optimal fault hypothesis \({H}^{*}\) is (\(1\), \(0\), \(1\), \(1\), \(1\), \(1\), \(0\), \(0\), \(0\)), which means the transformer T1 is faulty, the main PR T1m is failed to operate, the first back-up PR T1p operates. CB2 and CB4 are tripped. The output result is also reasonable and consistent with the classical solver.

Figure 4
figure 4

Top 32 probable fault hypotheses of Case 2 using proposed method.

Analysis of small probability event characteristic

To verify that the SPEC method can help to reduce the number of quantum calculations required while ensuring the accuracy, comparison between the proposed model with and without SPEC is conducted under case 1. The result of the model with SPEC is shown in the previous part. When SPEC is not used, the fault hypothesis \(H\) becomes: (\({d}_{0}\), \({r}_{1}\), \({c}_{1}\), \({c}_{2}\), \({c}_{3}\), \({f}_{{r}_{1}}\), \({f}_{{c}_{1}}\), \({f}_{{c}_{2}}\), \({f}_{{c}_{3}}\), \({m}_{{r}_{1}}\), \({m}_{{c}_{1}}\), \({m}_{{c}_{2}}\), \({m}_{{c}_{3}}\)), which requires 13 qubits. However, in our proposed model with SPEC, only 9 qubits are required. In addition, as shown in Table 1, the circuit depth and number of quantum gates of the model with SPEC are 59 and 83, while that of the model without SPEC are 163 and 198, which is much larger. Next, the result of the model without SPEC is obtained through our proposed framework. The level of QAOA is set to be 10 and the number of iterations is 100.

Table 1 Using SPEC vs. not using SPEC for Case 1.

The result of the model without SPEC is presented in Fig. 5. The result is also reasonable, however, the probability of the optimal solution obtained by our proposed model is about 4 times that of the model without SPEC. In addition, the probability of this optimal solution in our model is obviously greater than other fault hypotheses, while for the results without SPEC, there are many interference solutions with similar probabilities. Besides, the simulated time for the model with SPEC and without SPEC is 51.47 and 182.48 s respectively, as shown in Table 1. Our model is obviously faster than the model without SPEC.

Figure 5
figure 5

Top 16 probable fault hypotheses of Case 1 with SPEC and without SPEC.

Feasibility analysis in different problem complexities—simplified model

In order to prove that the proposed framework can obtain accurate fault diagnosis results under problems of different complexity, this paper has conducted 30 tests for different complexities of the test system shown in Fig. 2 using the proposed simplified model. Due to space limitations, only six cases are listed, as shown in Table 2.

Table 2 Test cases using simplified model.

We compared three tests (test 1, 3 and 6) of different complexities (Low, Medium, High) in Table 2. The number of qubits, circuit depth, quantum gates and simulated time of these three tests are shown in Table 3. The results of these tests using the proposed framework are shown in Fig. 6. For all these tests, the optimal solution has high probability and is significantly higher than the other solutions, which shows the feasibility and robustness of our proposed framework under different complexity and the diagnosis results are consistent with the classic solver.

Table 3 Comparison of different problem complexities.
Figure 6
figure 6

The results of test 1 (Low Complexity), test 3 (Medium Complexity) and test 6 (High Complexity).

Comparison between symmetric equivalent decomposition and global variable substitution

In order to verify that the utilized SED method can reduce the complexity of the quantum circuit and improve the efficiency while ensuring the accuracy of the results, we use the SED method to solve test 3 in Table 2 as an example, and compared the results with that obtained by using an existing method called Global Variable Substitute (GVS)33, which is also used to solve the PUBO problem with QAOA. From Fig. 7 and Table 4, we find that the number of qubits and quantum gates used in our model is about half of that in the GVS-based model, and the depth of our model is also obviously smaller. In addition, the running time of our model on the simulator is 10.66 s, while that of the GVS-based model is 21.71 s, which is about two times larger than our method. In fact, the advantage of our method becomes more pronounced as the problem size grows larger, since the quantum gates required by our decomposition-based method are only linear with the number of qubits and do not require any additional auxiliary qubits, whereas the GVS method requires many auxiliary qubits to satisfy the mathematical constraints.

Figure 7
figure 7

The quantum circuit of test 3 using Symmetric Equivalent Decomposition (SED) and Global Variable Substitution Method (GVS). The upper figure shows the circuit using SED, while the lower figure shows the circuit using GVS.

Table 4 Comparison between symmetric equivalent decomposition and global variable substitution.

The results of the two models are shown in Fig. 8. The optimal fault diagnosis of SED-based method is ‘0110’, which means components B2 and B6 are faulty, while that of GVS-based method is ‘01101001’, which corresponds to the same diagnosis result. Although both getting the correct solution, our utilized SED-based model has significantly better performance. First, the probability of the correct optimal solution in our model is obviously greater than other invalid solutions. However, in the results of the GVS-based model, there are many interference solutions with similar probabilities, such as ‘11110000’, which is not a reasonable diagnosis result. Besides, the results of the GVS model are affected by more penalized hyperparameters. Therefore, the utilized SED-based method is much more efficient and robust.

Figure 8
figure 8

The results of test 3 using SED and GVS method. The upper figure shows the results with SED-based model, while the lower figure shows the results with GVS-based model (only top 16 probable fault hypotheses are presented due to the space limit).

Computational time analysis

To analyze the computational time needed for QAOA in the real-world physical devices, this paper follows the time analysis method in19. In our simplified model, the number of the required qubits is equal to the number of suspected components and the circuit size is linear with the action expectation of the related protective relays (PRs) and circuit breakers (CBs). But the computational time of QAOA will grow nonlinearly with the size of the problem. The optimization run using QAOA is composed of hundreds of iterations, and for each iteration, thousands of repetitions of the same quantum circuit are required to have enough statistic to estimate the cost expectation44. Specifically, in this test, the total number of repetitions required is given by (100 iterations per run) \(\times\) (10,000 repetitions for statistics). The time used of a single repetition \({T}_{sr}\) is depending on the complexity of the quantum circuit and considered to be:

$${T}_{sr}={T}_{P}+\left(circuit depth\right)\times {T}_{G}+{T}_{M}$$
(41)

where \({T}_{P}\) is the time to prepare the initial state, \({T}_{G}\) is the average duration of a quantum gate, and \({T}_{M}\) is the time required to measure the qubits. The time scales used in this paper reflect realistic projections for state-of-the-art devices based on superconducting circuits: \(T_{P} + T_{M} = 1\) μs, \(T_{G} = 10\;{\text{ns}}\)44,45,46. For the classical solver, the actual running time in classic processor is recorded.

The time needed to solve a single instance is calculated by averaging the results from 5 instances at each problem size, which corresponds to a single marker in Fig. 9. For QAOA, the considered problem sizes are (2, 4, 5, 7, 10). For classic solver, the considered problem sizes are (4, 5, 7, 10, 12), which is not exactly same as that for QAOA to avoid flat baseline and show the actual trend19.

Figure 9
figure 9

Computational time analysis with different amounts of qubits. Blue markers correspond to the classical baseline (D-Wave’s ExactSolver) while red and green marks correspond to the experimental time required by the quantum algorithm QAOA, with p = 6 and p = 10 respectively. The red and green areas are associated with a 95% confidence interval for the prediction of the QAOA computational time per instance.

Following the method in19, this paper uses an exponential function to fit the relation between cost time and the number of qubits or binary variables. The inference drawn from this extrapolation should be considered as indicating a qualitative trend, given the uncertainty involved in extrapolating from systems of relatively small sizes. Note that exponential curves, as well as smooth curves in general, appear as straight lines in local regions, making it challenging to rule out alternative functional forms for the extrapolation. Nevertheless, it is widely accepted that quantum computers will not be capable of solving NP-hard problems in polynomial time. From Fig. 9, we can find that when the number of qubits to be used reaches about 20, our algorithm is faster than the classical method based on the 95% confidence interval. However, since the method in19 makes some assumptions, the result can only be viewed as an estimate.

Conclusions

Quantum computing offers a new computing paradigm with the potential to efficiently solve large-scale combinatorial optimization problems. This development could prove to be highly valuable in the field of power systems, especially for large-scale systems. In this paper, we proposed a quantum computing-based power system fault diagnosis framework. The mathematical model is defined with PUBO formulation and then reformulate to the Ising model and Hamiltonian, which can be solved using QAOA. To the best of our knowledge, we are among the first to apply quantum computing to the power system fault diagnosis problem. Furthermore, a gate decomposition method and the small probability event are utilized to reduce the complexity of the proposed QAOA-based solving method. Case studies based on the test system demonstrate the ability of the proposed method to obtain the same results as the classical solver. Moreover, the QAOA-based method has the potential to solve large-scale fault diagnosis problems at a faster rate. Future work would focus on extending the application of the algorithm to larger problems and more realistic scenarios, such as reducing the depth of quantum circuits, addressing the noise in quantum circuits, and performing error correction of qubits.

Methods

Symmetric equivalent decomposition of multi-z-rotation gate

As mentioned in the Introduction, the power system fault diagnosis problem can be formulated as a PUBO problem, which can be easily implemented with multi-qubit gates. However, due to the limitations of current hardware, the implementation of multi-qubit gates is difficult and more error-prone.

To address this issue, this paper utilizes a method called symmetric equivalent decomposition (SED), which decomposes an \(n\) qubits z-rotation gate into \(2(n-1)\) CNOT gates and \(1\) RZ gate. The detailed structure of SED is shown in Fig. 10. The mathematical formula for \(n\) qubits-z-rotation gates is \({\prod }_{n}^{\otimes }{\sigma }_{z}^{i}\), which is a tensor product \(\otimes\) of \(n\) Pauli-Z operators \({\sigma }_{z}^{i}\) acting on qubit \(i\). The mathematical formulas of CNOT gate and RZ gate are shown as follows:

Figure 10
figure 10

The symmetric equivalent decomposition of the multi-z-rotation gate.

$$CNOT= \left[\begin{array}{cc}\begin{array}{cc}1& 0\\ 0& 1\end{array}& \begin{array}{cc}0& 0\\ 0& 0\end{array}\\ \begin{array}{cc}0& 0\\ 0& 0\end{array}& \begin{array}{cc}0& 1\\ 1& 0\end{array}\end{array}\right]$$
(42)
$$RZ=\left[\begin{array}{cc}{e}^{-i\frac{\theta }{2}}& 0\\ 0& {e}^{i\frac{\theta }{2}}\end{array}\right]$$
(43)

The mathematical induction is used to prove the SED.

For \(n=2\), according to 17, a double-qubit z-rotation gate can be decomposed into \(2\) CNOT gates and 1 RZ gate.

For \(n=k\), we need to prove that the inductive step holds, i.e. a k + 1-qubit z-rotation gate can be decomposed into 2 CNOT gates and a k-qubit z-rotation gate, as shown in Fig. 11.

Figure 11
figure 11

Transformation diagram of inductive step.

Let the formula of \((k+1)\) qubits z-rotation gate be:

$${\sigma }_{z}^{\otimes (k+1)}=\left[\begin{array}{cc}\begin{array}{cc}A& \\ & -A\end{array}& \begin{array}{cc}& \\ & \end{array}\\ \begin{array}{cc}& \\ & \end{array}& \begin{array}{cc}-A& \\ & A\end{array}\end{array}\right]$$
(44)

where \(A=\left[\begin{array}{ccc}{a}_{1}& & \\ & \ddots & \\ & & {a}_{{2}^{k-1}}\end{array}\right]\) is a diagonal matrix. The value of \({a}_{1}, {a}_{2}, \cdots , {a}_{{2}^{k-1}}\) are \(1\) or \(-1\).

The formula of right figure in Fig. 3 is \(CNOT\otimes {I}^{\otimes \left(k-1\right)}\otimes I\otimes {\sigma }_{z}^{\otimes k}\otimes CNOT\otimes {I}^{\otimes \left(k-1\right)}\)

Since

$$CNOT\otimes {I}^{\otimes \left(k-1\right)}=\left[\begin{array}{cc}{I}_{k}& {0}_{k}\\ {0}_{k}& \begin{array}{cc}{0}_{k-1}& {I}_{k-1}\\ {I}_{k-1}& {0}_{k-1}\end{array}\end{array}\right]$$
(45)
$$I\otimes {\sigma }_{z}^{\otimes k}=\left[\begin{array}{cc}\begin{array}{cc}A& \\ & -A\end{array}& \begin{array}{cc}& \\ & \end{array}\\ \begin{array}{cc}& \\ & \end{array}& \begin{array}{cc}A& \\ & -A\end{array}\end{array}\right]$$
(46)

where \({I}_{k}\), \({I}_{k-1}\) are identity matrix with dimension \({2}^{k}\) and \({2}^{k-1}\), \({0}_{k}\), \({0}_{k-1}\) are zero matrix with dimension \({2}^{k}\) and \({2}^{k-1}\). Therefore, the following equation holds.

$$CNOT\otimes {I}^{\otimes \left(k-1\right)}\otimes I\otimes {\sigma }_{z}^{\otimes k}\otimes CNOT\otimes {I}^{\otimes \left(k-1\right)}=\left[\begin{array}{cc}{I}_{k}& {0}_{k}\\ {0}_{k}& \begin{array}{cc}{0}_{k-1}& {I}_{k-1}\\ {I}_{k-1}& {0}_{k-1}\end{array}\end{array}\right]\otimes \left[\begin{array}{cc}\begin{array}{cc}A& \\ & -A\end{array}& \begin{array}{cc}& \\ & \end{array}\\ \begin{array}{cc}& \\ & \end{array}& \begin{array}{cc}A& \\ & -A\end{array}\end{array}\right]$$
(47)
$$\otimes \left[\begin{array}{cc}{I}_{k}& {0}_{k}\\ {0}_{k}& \begin{array}{cc}{0}_{k-1}& {I}_{k-1}\\ {I}_{k-1}& {0}_{k-1}\end{array}\end{array}\right]=\left[\begin{array}{cc}\begin{array}{cc}A& \\ & -A\end{array}& \begin{array}{cc}& \\ & \end{array}\\ \begin{array}{cc}& \\ & \end{array}& \begin{array}{cc}-A& \\ & A\end{array}\end{array}\right]={\sigma }_{z}^{\otimes (k+1)}$$
(48)

It means that a k + 1-qubit z-rotation gate can be decomposed into 2 CNOT gates and a k-qubit z-rotation gate. Based on mathematical induction, the SED can decompose an \(n\) qubits z-rotation gate into \(2(n-1)\) CNOT gates and \(1\) RZ gate.

Small probability event characteristic of fault diagnosis

The proposed objective function in this paper considers the failed/mal operation of PR and CB, which results in a high dimension of the corresponding FH and a large number of qubits in the problem Hamiltonian. For example, a defective scenario comprising of 4 components, 14 PRs, and 8 CBs would require 70 qubits, a capacity beyond the capabilities of the state-of-the-art quantum processor Sycamore developed by Google, which can handle up to 63 qubits. To address this problem, this paper proposes a dimensionality reduction method based on the small probability event characteristics of power system fault diagnosis. By using the proposed method, the mentioned case would only need 48 qubits, which is possible to be handled by the current hardware.

In power system fault diagnosis, small probability events refer to the events that very rarely occur at the same time, and this probability can be normally ignored. For example, for one PR or CB, a mal operation occurs and the alarm information is missed, or the alarm information is falsely reported and the operation is failed. These small probability events fix the relationship of certain variables and can be used to reduce the dimension of the problem. The following two small probability events are applied in this paper:

$$\left\{ \begin{gathered} r_{i}^{\prime } = 0, m_{{r_{i} }} = 0 \hfill \\ r_{i}^{\prime } = 1, f_{{r_{i} }} = 0 \hfill \\ \end{gathered} \right.$$
(49)
$$\left\{ {\begin{array}{*{20}c} {c_{i}^{\prime } = 0, m_{{c_{i} }} = 0} \\ {c_{i}^{\prime } = 1, f_{{c_{i} }} = 0} \\ \end{array} } \right.$$
(50)

As a result, some failed/mal operation variables can be removed from the corresponding FH.

The following is a simple example. Consider the case where the suspected components are \({d}_{0}\) and \({d}_{1}\), the related PRs are \({r}_{1}\) and \({r}_{2}\), the related CBs are \({c}_{1},{c}_{2},{c}_{3},{c}_{4}\) and \({c}_{5}.\) The received alarm information includes \({r}_{1},{c}_{1},{c}_{3},{c}_{4}.\) Therefore, the observed states of PRs and CBs are \({R}^{\prime}=\left(\text{1,0}\right)\) and \({C}^{\prime}=\left(\text{1,0},\text{1,1},0\right)\). The fault hypothesis \(H\) without using small probability event characteristic is (\({d}_{0}\), \({d}_{1}\), \({r}_{1}\), \({r}_{2}\), \({c}_{1}\), \({c}_{2}\), \({c}_{3}\), \({c}_{4}\), \({c}_{5}\), \({f}_{{r}_{1}}\), \({f}_{{r}_{2}}\), \({f}_{{c}_{1}}\), \({f}_{{c}_{2}}\), \({f}_{{c}_{3}}\), \({f}_{{c}_{4}}\), \({f}_{{c}_{5}}\), \({m}_{{r}_{1}}\), \({m}_{{r}_{2}}\), \({m}_{{c}_{1}}\), \({m}_{{c}_{2}}\), \({m}_{{c}_{3}}\), \({m}_{{c}_{4}}\), \({m}_{{c}_{5}}\))\(,\) requires 23 qubits. By using small probability event characteristic (SPEC), \({f}_{{r}_{1}}=0\), \({f}_{{c}_{1}}=0\), \({f}_{{c}_{3}}=0\), \({f}_{{c}_{4}}=0\), \({m}_{{r}_{2}}=0\), \({m}_{{c}_{2}}=0\), and \({m}_{{c}_{5}}=0\), the fault hypothesis \(H\) becomes (\({d}_{0}\), \({d}_{1}\), \({r}_{1}\), \({r}_{2}\), \({c}_{1}\), \({c}_{2}\), \({c}_{3}\), \({c}_{4}\), \({c}_{5}\), \({f}_{{r}_{2}}\), \({f}_{{c}_{2}}\), \({f}_{{c}_{5}}\), \({m}_{{r}_{1}}\), \({m}_{{c}_{1}}\), \({m}_{{c}_{3}}\), \({m}_{{c}_{4}}\)), which only requires 16 qubits. This paper has proved through experiments that the performance of the processed model will be better.