Qiskit / qiskit

Qiskit is an open-source SDK for working with quantum computers at the level of extended quantum circuits, operators, and primitives.
https://www.ibm.com/quantum/qiskit
Apache License 2.0
5.11k stars 2.34k forks source link

Clarify docstring: Pauli-types `conjugate()` is complex conjugate, not Hermitian conjugate #13051

Open aeddins-ibm opened 1 month ago

aeddins-ibm commented 1 month ago

Environment

What is happening?

Not strictly a bug, just a doc clarification.

The docstring for the conjugate method of Pauli is:

Return the conjugate of each Pauli in the list.

and for SparsePauliOp is

Return the conjugate of the SparsePauliOp.

Personally, when I hear "conjugate of an operator" I think Hermitian conjugate. To avoid confusion with Hermitian conjugate, can we change the docstring of conjugate for Pauli, SparsePauliOp, etc to specify explicitly:

Return the complex conjugate of each Pauli in the list.

and

Return the complex conjugate of the SparsePauliOp.

(It's also weird there's a reference to a "list" in the docstring for a single Pauli, but I'm not concerned about that here).

How can we reproduce the issue?

n/a

What should happen?

n/a

Any suggestions?

No response

Cryoris commented 18 hours ago

I would agree, that can be confusing. Would you like to open an issue to fix this? 🙂