Skip to content

Latest commit

 

History

History
81 lines (52 loc) · 2.34 KB

microsoft.quantum.canon.transformedoperationca.md

File metadata and controls

81 lines (52 loc) · 2.34 KB
uid title ms.date ms.topic qsharp.kind qsharp.namespace qsharp.name qsharp.summary
Microsoft.Quantum.Canon.TransformedOperationCA
TransformedOperationCA function
7/28/2023 12:00:00 AM
managed-reference
function
Microsoft.Quantum.Canon
TransformedOperationCA
Given a function and an operation, returns a new operation whose input is transformed by the given function.

TransformedOperationCA 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 a function and an operation, returns a new operation whose input is transformed by the given function.

function TransformedOperationCA<'T, 'U> (fn : ('U -> 'T), op : ('T => Unit is Adj + Ctl)) : ('U => Unit is Adj + Ctl)

Input

fn : 'U -> 'T

A function that transforms the given input into a form expected by the operation.

op : 'T => Unit is Adj + Ctl

The operation to be transformed.

Output : 'U => Unit is Adj + Ctl

A new operation that calls fn with its input, then passes the resulting output to op.

Type Parameters

'T

'U

Example

The following call uses @"Microsoft.Quantum.Arithmetic.LittleEndianAsBigEndian" to transform an operation designed for @"Microsoft.Quantum.Arithmetic.BigEndian" inputs into an operation that accepts inputs of type @"Microsoft.Quantum.Arithmetic.LittleEndian":

let leOp = TransformedOperation(LittleEndianAsBigEndian, ApplyXorInPlaceBE);

See Also

  • Microsoft.Quantum.Canon.TransformedOperation
  • Microsoft.Quantum.Canon.TransformedOperationA
  • Microsoft.Quantum.Canon.TransformedOperationCA
  • Microsoft.Quantum.Canon.ApplyWithInputTransformation
  • Microsoft.Quantum.Canon.Composed