kosmos.circuit_runner.pennylane_runner

Classes

class PennyLaneRunner(device_name: Literal['default.qubit', 'lightning.qubit'] = 'lightning.qubit')

Bases: kosmos.circuit_runner.circuit_runner.CircuitRunner

Runner for PennyLane.

Initialize the PennyLane runner.

Parameters:

device_name (Literal["default.qubit", "lightning.qubit"]) – Name of the PennyLane device. Defaults to “lightning.qubit”.


Properties

property framework

The framework used by the circuit runner.


Methods

configure_qnode(num_wires: int, circuit: collections.abc.Callable[Ellipsis, Any]) None

Configure the QNode for a given circuit.

Parameters:
  • num_wires (int) – Number of wires (qubits) in the circuit.

  • circuit (Callable[..., Any]) – Callable defining the quantum circuit.

execute(*args: Any, **kwargs: Any) Any

Execute the configured QNode with the given arguments.

Parameters:
  • *args (Any) – Positional arguments passed to the underlying QNode.

  • **kwargs (Any) – Keyword arguments passed to the underlying QNode.

Returns:

The result returned by the QNode.

Return type:

Any