Skip to content

Question about mixing classes and lattices #1586

Discussion options

You must be logged in to vote

Hi @arosen93 !

Great question! I'll address your concerns in two parts: first, I'll explain why your current implementation isn't working and how to fix it; second, I'll suggest a better pattern for your use case.

Why isnt this working and how to solve it ?

The issue arises because the default Dask executor is used for both add and mult methods, as they are already defined with their respective executors when you define the class functions. When you change the executor2 value during class instantiation, the executor2 value is updated, but the parameter for the electron's executor isn't replaced in-place. The following code demonstrates this:

from covalent._shared_files.context_managers im…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@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