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