Skip to main content

QElectron

@covalent.qelectron

#

QElectron decorator to be called upon a Pennylane QNode. Adds multi-backend execution functionality to the original QNode.

Parameters

qnode(Optional[QNode]) - The Pennylane QNode to wrap.

Keyword Arguments

executors

The quantum executor(s) to use for running the QNode. A single executor, list of executors, or a QCluster instance are accepted. If a list of multiple executors is passed, a quantum cluster is initialized from this list automatically and selector is used as the clusters selector. Defaults to a thread-based Simulator.

name

An optional name for the QElectron. Defaults to the circuit function's name.

description

An optional description for the QElectron. Defaults to the circuit function's docstring.

selector

A callable that selects an executor, or one of the strings cyclic or random. The cyclic selector (default) cycle through executors and returns the next executor for each circuit. The random selector chooses an executor from executors at random for each circuit. Any user-defined selector must be callable with two positional arguments, a circuit and a list of executors. A selector must also return exactly one executor.

Raises

ValueError: If any invalid executors are passed.

Returns

A sub-type of QNode that integrates QElectrons.

Return Type

QNodeQE