Open yokkon opened 1 month ago
Thanks for posting this but report @yokkon! We'll take a look and get back to you soon.
Both process_counts
and process_samples
assume that the diagonalizing gates have already been applied before the sampling was performed.
All we need is consistency between the eigenstates created by the diagonalizing gates and the eigenvalues returned by Operator.eigvals()
. So the diagonalizing gates of cost_h
should map the eigenstate with the largest eigenvalue to 000000
. This can be double-checked with qml.ops.functions.assert_valid(cost_h)
.
If the eigenvalues and diagonalizing gates are indeed inconsistent, we'd be happy to look into fixing that.
Hi @yokkon, have you been able to test @albi3ro 's suggestion? Let us know if you're still having issues with this.
Expected behavior
returns the largest eigenvalue of the
cost_h
Hamiltonian. probably because it sorts the eigenvalues and then it doesn't sort the counts / samplesActual behavior
The provided code should return the eigenvalue corresponding to the eigenstate provided.
Additional information
No response
Source code
No response
Tracebacks
No response
System information
Existing GitHub issues