How to execute a given lattice#
In order to execute a given lattice, first construct a workflow using the
import covalent as ct @ct.electron def identity(x): return x @ct.electron def square(x): return x * x @ct.lattice def workflow(a): val_1 = identity(x=a) return square(x=val_1)
Ensure that Covalent services have been started before attempting to execute the lattice.
Following that, the workflow can now be submitted using the
dispatch_id = ct.dispatch(workflow)(a=2) print(dispatch_id)
When the workflow is dispatched, a dispatch id is generated. This id is then used to query the status of the task and retrieve the results as discussed in How to query electron execution result and How to query lattice execution result.