URL to the relevant guide or resource
URL:
https://quantum.cloud.ibm.com/docs/guides/specify-observables-pauli
Section / paragraph:
Guide: “Specify observables in the Pauli basis”
The issue is in the paragraph that begins:
“For observables that are not given in terms of Pauli operators but in a matrix form, we first have to reformulate them in the Pauli basis...”
Specifically, the displayed formula immediately after “We expand the observable O as” appears to be missing the 1/2^n normalization factor.
Select all that apply
Describe the fix or the content request.
In docs/guides/specify-observables-pauli.ipynb, the guide expands an observable in the Pauli basis as
O =
\sum_{P \in \{I, X, Y, Z\}^{\otimes n}}
\mathrm{Tr}(O P) P.
I think this is missing the Hilbert--Schmidt normalization factor for n-qubit Pauli strings.
For the standard, unnormalized Pauli strings,
\mathrm{Tr}(P_i P_j) = 2^n \delta_{ij},
so the expansion coefficients should be
\alpha_P =
\frac{1}{2^n}\mathrm{Tr}(O P).
Therefore the formula should read
O =
\frac{1}{2^n}
\sum_{P \in \{I, X, Y, Z\}^{\otimes n}}
\mathrm{Tr}(O P) P.
This also matches the example immediately below the formula. For the 2-qubit matrix in the guide:
Tr(O IZ) = -4, so the coefficient is -4 / 4 = -1
Tr(O XI) = 2, so the coefficient is 2 / 4 = 0.5
Tr(O YY) = 4, so the coefficient is 4 / 4 = 1
These are the coefficients printed by SparsePauliOp.from_operator(matrix). Without the 1/2^n factor, the formula would give coefficients larger by a factor of 4 in this example.
Suggested minimal correction:
O =
\frac{1}{2^n}
\sum_{P \in \{I, X, Y, Z\}^{\otimes n}}
\mathrm{Tr}(O P) P.
Optionally, the explanatory sentence could add:
The factor $1/2^n$ accounts for the Hilbert--Schmidt normalization of n-qubit Pauli strings.
Happy to open a small PR if this correction looks right.
For new content requests - if the request is accepted, do you want to write the content?
(No answer)
URL to the relevant guide or resource
URL:
https://quantum.cloud.ibm.com/docs/guides/specify-observables-pauli
Section / paragraph:
Guide: “Specify observables in the Pauli basis”
The issue is in the paragraph that begins:
“For observables that are not given in terms of Pauli operators but in a matrix form, we first have to reformulate them in the Pauli basis...”
Specifically, the displayed formula immediately after “We expand the observable O as” appears to be missing the 1/2^n normalization factor.
Select all that apply
Describe the fix or the content request.
In
docs/guides/specify-observables-pauli.ipynb, the guide expands an observable in the Pauli basis asI think this is missing the Hilbert--Schmidt normalization factor for n-qubit Pauli strings.
For the standard, unnormalized Pauli strings,
so the expansion coefficients should be
Therefore the formula should read
This also matches the example immediately below the formula. For the 2-qubit matrix in the guide:
Tr(O IZ) = -4, so the coefficient is-4 / 4 = -1Tr(O XI) = 2, so the coefficient is2 / 4 = 0.5Tr(O YY) = 4, so the coefficient is4 / 4 = 1These are the coefficients printed by
SparsePauliOp.from_operator(matrix). Without the1/2^nfactor, the formula would give coefficients larger by a factor of 4 in this example.Suggested minimal correction:
Optionally, the explanatory sentence could add:
Happy to open a small PR if this correction looks right.
For new content requests - if the request is accepted, do you want to write the content?
(No answer)