qml.workflow

Warning

Unless you are a PennyLane or plugin developer, you likely do not need to use these functions directly.

See the main interfaces page for more details on available interfaces.

Modules

This module contains the core objects for managing a PennyLane workflow.

Execution functions and utilities

execute(tapes, device[, gradient_fn, …])

New function to execute a batch of tapes on a device in an autodifferentiable-compatible manner.

cache_execute(fn, cache[, pass_kwargs, …])

Decorator that adds caching to a function that executes multiple tapes on a device.

set_shots(device, shots)

Context manager to temporarily change the shots of a device.

construct_batch(qnode[, level])

Construct the batch of tapes and post processing for a designated stage in the transform program.

get_transform_program(qnode[, level])

Extract a transform program at a designated level.

Supported interfaces

autograd

This module contains functions for adding the Autograd interface to a PennyLane Device class.

jax

This module contains functions for binding JVP’s or VJP’s to the JAX interface.

jax_jit

This module contains functions for binding JVPs or VJPs to JAX when using JIT.

tensorflow

This module contains functions for adding the TensorFlow interface to a PennyLane Device class.

tensorflow_autograph

This module contains functions for adding the TensorFlow Autograph interface to a PennyLane Device class.

torch

This module contains functions for adding the PyTorch interface to a PennyLane Device class.

Jacobian Product Calculation

JacobianProductCalculator()

Provides methods for calculating the JVP/VJP between the Jacobians of tapes and tangents/cotangents.

TransformJacobianProducts(inner_execute, …)

Compute VJPs, JVPs and Jacobians via a gradient transform TransformDispatcher.

DeviceDerivatives(device[, …])

Calculate jacobian products via a device provided jacobian.

DeviceJacobianProducts(device, execution_config)

Compute jacobian products using the native device methods.

LightningVJPs(device[, gradient_kwargs])

Calculates VJPs natively using lightning.qubit.