qml.transforms.core.transform_dispatcher.generic_apply_transform¶
- generic_apply_transform(obj, transform, *targs, **tkwargs)[source]¶
- generic_apply_transform(obj, transform, *targs, **tkwargs)
- generic_apply_transform(obj, transform, *targs, **tkwargs)
- generic_apply_transform(obj, transform, *targs, **tkwargs)
- generic_apply_transform(obj, transform, *targs, **tkwargs)
- generic_apply_transform(obj, transform, *targs, **tkwargs)
- generic_apply_transform(obj, transform, *targs, **tkwargs)
Apply an generic transform to a specific type of object. A singledispatch function used by
TransformDipsatcher.generic_apply_transform, but with a different order of arguments to allow is to be used by singledispatch.When called with an object that is not a valid dispatch target (e.g., not a QNode, tape, etc.), this returns a BoundTransform with the supplied args and kwargs. This enables patterns like:
decompose(gate_set=gate_set) + merge_rotations(1e-6)
where transforms are called with just configuration parameters and combined into a CompilePipeline
code/api/pennylane.transforms.core.transform_dispatcher.generic_apply_transform
Download Python script
Download Notebook
View on GitHub