CControlledCA 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. The modifier CA indicates that the operation is controllable and adjointable.

function CControlledCA<'T> (op : ('T => Unit is Ctl + Adj)) : ((Bool, 'T) => Unit is Ctl + Adj)

Input

op : 'T => Unit is Adj + Ctl

An operation to be conditionally applied.

Output : (Bool,'T) => Unit is Adj + Ctl

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