Constructing a Workflow (Lattice)#

Lattices are workflows comprised of a sequence of tasks. In your Python code, a lattice is a function with the @lattice decorator.

To construct a lattice, do the following.


Construct one or more electrons with which to compose the lattice:

import covalent as ct

def quadrature(x, y):
    return sqrt(x**2 + y**2)


  1. Write a function that uses one or more electrons to process the data.

  2. Attach the @lattice decorator.

def quad_workflow(x, y):
    return quadrature(x, y)

See Also#

Constructing an Electron

Adding Electrons to Lattices