Problem 7: Represent a NAE3SAT Problem on the Quantum Computer
Links:
- Boolean satisfiability problem (SAT): https://en.wikipedia.org/wiki/Boolean_satisfiability_problem
- Ocean Documentation: https://docs.ocean.dwavesys.com/en/latest/
- dwavebinarycsp: https://docs.ocean.dwavesys.com/projects/binarycsp/en/latest/
- BinaryQuadraticModel class: https://docs.ocean.dwavesys.com/projects/dimod/en/latest/
Comments
My answer is: Jij = 1.0
Here is the code:
https://github.com/CalogeroZarbo/quantum_training/blob/master/dwave_problem7.py
BinaryQuadraticModel configuration:
BinaryQuadraticModel({'q1': 0.0, 'q2': 0.0, 'q3': 0.0}, {('q2', 'q1'): 1.0, ('q3', 'q1'): 1.0, ('q3', 'q2'): 1.0}, 1.0, Vartype.SPIN)
Output of the Quantum Machine:
[-1, 1, -1] Occurrences: 660 Energy: 0.0
[1, -1, 1] Occurrences: 819 Energy: 0.0
[1, -1, -1] Occurrences: 761 Energy: 0.0
[1, -1, 1] Occurrences: 613 Energy: 0.0
[1, 1, -1] Occurrences: 736 Energy: 0.0
[-1, 1, 1] Occurrences: 444 Energy: 0.0
[-1, -1, 1] Occurrences: 604 Energy: 0.0
[-1, 1, 1] Occurrences: 363 Energy: 0.0
When Jij=1, the classical gap is maximized for NAE3SAT ising model.
Output and code below:
[-1, -1, 1] Occurrences : 496 Energey : 0.0
[1, -1, -1] Occurrences : 982 Energey : 0.0
[-1, 1, 1] Occurrences : 388 Energey : 0.0
[-1, 1, -1] Occurrences : 572 Energey : 0.0
[1, 1, -1] Occurrences : 463 Energey : 0.0
[1, 1, -1] Occurrences : 660 Energey : 0.0
[1, -1, 1] Occurrences : 963 Energey : 0.0
[1, -1, 1] Occurrences : 476 Energey : 0.0
linear parameters : {'s0': 0.0, 's1': 0.0, 's2': 0.0}
quadratic parameters : {('s1', 's0'): 1.0, ('s2', 's0'): 1.0, ('s2', 's1'): 1.0}
offset parameter : 1.0
https://github.com/yasasp/Dwave-Challenges/blob/master/dwc7.py
Excellent answers from Calogero and Yasas! The answer to this problem is 1.
Now have a look at Problem 8.
Please sign in to leave a comment.