qml.transforms.expand_nonunitary_gen¶
- expand_nonunitary_gen(tape, depth=10, **kwargs)¶
Expand out a tape so that all its parametrized operations have a unitary generator.
This is achieved by decomposing all parametrized operations that either do not have a generator or have a non-unitary generator, up to maximum depth
depth
. For a sufficientdepth
, it should always be possible to obtain a tape containing only unitarily generated operations.- Parameters
tape (QuantumTape) – the input tape to expand
depth (int) – the maximum expansion depth
**kwargs – additional keyword arguments are ignored
- Returns
the expanded tape
- Return type
code/api/pennylane.transforms.expand_nonunitary_gen
Download Python script
Download Notebook
View on GitHub