Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed some broken latex in the Measure doc #1825

Merged
merged 2 commits into from
Aug 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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}) =
ScottCarda-MS marked this conversation as resolved.
Show resolved Hide resolved
/// \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
Loading