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[, reset, postselect])

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

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

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

value_and_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.

vmap(fn[, in_axes, out_axes, axis_size])

A qjit() compatible vectorizing map.

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.

Functions

compile_from_mlir(ir[, compiler, ...])

Compile a Catalyst function to binary code from the provided MLIR.

filter_static_args(args, static_argnums)

Remove static values from arguments using the provided index list.

get_cmain(fn, *args)

Return a C program that calls a jitted function with the provided arguments.

print(x[, memref])

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

print_compilation_stage(fn, stage)

Print one of the recorded compilation stages for a JIT-compiled function.

promote_arguments(target_signature, args)

Promote arguments to the provided target signature, preserving PyTrees.

Module: catalyst.cuda

This module contains a CudaQDevice and the qjit entry point.

Functions

cudaqjit([fn])

A decorator for compiling PennyLane and JAX programs using CUDA Quantum.

Classes

BaseCudaInstructionSet([shots, wires])

Base instruction set for CUDA-Quantum devices

SoftwareQQPP([shots, wires])

The SoftwareQ Q++ statevector simulator.

NvidiaCuStateVec([shots, wires, multi_gpu])

The NVIDIA CuStateVec GPU simulator (with support for multi-gpu).

NvidiaCuTensorNet([shots, wires, mps])

The NVIDIA CuTensorNet GPU simulator (with support for matrix product state)