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 sufficient depth, 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

QuantumTape