-
Say I have some large circuit
Once I have |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
tree = tn.contraction_tree(optimize=existing_path_or_optimizer)
arrays = tn.arrays to get the 'cotengra' form of the contraction. What I would note is that multi-threading or multiprocessing (basically shared memory parallelization) over slices is likely not beneficial. As long as the individual contractions are parallelized, then the unsliced contraction will require less memory and probably be at least as fast, (no slicing overhead, and as long as the contractions are big, the low level i.e. BLAS threading should be very efficient). Slicing for parallelization in general only makes obvious sense for distributed memory, though maybe you have some specific reasons! |
Beta Was this translation helpful? Give feedback.
cotengra
has a few examples like this one: https://github.com/jcmgray/cotengra/blob/main/examples/ex_mpi_executor.py, the last lines of that script are most relevant. Just call:to get the 'cotengra' form of the contraction.
What I would note is that multi-threading or multiprocessing (basically shared memory parallelization) over slices is likely not beneficial. As long as the individual contractions are parallelized, then the unsliced contraction will require less memory and probably be at least as fast, (no slicing overhead, and as long as the contractions are big, the low level i.e. BLAS threading shoul…