extract_ops_from_tk#

discopy.quantum.pennylane.extract_ops_from_tk(tk_circ, str_map)[source]#

Extract the operations, and corresponding parameters and wires, from a pytket Circuit. Return these as lists to use in constructing PennyLane circuit.

Parameters
  • tk_circ (discopy.quantum.tk.Circuit) – The pytket circuit to extract the operations from.

  • str_map (dict of str: sympy.core.symbol.Symbol) – A mapping from strings to SymPy symbols.

Returns

  • list of qml.operation.Operation – The PennyLane operations extracted from the pytket circuit.

  • list of list of (torch.FloatTensor or – sympy.core.symbol.Symbol) The corresponding parameters of the operations.

  • list of list of int – The corresponding wires of the operations.