NOT, NAND, NOR, and XNOR gates
dwavebinarycsp / factories / constraint / gates.py provides AND, OR, and XOR gates. What about NOT, NAND, NOR, and XNOR gates?
dwavebinarycsp / factories / constraint / gates.py provides AND, OR, and XOR gates. What about NOT, NAND, NOR, and XNOR gates?
Comments
I think I found the answer. dwavebinarycsp.Constraint.flip_variable() can be used to negate a variable. See the exchange between Alex Condello and Joel Pasvolsky in the comments pertaining to dwavebinarycsp issue #45 on GitHub:
https://github.com/dwavesystems/dwavebinarycsp/issues/45
I see that flip_variable() is described in the Ocean SDK documentation:
https://docs.ocean.dwavesys.com/projects/binarycsp/en/latest/reference/generated/dwavebinarycsp.Constraint.flip_variable.html
I think it would be helpful to mention flip_variable() in the gates.py source code and in the documentation of and_gate(), or_gate(), and xor_gate().
And if possible, it would be convenient if searching for NOT, NAND, NOR, or XNOR returned a pointer to flip_variable().
Hi Scott,
That's a great suggestion!
We have added your suggestion and referenced this post in the git hub issue:
https://github.com/dwavesystems/dwavebinarycsp/issues/45
As a side note, you too can post directly to git hub on issues that you think are important!
Thank you for getting involved and giving us your input!
Thank you, David.
Please sign in to leave a comment.