How to construct a lattice#

Lattices are workflows comprised of a series of subtasks. These workflows are defined by functions with the lattice decorator. In the example below, we see how to create a very simple lattice that returns the square of a number.

import covalent as ct
def workflow(x):
    return x ** 2

Lattices can be comprised of several subtasks which are constructed via the electron decorator and added to the workflow as shown in How to add electrons to lattices.