AssertOperationsEqualInPlace operation
Warning
This documentation refers to the Classic QDK, which has been replaced by the Modern QDK.
Please see https://aka.ms/qdk.api for the API documentation for the Modern QDK.
Namespace: Microsoft.Quantum.Diagnostics
Package: Microsoft.Quantum.Type2.Core
Given two operations, asserts that they act identically for all input states.
This assertion is implemented by checking the action of the operations on all states of the form $V_0 \otimes ... \otimes V_{n-1}$, where $V_k$ is one of the states $\ket{0}$, $\ket{1}$, $\ket{+}$ and $\ket{i}$ (+1 eigenstate of Pauli Y operator).
This assertion uses $n$ qubits and requires multiple calls of the operations being compared.
operation AssertOperationsEqualInPlace (nQubits : Int, givenU : (Qubit[] => Unit), expectedU : (Qubit[] => Unit is Adj)) : Unit
Input
nQubits : Int
The number of qubits $n$ that the operations givenU
and expectedU
operate on.
givenU : Qubit[] => Unit
Operation on $n$ qubits to be checked.
expectedU : Qubit[] => Unit is Adj
Reference operation on $n$ qubits that givenU
is to be compared against.
Output : Unit
References
The basis of states $\ket{0}$, $\ket{1}$, $\ket{+}$ and $\ket{i}$ is the Chuang-Nielsen basis, described in I. L. Chuang, M. A. Nielsen .
See Also
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for