CX operation

Namespace: Microsoft.Quantum.Canon

Package: Microsoft.Quantum.Standard

Applies the controlled-X (CX) gate to a pair of qubits.

operation CX (control : Qubit, target : Qubit) : Unit is Adj + Ctl

Description

This operation can be simulated by the unitary matrix $$ \begin{align} \left(\begin{matrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 1 \\ 0 & 0 & 1 & 0 \end{matrix}\right) \end{align}, $$ where rows and columns are organized as in the quantum concepts guide.

Input

control : Qubit

Control qubit for the CX gate.

target : Qubit

Target qubit for the CX gate.

Output : Unit

Remarks

Equivalent to:

Controlled X([control], target);

and to:

CNOT(control, target);