This disclosure is generally related to fault diagnostics of digital circuits. More specifically, this disclosure is related to using quantum computing techniques to generate all diagnoses of a digital circuit.
Digital integrated circuits (ICs) are ubiquitous in people's lives, from washing machines to spaceships. Advances in lithography technologies have enabled the feature size of the circuits to decrease continuously, thus facilitating the development of high-density ICs. However, as the feature size decreases, defects (e.g., due to impurities in the substrate, misalignments of masks, trembling during exposure, etc.) in ICs become more common and can lead to the malfunction of the circuits.
Diagnostics of such complex systems can be challenging. Problems in Model-Based Diagnosis (MBD) are often NP-hard or beyond. Quantum computing is a modern and promising approach to solving a range of algorithmic challenges, from breaking cryptographic systems to designing new medicines, and can be a good candidate for solving various circuit diagnostic problems.
One embodiment provides a method and a system for diagnosing a digital circuit. During operation, the system can obtain a design of the digital circuit, generate a design of a diagnostic circuit by augmenting the design of the digital circuit based on a number of fault-emulating subcircuits, and convert the design of the diagnostic circuit to a design of a quantum oracle circuit. The system can further construct a quantum diagnostic circuit based on the design of the quantum oracle circuit and observe states of the quantum diagnostic circuit to determine probability distributions of one or more faults in the digital circuit.
In a variation on this embodiment, augmenting the design of the digital circuit can include coupling a fault-emulating subcircuit to an output of each logic gate in the digital circuit.
In a further variation, the fault-emulating subcircuit is to emulate one of: a stuck-at-one fault; a stuck-at-zero fault; a wrong-component-type fault; a connection-failure fault; and a bridging fault.
In a variation on this embodiment, converting the design of the diagnostic circuit to the design of the quantum oracle circuit can include representing each primary input of the diagnostic circuit using one qubit and representing each fault input of the diagnostic circuit using one qubit.
In a further variation, converting the design of the diagnostic circuit to the design of the quantum oracle circuit can include replacing a logic gate in the diagnostic circuit with a corresponding quantum subcircuit comprising one or more quantum gates.
In a further variation, the quantum gates can include one or more of a Pauli-X gate, a Hadamard gate, a Controlled NOT (CNOT) gate, and a Controlled Controlled NOT (CCNOT) gate.
In a variation on this embodiment, constructing the quantum diagnostic circuit can include applying a Hadamard gate to a qubit representing a fault input of the diagnostic circuit.
In a variation on this embodiment, observing the states of the quantum diagnostic circuit can include observing the states of the qubit representing the fault input.
In a variation on this embodiment, the system can couple multiple outputs of the diagnostic circuit to a single AND gate, and observing the states of the quantum diagnostic circuit can include observing the states of the qubit representing an output of the AND gate.
In a further variation, the system can collect statistics of the observed states of the quantum diagnostic circuit based on the observed states of the qubit representing the fault input and the observed states of the qubit representing an output of the AND gate.
In the figures, like reference numerals refer to the same figure elements.
The following description is presented to enable any person skilled in the art to make and use the embodiments and is provided in the context of a particular application and its requirements. Various modifications to the disclosed embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be applied to other embodiments and applications without departing from the spirit and scope of the present disclosure. Thus, the present invention is not limited to the embodiments shown but is to be accorded the widest scope consistent with the principles and features disclosed herein.
The instant application provides a novel solution to the diagnostic problem of digital circuits. The proposed solution uses a quantum computing system with a plurality of quantum gates to compute, simultaneously, all diagnoses of a digital circuit. More specifically, the quantum computing system can compute a probability distribution function for each possible fault in the digital circuit. To compute the diagnostic solutions using quantum computing techniques, the system can convert a fault-augmented digital circuit into a quantum oracle circuit comprising a plurality of quantum gates coupled to each other via quantum wires that hold the states of the quantum bits (or qubits). When converting the fault-augmented digital circuit into the quantum oracle circuit, the system can represent each primary input using a quantum wire (or qubit) and replace each logic gate with an equivalent quantum subcircuit. To compute the probabilities of all possible faults, a Hadamard gate can be applied to each fault input to place the n unknown fault inputs in superpositions. The diagnostic solution can be obtained by collapsing the states of the quantum system (i.e., by performing measurements).
A digital circuit C can be represented mathematically using a multi-output Boolean function ƒC:[0, 1]m→[0, 1]n. The m arguments of ƒC are the primary inputs of C and can be denoted X={x1, x2, . . . , xm}. Similarly, the n results of ƒC are the primary outputs of C and can be denoted Y={y1, y2, . . . , yn}.
A digital circuit can include a network of logic gates connected by wires, with each gate implementing a certain (typically small) Boolean function. Common Boolean functions can include negation (NOT or ¬), conjunction (AND or ∧), disjunction (OR or ∨), exclusive or (XOR or ⊕), implication (→), and logical equivalence (↔). The set of elementary Boolean functions can be referred to as the basis of the circuit. Basic logic gates used in digital circuits can include but are not limited to two-input AND, OR, and NOR gates, inverters, etc. Other more complex circuit structures can be implemented by combining one or more basic logic gates. For example, multi-input AND and OR gates can be implemented by chaining the two-input AND and OR gates, respectively; and NAND and NOR gates can be implemented by appending inverters to AND and OR gates, respectively.
In some embodiments, faults in digital circuits can be modeled using fault augmentation, where an original circuit can be converted into a fault-augmented diagnostic circuit by including subcircuits that emulate possible faults (e.g., stuck-at-one and stuck-at-zero faults). Although the stuck-at faults are common faults encountered by digital circuits, other types of faults may also be present in a digital circuit, such as the wrong-component-type faults (e.g., a supposedly OR gate behaves like an AND gate or vice versa), the connection-failure faults (e.g., an open wire), the bridging faults (e.g., a shorted connection to the ground or other wires), etc. Potential faults can be emulated by augmenting the original circuit design using a number of standard components (e.g., logic gates). The fault-augmented diagnostic circuit design can have the same set of primary inputs and outputs as the original circuit design and can include a new set of assumable inputs, which allow a simulation system to simulate the effect of a fault by assigning values to the assumable inputs. In this way, the circuit diagnostic problem becomes the problem of finding the assignment to the assumable inputs that can drive the fault node.
In this disclosure, we use the stuck-at-1 fault as an example.
The bottom drawing of
Computing a diagnosis of the circuit can be reduced to finding compatible values of a special subset of inputs, the fault inputs (i.e., the assumable inputs defining fault locations). Faults in a circuit often show stochastic behaviors, and a computational framework for probabilities should be established. It has been shown that one can compute the probability of each output from a circuit and the probability of each input. Two algorithms for computing the probabilities of the circuit outputs have been demonstrated: one algorithm first computes all prime implicants of the Boolean function modeling the digital circuit, and the other starts from the inputs and performs real-value arithmetic over the probability values. The second algorithm has polynomial complexity as forward propagation from inputs to outputs can be done easily.
In some embodiments, an NP-complete approach can be used to compute the probabilities of a subset of inputs (e.g., the fault inputs) given the primary inputs and the outputs of a circuit. In one embodiment, a table with all consistent values can be generated, with each row of the table being a diagnosis (i.e., the assignments to the assumable or fault inputs) and each column being a fault variable. The value of the fault variable can be one or zero, with one indicating fault and zero indicating no fault.
Various techniques can be used to compute the fault probabilities. In classical approaches, the conditional fault probabilities can be computed based on satisfiability. Using the fault-augmented full adder circuit 210 (denoted Cƒ) shown in
As discussed previously, faults in complex systems can be stochastic, making quantum computing an ideal candidate for solving the diagnostic problem in a complex system, because the result of a quantum computation is always a probability distribution function. In some embodiments, a quantum-computing-based diagnostic system can build an equivalent quantum circuit to compute all diagnoses of a digital circuit.
Although, on the surface, quantum circuits can be similar to digital circuits as they both include gates connected by wires, there are multiple important differences between a quantum circuit and a digital circuit. One important difference is that, while the state of a digital circuit is a Boolean vector over all wires, the state of a quantum circuit is a superposition of all quantum bits (or qubits).
A quantum circuit can include a set of quantum wires ψ1, ψ2, . . . , ψn (one wire per qubit) that connect a number of quantum gates. A quantum gate is a basic quantum circuit operating on a small number of qubits carried by the quantum wires. Unlike metal wires in classical digital circuits, quantum wires do not have to be metal wires. A quantum wire can be any medium that can carry a qubit and can be, for example, laser light, or even some passage of time.
The simplest quantum circuit can include a quantum wire ψ1 carrying a single qubit and one or more quantum gates that act on this single qubit. The state of the quantum circuit can be represented using the Dirac or Braket notation as |ψ=α|0+β|1, where α, β∈. In this disclosure, all kets are vectors of size two, where |0 is
and |1 is
The state of a quantum circuit with two qubits (or two quantum wires) is the superposition with four terms: |ψ1ψ2=α00|00+α01|01+α10|10+α11|11, where α00, α01, α10, α11∈.
Hadamard gate 502 acts on a single qubit (or is connected to a single quantum wire) and maps the basis state |0 to
and basis state |1 to
thus creating an equal superposition of the two basis states.
Pauli-X gate 504 acts on a single qubit and is the quantum equivalent of a NOT gate in classical digital circuits with respect to the standard basis (|0, |1). More specifically, Pauli-X gate 504 can map basis state |0 to |1 and basis state |1 to |0.
Controlled Not (CNOT) gate 506 and Toffoli or CCNOT gate 508 can act on two or more (obits, where one or more qubits can function as a control for some operation. For example, CNOT gate 506 can act on two qubits and performs the NOT operation on the second qubit only when the first qubit is |1 and otherwise leaves the second qubit unchanged. CCNOT gate 508 is related to the classical AND and XOR operations as it performs the mapping |a,b,c|a,b,c⊕(a∧b) on states in the computational basis.
A Hilbert space representing a quantum system must satisfy the normalization condition. Accordingly, the inner product of a vector with itself is equal to one (i.e., ψ|ψ=1. The length of a vector in a particular direction represents the “probability amplitude” of the quantum system. In some embodiments, to apply the quantum computing principle to the circuit diagnostic problem, one can create a quantum oracle circuit that is analogous to the fault-augmented circuit of a to-be-diagnosed digital circuit. “Quantum oracle” is a term used in the realm of quantum computing to refer to a black box that performs certain operations. In this disclosure, the quantum oracle circuit can be considered the quantum equivalent of the classical circuit. All assumable inputs in the quantum oracle circuit can be set as a superposition of |0 and |1. The collapsed probability amplitude circuit readout is the a posteriori probability distribution function of each fault given the observation α and the circuit φ. Note that the observation includes both the primary inputs and the primary outputs.
In some embodiments, creating the quantum oracle circuit can include adding a quantum wire for each primary input of the to-be-diagnosed circuit and replacing each classical logic gate (e.g., AND, OR, NOT, XOR, etc.) with an equivalent quantum subcircuit.
Operations in the algorithm can include sorting all logic gates in the fault-augmented circuit (e.g., circuit 210 shown in
While generating the quantum oracle circuit design, the algorithm can replace each classical logic gate with a corresponding quantum subcircuit. Exemplary corresponding relationships between classical logical gates and quantum subcircuits are shown in
Once a design of the quantum oracle circuit (denoted U) is generated, one can use such design to construct a quantum diagnostic circuit to directly compute the conditional probability of each fault in a digital circuit, given the input/output of the digital circuit. To do so, each of the n unknown fault inputs (e.g., n[ƒ], ƒ∈F) can be put into a superposition of |0 and |1 by applying a Hadamard gate. In one example, the primary inputs can be initialized as |0 or |1, corresponding to the Boolean values of the input assignment α.
According to the principle of quantum mechanics, the collapsed state of the quantum diagnostic circuit can be obtained by performing measurements on the quantum circuits. More particularly, given the assignment of the primary inputs, measurements can be performed on the qubits representing the fault inputs as well as the qubit representing the output. In this example, the circuit has a single output due to the AND gate.
In some embodiments, a quantum system (which can include the quantum oracle circuit, the Hadamard gates, and the Paul-X gate) according to
The unitary matrix of quantum circuit 1000 can be expressed as:
Multiplying the above unitary matrix with the initial state [1 0 0 0]T can result in the final state of quantum circuit 1000: 1/√{square root over (2)}[0 1 1 0]T. The final state can be expressed using Dirac's notation as 1/√{square root over (2)}|01+1/√{square root over (2)}|10. After collapsing the state (e.g., by performing the measurements), the resulting probability distribution is Pr(|01)=Pr(|10)=½. According to
Subsequently, the system can design a quantum oracle circuit based on the fault-augmented circuit (operation 1106). Designing the quantum oracle circuit can include sorting the logic gates in the fault-augmented circuit, replacing each logic gate with a corresponding quantum subcircuit, and storing the mapping relationships between the classical variables (i.e., the Boolean input/output of each gate) in the fault-augmented circuit and the quantum variables (or qubits) in the quantum oracle circuit. In addition to qubits representing the primary inputs, the assumable inputs (or fault inputs), and the primary outputs, the quantum variables (i.e., qubits) in the quantum oracle circuit can also include ancillary qubits. In one embodiment, each ancillary qubit can correspond to an output of a corresponding logic gate. In some embodiments, before being converted into the quantum oracle circuit, a multi-output fault-augmented circuit can first be converted into a single-output circuit by coupling all of its primary outputs to an AND gate. Depending on whether an observed bit value is zero or one, the corresponding output may be fed to the AND gate via an inverter or directly, respectively.
Based on the quantum oracle circuit, the diagnostic system can construct a quantum diagnostic circuit (operation 1108). Constructing the quantum diagnostic circuit can include applying a Hadamard gate to each fault input, thus achieving the goal of placing the fault input in a superposition. By placing all fault inputs in superpositions, the diagnostic system can determine the conditional probability distribution functions of all potential faults in the to-be-diagnosed circuit (e.g., the faults corresponding to the fault-emulating subcircuits in the fault-augmented circuit). Constructing the quantum diagnostic circuit can also include adding measurement units for those qubits representing the fault inputs and the circuit output.
Once the quantum diagnostic circuit is constructed, the diagnostic system can perform a plurality of experiments or observations using the quantum diagnostic circuit (operation 1110). While performing the experiments or observing the states of the quantum diagnostic circuit, the diagnostic system can assign the primary inputs to predetermined values. In some examples, the diagnostic system can assign all ones or all zeros to the primary inputs. In an alternative example, the diagnostic system can assign random values to the primary inputs. Note that the diagnostic system can also observe the behavior of the to-be-diagnosed physical circuit. For example, the diagnostic system can observe the primary outputs of the physical circuit responsive to the primary inputs with assigned values. Performing an experiment on the quantum circuit can include measuring the states of the qubits representing the fault inputs and the primary outputs, which can cause those states to collapse according to the probability distribution function of the corresponding fault. For example, for the given primary input and output values, the probability of a qubit representing a fault input collapsing to the |1 state can indicate the likelihood of the corresponding gate being faulty. In some embodiments, instead of running experiments using an actual quantum system (e.g., a quantum diagnostic circuit with various quantum gates), it is also possible to simulate the behavior of the quantum system on a classical computer. Note that, even being simulated on a classical computer, the quantum algorithm can still outperform the classical SAT-based circuit-diagnostic techniques (e.g., the algorithm shown in
To reduce statistical error, the diagnostic system can perform a large number of experiments. The diagnostic system can collect statistics from those experiments to determine the probability distribution function associated with each fault (operation 1112) or the faulty likelihood of each gate. In some embodiments, collecting the statistics can include computing the probability distribution function of a particular state (|0 or |1) of each fault input. For example, the diagnostic system can count the number of times the measured state of a fault input being |1 and then divide it by the total number of measurements to obtain the faulty probability of the corresponding gate. While collecting the statistics, the diagnostic system only considers the measurement results with the measured output state matching the observed output of the physical circuit. For example, for a given set of assignments to its primary inputs, the physical circuit can generate a set of primary outputs. The set of primary outputs can be mapped to the state of the output of the quantum diagnostic circuit. Different runs of the experiment may result in different states of the output. However, only the runs that result in the state of the output matching the observed primary outputs of the physical circuit would be considered, because they represent the behavior of the physical circuit. In one embodiment, because the quantum oracle circuit is constructed by sending the multiple primary outputs of the to-be-diagnosed circuit to an AND gate either directly or via inverters, the output of the quantum oracle circuit matches the observed output of the to-be-diagnosed if, and only if, the state of its output (i.e., the output of the AND gate) is |1.
The diagnostic system can subsequently output the diagnoses (operation 1114). The diagnoses can include the probability distribution functions of all potential faults in the circuit. Note that the diagnostic system may perform experiments or measurements using the quantum diagnostic circuit based on one set of observed circuit inputs/outputs or based on multiple sets of observed circuit inputs/outputs. For each set of observed inputs/outputs, different quantum oracle circuits may be generated, because the coupling to the final AND gate may vary for different observed values of the primary outputs.
Fault library 1202 stores the fault-augmented subcircuits for various types of faults, including but not limited to the stuck-at faults, the wrong-component-type faults, the bridging faults, and the open-wire faults. Circuit-receiving module 1204 receives a to-be-diagnosed digital circuit. In some embodiments, circuit-receiving module 1204 can receive the design (e.g., the layout) of the circuit. It is assumed that the to-be-diagnosed physical circuit is manufactured according to the design. In further embodiments, circuit-receiving module 1204 can also receive the testing results (e.g., inputs and the corresponding outputs) of the circuit. In addition to a digital circuit, circuit-receiving module 1204 can receive the design of a physical system or a computational system of a different type, such as a mechanical system, an analog circuit, an electro-optical system, an electro-mechanical system, a processor, a reversible computing circuit, a quantum circuit, an optical circuit, a quantum optical circuit, a computer program, etc. Depending on the type of physical system, the received design can have a different format. For example, for a mechanical or an optical system, the design can be a model (e.g., a mathematical model) of the system; and for a computer program, the design can be logic expressions. In addition, depending on the type of physical system being diagnosed, fault library 1202 can include different types of faults.
Fault-augmented-circuit-generation module 1206 can generate the design of a fault-augmented circuit based on the fault-emulating subcircuits included in fault library 1202. For example, to diagnose a particular type of fault (e.g., the stuck-at-one fault), a fault-augmented circuit can be generated by inserting a corresponding fault-emulating subcircuit at the output of each logic gate in the original circuit. Quantum-oracle-circuit-generation unit 1208 can generate a quantum equivalent of the classical fault-augmented circuit, referred to as a quantum oracle circuit. While generating a design of the quantum oracle circuit, quantum-oracle-circuit-generation unit 1208 can represent the primary inputs/outputs and the fault inputs using qubits and also add an ancillary qubit for each gate output. Quantum-oracle-circuit-generation unit 1208 can replace each classical logic gate with a corresponding quantum subcircuit.
Quantum-diagnostic-circuit-construction unit 1210 can construct a quantum diagnostic circuit based on the design of the quantum oracle circuit. In some embodiments, quantum-diagnostic-circuit-construction unit 1210 can use standard quantum computing technologies (e.g., superconductor-based or laser-based technologies) to construct a physical diagnostic circuit comprising various types of quantum gates, such as Hadamard gates, Pauli-X gates, CNOT gates, CCNOT gates, etc. More specifically, the diagnostic circuit can be constructed according to the design of the quantum oracle circuit (e.g., by applying Hadamard gates to the fault inputs and adding measurement units at the fault inputs and the circuit output).
Experiment unit 1212 can perform experiments (e.g., taking measurements) on the quantum diagnostic circuit. Each measurement can cause the quantum states of the qubits representing the fault inputs to collapse. The probability of each state can correspond to the probability of the gate being faulty or healthy. Experiment unit 1212 can be configured to perform many experiments to reduce the error in determining the probability distribution function of each fault. Statistics-collection unit 1214 can collect the statistics of the measured states from the experiments. Only those experiments with their output state matching the observed outputs of the digital circuit would be considered. Output unit 1216 can output the diagnoses (e.g., the probability distribution of each fault) of the digital circuit.
Circuit-diagnostic system 1322 can include instructions, which when executed by computer system 1300, can cause computer system 1300 or processor 1302 to perform methods and/or processes described in this disclosure. Specifically, circuit-diagnostic system 1322 can include instructions for receiving a to-be-diagnosed circuit (circuit-receiving instructions 1324), instructions for generating a fault-augmented circuit (fault-augmented-circuit-generation instructions 1326), instructions for generating a quantum oracle circuit (quantum-oracle-circuit-generation instructions 1328), instructions for constructing a quantum diagnostic circuit (quantum-diagnostic-circuit construction instructions 1330), instructions for executing experiments using the quantum diagnostic circuits (experiment-execution instructions 1332), and instructions for collecting statistics from the experiment results (statistics-collection instructions 1334). Data 1340 can include a fault library 1342.
In general, the disclosed embodiments can provide a system and method for diagnosing digital circuits using quantum computing technologies. By placing the qubits modeling the circuit faults in superpositions, the conditional probability distribution function of each fault can be obtained by collapsing the states of a quantum system equivalent to the digital circuit. Compared with existing approaches based on classical SAT solvers, the disclosed solution can provide higher computational efficiency and scalability, even when the quantum circuit is being simulated on a classical computer.
The methods and processes described in the detailed description section can be embodied as code and/or data, which can be stored in a computer-readable storage medium as described above. When a computer system reads and executes the code and/or data stored on the computer-readable storage medium, the computer system performs the methods and processes embodied as data structures and code and stored within the computer-readable storage medium.
Furthermore, the methods and processes described above can be included in hardware modules or apparatus. The hardware modules or apparatus can include, but are not limited to, application-specific integrated circuit (ASIC) chips, field-programmable gate arrays (FPGAs), dedicated or shared processors that execute a particular software module or a piece of code at a particular time, and other programmable-logic devices now known or later developed. When the hardware modules or apparatus are activated, they perform the methods and processes included within them.
The foregoing descriptions of embodiments of the present invention have been presented for purposes of illustration and description only. They are not intended to be exhaustive or to limit the present invention to the forms disclosed. Accordingly, many modifications and variations will be apparent to practitioners skilled in the art. Additionally, the above disclosure is not intended to limit the present invention. The scope of the present invention is defined by the appended claims.
This application claims the benefit of U.S. Provisional Application No. 63/402,353, Attorney Docket Number PARC-20220128US01, titled “QUANTUM ALGORITHM FOR COMPUTING ALL DIAGNOSES OF A SWITCHING CIRCUIT,” by inventors Aleksandar B. Feldman, Johan de Kleer, and Ion Matei, filed on 30 Aug. 2022, the disclosure of which is incorporated herein by reference in its entirety.
Number | Date | Country | |
---|---|---|---|
63402353 | Aug 2022 | US |