TransformedOperationC 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 TransformedOperationC<'T, 'U> (fn : ('U -> 'T), op : ('T => Unit is Ctl)) : ('U => Unit is Ctl)
Input
fn : 'U -> 'T
A function that transforms the given input into a form expected by the operation.
op : 'T => Unit is Ctl
The operation to be transformed.
Output : 'U => Unit is 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 LittleEndianAsBigEndian function to transform an operation designed for BigEndian user defined type inputs into an operation that accepts inputs of type LittleEndian user defined type:
let leOp = TransformedOperation(LittleEndianAsBigEndian, ApplyXorInPlaceBE);
See Also
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for