Skip to content

Why is my (sub)lattice generating extra list indexing tasks? #1635

Discussion options

You must be logged in to vote

Hi @arosen93! You're doing a great job diving into dynamic workflows and sublattices. You're definitely on the right track, and I'm here to help clarify things for you.

The issue you're encountering is related to the iterable vals inside the sub_lattice function. When constructing lattices (including sublattices), for loops or while loops can produce random graphs if the iterable is not determined and is a future. In your case, vals in sub_lattice will not be known even when sub_lattice is compiled for the subgraph. Only val (the input of the sublattice) is known during its construction. To reproduce your error without using sublattice, you can try the following example:

import covalent as 

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@Andrew-S-Rosen
Comment options

@santoshkumarradha
Comment options

@Andrew-S-Rosen
Comment options

@Andrew-S-Rosen
Comment options

Answer selected by Andrew-S-Rosen
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants