discopy.quantum.pennylane.to_pennylane(disco_circuit, probabilities=False, backend_config=None, diff_method='best')[source]#

Return a PennyLaneCircuit equivalent to the input DisCoPy circuit. probabilties determines whether the PennyLaneCircuit returns states (as in DisCoPy), or probabilties (to be more compatible with automatic differentiation in PennyLane).

  • disco_circuit (discopy.quantum.circuit.Circuit) – The DisCoPy circuit to convert to PennyLane.

  • probabilities (bool, default: False) – Determines whether the PennyLane circuit outputs states or un-normalized probabilities. Probabilities can be used with more PennyLane backpropagation methods.

  • backend_config (dict, default: None) – A dictionary of PennyLane backend configration options, including the provider (e.g. IBM or Honeywell), the device, the number of shots, etc. See the PennyLane plugin documentation for more details.

  • diff_method (str, default: "best") – The differentiation method to use to obtain gradients for the PennyLane circuit. Some gradient methods are only compatible with simulated circuits. See the PennyLane documentation for more details.


The PennyLane circuit equivalent to the input DisCoPy circuit.

Return type: