Quantum Algorithms
Boolean Satisfiability Problems
Satisfiability problems are an extension of Grover's algorithm. The Boolean satisfiability problem focuses on determining if there exists an interpretation that satisfies a given Boolean formula. Said differently, the Boolean satisfiability problem determines whether the variables of a given Boolean formula can be consistently replaced by the values 'True' or 'False' so that the Boolean formula evaluates to 'True'. Thus, the formula is labeled satisfiable. Otherwise, if no such assignment exists, the function expressed by the Boolean formula is 'False' for all possible variable assignments and is unsatisfiable.
For example, the formula "a AND NOT b" is satisfiable because one can find the values a = True and b = False, which make (a AND NOT b) = True. In contrast, "a AND NOT a" is unsatisfiable.
A naïve way to find such an assignment is by trying every possible combinations of input values of f. Below is the table obtained from trying all possible combinations of v1,v2,v3v1,v2,v3.
Note: SAT problems can be always written in conjunctive normal form (CNF), that is, a conjunction of one or more clauses, where a clause is a disjunction of three literals. Said differently, it is an AND of k ORs.
Changes / Migration Guide:
- Instead of using the LogicalExpressionOracle now use the PhaseOracle circuit from the circuit library.
- Import ...
- from qiskit.circuit.library import PhaseOracle
- from qiskit.algorithms import Grover, AmplificationProblem
- Import ...
References:
- Grover's Algorithm:
https://en.wikipedia.org/wiki/Grover%27s_algorithm - Grover’s algorithm examples - Boolean Logical Expressions:
https://qiskit.org/documentation/tutorials/algorithms/07_grover_examples.html - Solving Satisfiability Problems using Grover's Algorithm
https://qiskit.org/textbook/ch-applications/satisfiability-grover.html - Grover's Algorithm:
https://qiskit.org/textbook/ch-algorithms/grover.html - Dinner Party using Grover's Algorithm — Programming on Quantum Computers — Coding with Qiskit:
https://www.youtube.com/watch?v=ePr2MgQkqL0 - Qiskit Algorithms Migration Guide
https://qiskit.org/documentation/stable/0.28/aqua_tutorials/Qiskit%20Algorithms%20Migration%20Guide.html - CNF Examples:
https://people.sc.fsu.edu/~jburkardt/data/cnf/cnf.html - Boolean Satisfiability Problem:
https://en.wikipedia.org/wiki/Boolean_satisfiability_problem - Quantum Algorithms to Change the World:
https://youtu.be/_54i80UFHSs - Grover's Algorithm — Programming on Quantum Computers — Coding with Qiskit
https://www.youtube.com/watch?v=0RPFWZj7Jm0 - Grover:
https://qiskit.org/documentation/stubs/qiskit.algorithms.Grover.html