Skip to content

Commit

Permalink
Fixed some broken latex in the Measure doc (#1825)
Browse files Browse the repository at this point in the history
What the Remarks section looked like before:

![image](https://github.com/user-attachments/assets/8db833ff-5d26-479b-becb-5d59024a69db)

What the Remarks section looks like now:

![image](https://github.com/user-attachments/assets/6e00cb63-bcf2-43fe-a321-3301166111ca)

Fixes #1429
  • Loading branch information
ScottCarda-MS authored Aug 12, 2024
1 parent 7ae7a6f commit 2062d8f
Showing 1 changed file with 15 additions and 26 deletions.
41 changes: 15 additions & 26 deletions library/std/src/intrinsic.qs
Original file line number Diff line number Diff line change
Expand Up @@ -304,14 +304,6 @@ namespace Microsoft.Quantum.Intrinsic {
/// Performs a joint measurement of one or more qubits in the
/// specified Pauli bases.
///
/// # Description
/// The probability of getting `Zero` is
/// $\bra{\psi} \frac{I + P_0 \otimes \ldots \otimes P_{N-1}}{2} \ket{\psi}$
/// where $P_i$ is the $i$-th element of `bases`, and where
/// $N$ is the `Length(bases)`.
/// That is, measurement returns a `Result` $d$ such that the eigenvalue of the
/// observed measurement effect is $(-1)^d$.
///
/// If the basis array and qubit array are different lengths, then the
/// operation will fail.
///
Expand All @@ -325,6 +317,14 @@ namespace Microsoft.Quantum.Intrinsic {
/// # Output
/// `Zero` if the +1 eigenvalue is observed, and `One` if
/// the -1 eigenvalue is observed.
///
/// # Remarks
/// The probability of getting `Zero` is
/// $\bra{\psi} \frac{I + P_0 \otimes \ldots \otimes P_{N-1}}{2} \ket{\psi}$
/// where $P_i$ is the $i$-th element of `bases`, and where
/// $N$ is the `Length(bases)`.
/// That is, measurement returns a `Result` $d$ such that the eigenvalue of the
/// observed measurement effect is $(-1)^d$.
@Config(QubitReset)
operation Measure(bases : Pauli[], qubits : Qubit[]) : Result {
if Length(bases) != Length(qubits) {
Expand Down Expand Up @@ -353,6 +353,9 @@ namespace Microsoft.Quantum.Intrinsic {
/// Performs a joint measurement of one or more qubits in the
/// specified Pauli bases.
///
/// If the basis array and qubit array are different lengths, then the
/// operation will fail.
///
/// # Input
/// ## bases
/// Array of single-qubit Pauli values indicating the tensor product
Expand All @@ -365,26 +368,12 @@ namespace Microsoft.Quantum.Intrinsic {
/// the -1 eigenvalue is observed.
///
/// # Remarks
/// The output result is given by the distribution:
/// $$
/// \begin{align}
/// \Pr(\texttt{Zero} | \ket{\psi}) =
/// \frac12 \braket{
/// \psi \mid|
/// \left(
/// \boldone + P_0 \otimes P_1 \otimes \cdots \otimes P_{N-1}
/// \right) \mid|
/// \psi
/// },
/// \end{align}
/// $$
/// where $P_i$ is the $i$th element of `bases`, and where
/// $N = \texttt{Length}(\texttt{bases})$.
/// The probability of getting `Zero` is
/// $\bra{\psi} \frac{I + P_0 \otimes \ldots \otimes P_{N-1}}{2} \ket{\psi}$
/// where $P_i$ is the $i$-th element of `bases`, and where
/// $N$ is the `Length(bases)`.
/// That is, measurement returns a `Result` $d$ such that the eigenvalue of the
/// observed measurement effect is $(-1)^d$.
///
/// If the basis array and qubit array are different lengths, then the
/// operation will fail.
@Config(not QubitReset)
operation Measure(bases : Pauli[], qubits : Qubit[]) : Result {
if Length(bases) != Length(qubits) {
Expand Down

0 comments on commit 2062d8f

Please sign in to comment.