AssertOperationsEqualInPlaceAssertOperationsEqualInPlace operation
Espaço de nome: Microsoft.Quantum.DiagnosticsNamespace: Microsoft.Quantum.Diagnostics
Pacote: Microsoft.Quantum.QSharp.CorePackage: Microsoft.Quantum.QSharp.Core
Tendo em conta duas operações, afirma que agem de forma idêntica para todos os estados de entrada.Given two operations, asserts that they act identically for all input states.
Esta afirmação é implementada verificando a ação das operações em todos os estados do formulário $V_0 \otimes ... \otimes V_{n-1}$, onde $V_k$ é um dos estados $\ket {0} $,$ket {1} $, $\ket{+}$ e $\ket{i}$ (+1 eigenstate do operador Pauli Y).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).
Esta afirmação utiliza $n$ qubits e requer múltiplas chamadas das operações a serem comparadas.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
EntradaInput
nQubits : IntnQubits : Int
O número de qubits $n$ que as operações givenU
e expectedU
operam.The number of qubits $n$ that the operations givenU
and expectedU
operate on.
givenU : Qubit[] = Unidade>givenU : Qubit[] => Unit
Operação a $n dólares qubits a serem verificados.Operation on $n$ qubits to be checked.
expectedU : Qubit[] = > Unit é AdjexpectedU : Qubit[] => Unit is Adj
Operação de referência em $n$ qubits que givenU
devem ser comparados.Reference operation on $n$ qubits that givenU
is to be compared against.
Saída : UnidadeOutput : Unit
ReferênciasReferences
A base dos estados $\ket {0} $, $\ket {1} $, $\ket{+}$ e $\ket{i}$ é a base Chuang-Nielsen, descrita em I. L. Chuang, M. A. Nielsen.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 .