qml.pytrees.leaf¶
-
leaf
= PyTreeStructure()¶ A pytree data structure, holding the type, metadata, and child pytree structures.
>>> op = qml.adjoint(qml.RX(0.1, 0)) >>> data, structure = qml.pytrees.flatten(op) >>> structure PyTree(AdjointOperation, (), [PyTree(RX, (Wires([0]), ()), [Leaf])])
A leaf is defined as just a
PyTreeStructure
withtype_=None
.
code/api/pennylane.pytrees.leaf
Download Python script
Download Notebook
View on GitHub