Skip to content
3 changes: 3 additions & 0 deletions doc/releases/changelog-dev.md
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,9 @@

<h3>Documentation 📝</h3>

* Improved the docstring of the `is_hermitian` property in the `qml.operation.Operator` class.
[(#7946)](https://github.com/PennyLaneAI/pennylane/pull/7946)

* Improved the docstrings of all optimizers for consistency and legibility.
[(#7891)](https://github.com/PennyLaneAI/pennylane/pull/7891)

Expand Down
21 changes: 20 additions & 1 deletion pennylane/operation.py
Original file line number Diff line number Diff line change
Expand Up @@ -1284,7 +1284,26 @@ def pauli_rep(self) -> Optional["qml.pauli.PauliSentence"]:

@property
def is_hermitian(self) -> bool:
"""This property determines if an operator is hermitian."""
"""This property determines if an operator is likely hermitian.

.. note:: It is recommended to use the :func:`~.is_hermitian` function.
Although this function may be expensive to calculate,
the ``op.is_hermitian`` property can lead to technically incorrect results.

If this property returns ``True``, the operator is guaranteed to
be hermitian, but if it returns ``False``, the operator may still be hermitian.

As an example, consider the following edge case:

>>> op = (qml.X(0) @ qml.Y(0) - qml.X(0) @ qml.Z(0)) * 1j
>>> op.is_hermitian
False

On the contrary, the :func:`~.is_hermitian` function will give the correct answer:

>>> qml.is_hermitian(op)
True
"""
return False

# pylint: disable=no-self-argument, comparison-with-callable
Expand Down