CZ 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.Type3.Core

Applies the controlled-Z (CZ) gate to a pair of qubits.

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

Description

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

Input

control : Qubit

Control qubit for the CZ gate.

target : Qubit

Target qubit for the CZ gate.

Output : Unit

Remarks

Equivalent to:

Controlled Z([control], target);