pdft.circuit.apply_program

Contents

pdft.circuit.apply_program#

pdft.circuit.apply_program(program, tensors, x, *, inverse=False, **arithmetic)[source]#

Apply a program to an image, or to a stack of images.

x has shape (..., 2**m, 2**n); leading axes are batch axes. The working precision follows the image: complex64 for a float32 or complex64 image, complex128 otherwise, and the tensors are cast to it. For the adjoint pass conjugated tensors with inverse=True. arithmetic takes the options of CircuitCode (slices, merge_diagonals).

apply_circuit and contract_circuit are the single-image entry points the bases use; this is the same walk with batch axes and with the precision taken from the image.

Parameters:
Return type:

Array