-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Added LogicalExpressionOracle #5656
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Code review
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good in general, I left a few comments 🙂
from qiskit.circuit import QuantumCircuit, QuantumRegister | ||
|
||
|
||
class LogicalExpressionOracle(QuantumCircuit): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't LogicalExpressionOracle
be an Instruction
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be a circuit, since it's going in the circuit library 🙂 also then it's directly compatible with the GroverOperator
which takes a circuit as oracle
Do we need the the single-char expression input format? It seems trivial to write If so, maybe is better to extend Also, the DIMACS expression string is converted to a single-char expression string which is converted to a word expression string which parsed and converted to a tweedledum network. We could remove one step of this if we have no single-char expressions or if we just python parse directly. Even further, I think tweedledum has support for DIMACS expressions... @boschmitt ? |
Is there a "word-format" for xor? Or does this only exist for the char-format ( |
No XOR, but CNF does not have XOR neither, right? |
Yeah but the current |
Included in #5830. |
Summary
Added
LogicalExpressionOracle
into the circuit library which creates an oracle circuit from a logical expression like~x & (y | z)
. It also supports a string in the DIMACS format.Details and comments
This is an ongoing project from Qiskit/qiskit-aqua#1376.