PennyLane Python Frontend

Module: catalyst

This package contains the Catalyst Python interface.

Functions

qjit([fn, autograph, async_qnodes, target, ...])

A just-in-time decorator for PennyLane and JAX programs using Catalyst.

for_loop(lower_bound, upper_bound, step)

A qjit() compatible for-loop decorator for PennyLane/Catalyst.

while_loop(cond_fn)

A qjit() compatible while-loop decorator for PennyLane/Catalyst.

cond(pred)

A qjit() compatible decorator for if-else conditionals in PennyLane/Catalyst.

ctrl(f, control[, control_values, work_wires])

Create a method that applies a controlled version of the provided op.

measure(wires)

A qjit() compatible mid-circuit measurement for PennyLane/Catalyst.

grad(f, *[, method, h, argnum])

A qjit() compatible gradient transformation for PennyLane/Catalyst.

jacobian(f, *[, method, h, argnum])

A qjit() compatible Jacobian transformation for PennyLane/Catalyst.

vjp(f, params, cotangents, *[, method, h, ...])

A qjit() compatible Vector-Jacobian product for PennyLane/Catalyst.

jvp(f, params, tangents, *[, method, h, argnum])

A qjit() compatible Jacobian-vector product for PennyLane/Catalyst.

adjoint(f)

A qjit() compatible adjoint transformer for PennyLane/Catalyst.

mitigate_with_zne(f, *, scale_factors[, deg])

A qjit() compatible error mitigation of an input circuit using zero-noise extrapolation.

autograph_source(fn)

Utility function to retrieve the source code of a function converted by AutoGraph.

Classes

QJIT(fn, compile_options)

Class representing a just-in-time compiled hybrid quantum-classical function.

AutoGraphError

Errors related to Catalyst's AutoGraph module.

CompileError

Error encountered in the compilation phase.

CompileOptions(verbose, logfile, target, ...)

Generic compilation options, for which reasonable default values exist.

Variables

autograph_ignore_fallbacks

Specify whether AutoGraph should avoid raising warnings when conversion fails and control flow instead falls back to being interpreted by Python at compile-time.

autograph_strict_conversion

Specify whether AutoGraph should raise exceptions when conversion fails, rather than falling back to interpreting control flow by Python at compile-time.

Module: catalyst.debug

Catalyst’s debug module contains functions useful for user program debugging, such as runtime printing.

Functions

print(x[, memref])

A qjit() compatible print function for printing values at runtime.