qp.testing¶
This module contains utilities for testing PennyLane objects, such as operators, decomposition rules, and captured programs.
Operators¶
|
Runs basic validation checks on an |
Decompositions¶
|
Check that an operator can be decomposed with its registered decomposition rules. |
|
Check that a decomposition rule is consistent with the operator it decomposes. |
|
Apply a decomposition rule to an operator and record the result as a tape. |
Program capture¶
|
Convert a plxpr into a tape. |
|
Assert that a jaxpr equation creates an operator of the expected type. |
|
Collect the primitives of every equation in a jaxpr, including the equations of jaxprs nested inside higher-order primitives such as |
|
Find the equations in a jaxpr that use a given primitive. |