AndLadder 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.Canon
Package: Microsoft.Quantum.Standard
Performs a controlled "AND ladder" on a register of target qubits.
operation AndLadder (ccnot : Microsoft.Quantum.Canon.CCNOTop, controls : Qubit[], targets : Qubit[]) : Unit is Adj
Description
This operation applies a transformation described by the following
mapping of the computational basis,
$$
\begin{align}
\ket{x_1, \dots, x_n} \ket{y_1, \dots, y_{n - 1}} \mapsto
\ket{x_1, \dots, x_n} \ket{
y_1 \oplus (x_1 \land x_2), \dots, y_{n - 1} \oplus (x_1 \land x_2 \land \cdots \land x_{n - 1}
},
\end{align}
$$
where $\ket{x_1, \dots, x_n}$ refers to the computational basis
states of controls
, and where $\ket{y_1, \dots, y_{n - 1}}$
refers to the computational basis states of targets
.
Input
ccnot : CCNOTop
The CCNOT gate to use for the construction.
controls : Qubit[]
A register of qubits to be used as controls for the and ladder.
This operation leaves computational basis states of controls
invariant.
The length of controls
must be at least 2, and must
be equal to one plus the length of targets
.
targets : Qubit[]
The length of targets
must be at least 1 and equal to the length
of controls
minus one.
Output : Unit
Remarks
- Used as a part of ApplyMultiControlledC operation and ApplyMultiControlledCA operation.
- For the explanation and circuit diagram see Figure 4.10, Section 4.3 in Nielsen & Chuang.
References
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