CControlled function

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

Given an operation op, returns a new operation which applies the op if a classical control bit is true. If false, nothing happens.

function CControlled<'T> (op : ('T => Unit)) : ((Bool, 'T) => Unit)

Input

op : 'T => Unit

An operation to be conditionally applied.

Output : (Bool,'T) => Unit

A new operation which is op if the classical control bit is true.

Type Parameters

'T

The input type of the operation to be conditionally applied.

See Also