Skip to content

Fix Pauli-basis expansion normalization#5107

Open
matti-sarjala wants to merge 1 commit into
Qiskit:mainfrom
matti-sarjala:fix-pauli-basis-normalization
Open

Fix Pauli-basis expansion normalization#5107
matti-sarjala wants to merge 1 commit into
Qiskit:mainfrom
matti-sarjala:fix-pauli-basis-normalization

Conversation

@matti-sarjala
Copy link
Copy Markdown

What changed

This corrects the Pauli-basis expansion formula in docs/guides/specify-observables-pauli.ipynb by adding the missing 1/2^n Hilbert--Schmidt normalization factor.

Why

For standard n-qubit Pauli strings,

\mathrm{Tr}(P_i P_j) = 2^n \delta_{ij},

so the coefficient of a Pauli string P in the expansion of an observable O is

\alpha_P = \frac{1}{2^n}\mathrm{Tr}(O P).

This also matches the coefficients printed by the example immediately below the formula.

Risk

Documentation-only change. No code or API behavior is changed.

Tested

Checked the formula against the 2-qubit matrix example in the same guide:
Tr(O IZ) = -4, Tr(O XI) = 2, and Tr(O YY) = 4, which become -1, 0.5, and 1 after division by 2^2 = 4.

@matti-sarjala matti-sarjala requested a review from a team May 13, 2026 23:35
@review-notebook-app
Copy link
Copy Markdown

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented May 13, 2026

CLA assistant check
All committers have signed the CLA.

@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@qiskit-bot
Copy link
Copy Markdown
Contributor

Thanks for contributing to Qiskit documentation!

Before your PR can be merged, it will first need to pass continuous integration tests and be reviewed. Sometimes the review process can be slow, so please be patient. Thanks! 🙌

One or more of the following people are relevant to this code:

@abbycross abbycross linked an issue May 14, 2026 that may be closed by this pull request
6 tasks
@kaelynj kaelynj self-requested a review May 14, 2026 14:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

Missing 1/2^n normalization factor in Pauli-basis expansion formula

3 participants