qml.transforms.expand_trainable_multipar

expand_trainable_multipar(tape, depth=10, **kwargs)

Expand out a tape so that all its trainable operations have a single parameter.

This is achieved by decomposing all trainable operations that do not have a generator, up to maximum depth depth. For a sufficient depth, it should always be possible to obtain a tape containing only single-parameter 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