CodeTransformations Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Static base class to accumulate the handles to individual syntax tree rewrite steps.
public static class CodeTransformations
type CodeTransformations = class
Public Module CodeTransformations
- Inheritance
-
CodeTransformations
Methods
| GenerateAdjoint(QsScope) |
Given the body of an operation, auto-generates the (content of the) adjoint specialization, under the assumption that operation calls may only ever occur within expression statements, and while-loops cannot occur within operations. |
| GenerateControlled(QsScope) |
Given the body of an operation, auto-generates the (content of the) controlled specialization using the default name for control qubits. Adds the control qubits names to the list of defined variables for the scope and each subscope. |
| InlineConjugations(QsCompilation, QsCompilation, Action<Exception>) |
Eliminates all conjugations from the given compilation by replacing them with the corresponding implementations (i.e. inlining them). The generation of the adjoint for the outer block is subject to the same limitation as any adjoint auto-generation. In particular, it is only guaranteed to be valid if operation calls only occur within expression statements, and throws an InvalidOperationException if the outer block contains while-loops. Any thrown exception is logged using the given onException action and silently ignored if onException is not specified or null. Returns true if the transformation succeeded without throwing an exception, and false otherwise. |
| PreEvaluateAll(QsCompilation, QsCompilation, Action<Exception>) |
Pre-evaluates as much of the classical computations as possible in the given compilation. Any thrown exception is logged using the given onException action and silently ignored if onException is not specified or null. Returns true if the transformation succeeded without throwing an exception, and false otherwise. |