Skip to content

Commit

Permalink
copy description from other version of Measure
Browse files Browse the repository at this point in the history
  • Loading branch information
ScottCarda-MS committed Aug 8, 2024
1 parent af847f1 commit 2218e10
Showing 1 changed file with 15 additions and 21 deletions.
36 changes: 15 additions & 21 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,21 +368,12 @@ namespace Microsoft.Quantum.Intrinsic {
/// the -1 eigenvalue is observed.
///
/// # Remarks
/// The output result is given by the distribution:
/// $$
/// \begin{align}
/// \langle\psi|
/// \frac{I + P_0 \otimes \ldots \otimes P_{N-1}}{2}
/// |\psi\rangle,
/// \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 2218e10

Please sign in to comment.