Qiskit / documentation

The documentation content home for https://docs.quantum.ibm.com.
https://docs.quantum.ibm.com
Apache License 2.0
29 stars 48 forks source link

Incorrect Hamiltonian for max cut problem graph in `Variational Algorithm Design` badge #1623

Open GuillermoAbadLopez opened 1 week ago

GuillermoAbadLopez commented 1 week ago

URL to the relevant documentation

Max cut problem in Ansatze and Variational Forms of the Variational Algorithm Design badge

Select all that apply


Problem

Hey! I was doing the Variational Algorithm Design badge, from IBM Quantum learning, and I noticed that in the max-cut problem, the SparsePauliOp that is given as a Hamiltonian, looked a bit off:

(notice the Z's positions in each term [from right to left], indicate an edge (the connectivity) between two nodes: IIZZ means there are 4 qubits, and that qubit 0 is connected to qubit 1)

Screenshot 2024-07-01 at 18 49 07

Possible origin of the Problem

I think this comes from a copypaste from this other graph in another page, where its actually correct (different graph)

Screenshot 2024-07-01 at 18 52 03

Solution

This IIIZZ+IIZIZ+IZIIZ+ZIIIZ, has to change into IIZZ+IZIZ+IZZI+ZIIZ+ZZII, both in:

(or the graph image has to change, but that would be weird, since in the next page we use it...)

Checks:

I searched a bit, and found this old documentation, from Qiskit textbook, which has what I would have guessed is correct:

Screenshot 2024-07-01 at 18 06 41

Also, a bit later, I arrived at the next page of the Badge (Cost Functions), and there it was correctly written as well:

image

GuillermoAbadLopez commented 1 week ago

Opening the Issue here, since I didn't know where else to open it..

@Eric-Arellano told me that later, he would tag the relevant people 👍