tket
|
A transformation of a circuit that preserves its semantics. More...
#include <Transform.hpp>
Public Types | |
typedef std::function< bool(Circuit &, std::shared_ptr< unit_bimaps_t >)> | Transformation |
A function that takes a circuit and (optionally) a relabelling of units. | |
typedef std::function< bool(Circuit &)> | SimpleTransformation |
A function that takes a circuit and does not rename any units. | |
typedef std::function< unsigned(const Circuit &)> | Metric |
Public Member Functions | |
Transform (const Transformation &trans) | |
Construct from a transformation function. | |
Transform (const SimpleTransformation &trans) | |
Construct from a transformation function that preserves unit IDs. | |
bool | apply (Circuit &circ) const |
Apply the transform to a circuit. | |
Public Attributes | |
Transformation | apply_fn |
The transformation applied. | |
Friends | |
Transform | operator>> (const Transform &lhs, const Transform &rhs) |
Compose two transforms in sequence. | |
A transformation of a circuit that preserves its semantics.
Definition at line 27 of file Transform.hpp.
typedef std::function<unsigned(const Circuit&)> tket::Transform::Metric |
Definition at line 48 of file Transform.hpp.
typedef std::function<bool(Circuit&)> tket::Transform::SimpleTransformation |
A function that takes a circuit and does not rename any units.
The function returns false if no changes are made, otherwise true.
Definition at line 46 of file Transform.hpp.
typedef std::function<bool(Circuit&, std::shared_ptr<unit_bimaps_t>)> tket::Transform::Transformation |
A function that takes a circuit and (optionally) a relabelling of units.
The relabelling, if present, maps the original unit IDs at the beginning and end of the circuit to new names, which may be in a different order at the beginning and end.
The function returns false if no changes are made, otherwise true.
Definition at line 39 of file Transform.hpp.
|
inlineexplicit |
Construct from a transformation function.
Definition at line 54 of file Transform.hpp.
|
inlineexplicit |
Construct from a transformation function that preserves unit IDs.
Definition at line 57 of file Transform.hpp.
|
inline |
Apply the transform to a circuit.
circ | circuit to be transformed |
Definition at line 69 of file Transform.hpp.
Compose two transforms in sequence.
[in] | lhs | first transform |
[in] | rhs | second transform |
Definition at line 23 of file Combinator.cpp.
Transformation tket::Transform::apply_fn |
The transformation applied.
Definition at line 51 of file Transform.hpp.