pennylane_calculquebec.utility.optimization.expand

Contents

pennylane_calculquebec.utility.optimization.expand#

pennylane_calculquebec.utility.optimization.expand(tape: QuantumTape, decomps: dict[str, Callable[[Wires], list[Operation]]], iterations=1) QuantumTape#

Decomposes a quantum tape’s operations into mapped sets of given operations

Parameters:
  • tape (QuantumTape) – the tape you want to decompose

  • decomps (dict[str, Callable[[Wires], list[Operation]]]) – a gate name, and the resulting operations

  • iterations (int, optional) – the number of time it should be ran. Defaults to 1.

Returns:

the quantum tape that results from the decomposition

Return type:

QuantumTape