qml.transforms¶
This subpackage contains QNode, quantum function, device, and tape transforms.
Transforms¶
Transforms that act on QNodes¶
Thes transforms accept QNodes, and return new transformed functions that compute the desired quantity.

Returns a function to extract the Jacobian matrix of the classical part of a QNode. 

Create a function that draws the given qnode. 

Returns a function that returns the value of the metric tensor of a given QNode. 

Resource information about a quantum circuit. 
Transforms that act on quantum functions¶
These transforms accept quantum functions (Python functions containing quantum operations) that are used to construct QNodes.

Create a function that applies the adjoint (inverse) of the provided operation or template. 
Quantum function transform to remove any operations that are applied next to their (self)inverse. 

Quantum function transform to move commuting gates past control and target qubits of controlled operations. 


Create a method that applies a controlled version of the provided method. 
Quantum function transform to combine rotation gates of the same type that act sequentially. 

Quantum function transform to fuse together groups of singlequbit operations into a general singlequbit unitary operation ( 

Quantum function transform to decomposes all instances of singlequbit 


A transform to make a quantum function nonrecordable or invisible within a QNode or quantum tape context. 

Provides the circuit to apply a controlled version of the \(\mathcal{Q}\) unitary defined in this paper. 

Provides the circuit to perform the quantum Monte Carlo estimation algorithm. 
There are also utility functions and decompositions available that assist with both transforms, and decompositions within the larger PennyLane codebase.

Recover the decomposition of a singlequbit matrix \(U\) in terms of elementary operations. 
Transforms that act on tapes¶
These transforms accept quantum tapes, and return one or more tapes as well as a classical processing function.

Returns a list of measurement optimized tapes, and a classical processing function, for evaluating the expectation value of a provided Hamiltonian. 

Returns a list of tapes, and a classical processing function, for computing the block diagonal metric tensor approximation of an input tape on hardware. 

Splits a tape measuring a Hamiltonian expectation into mutliple tapes of Pauli expectations, and provides a function to recombine the results. 
Decorators and utility functions¶
The following decorators and convenience functions are provided to help build custom QNode, quantum function, and tape transforms:

For registering a tape transform that takes a tape and outputs a single new tape. 

Given a function which defines a tape transform, convert the function into one that applies the tape transform to quantum functions (qfuncs). 

Returns a function that generates the tape from a quantum function without any operation queuing taking place. 
Contents
Downloads