Closed lillian542 closed 1 year ago
You are right the example doesn't work.
I am not sure if this is a bug, or if it is only an inconsistency in the Hamiltonian.compare
docstring. The warning says the following:
The compare method does **not** check if the matrix representation of a :class:`~.Hermitian` observable
is equal to an equivalent observable expressed in terms of Pauli matrices, or as a linear combination
of Hermitians. To do so would require the matrix form of Hamiltonians and Tensors be calculated,
which would drastically increase runtime.
And in the example they are comparing a Hermitian
observable with a linear combination of Hermitian
observables, right?
If it is an inconsistency we only need to update the docstring.
I believe it's only an inconsistency. Can I just replace that example with a random example that does work?
Sure!
Expected behavior
The first docstring example suggests that it should return
True
.Actual behavior
It returns
False
.Additional information
No response
Source code
Tracebacks
No response
System information
Existing GitHub issues