qml.devices.preprocess.validate_multiprocessing_workers

validate_multiprocessing_workers(tape, max_workers, device)[source]

Validates the number of workers for multiprocessing.

Checks that the CPU is not oversubscribed and warns user if it is, making suggestions for the number of workers and/or the number of threads per worker.

Parameters:
  • tape (QuantumTape or .QNode or Callable) – a quantum circuit.

  • max_workers (int) – Maximal number of multiprocessing workers

  • device (pennylane.devices.Device) – The device to be checked.

Returns:

The unaltered input circuit. The output type is explained in qml.transform.

Return type:

qnode (pennylane.QNode) or quantum function (callable) or tuple[List[.QuantumTape], function]

Contents

Using PennyLane

Release news

Development

API

Internals