Setting high-dimensional numpy array at specific indices equal to 1D array
I have a collection of symmetric tensors full_tensors
, and I have calculated all distinct elements in a 2D array tensor_reduced
. I want to calculate the full full_tensors
from the distinct elements tensor_reduced
. I have a list all_permutations_list
that contains tuples over all indices that should have the same value (e.g. all_permutations_list[1]=((0, 0, 1, 0, 0, 0), (0, 1, 0, 0, 0, 0), (1, 0, 0, 0, 0, 0), (0, 0, 0, 1, 0, 0), (0, 0, 0, 0, 1, 0), (0, 0, 0, 0, 0, 1)
) and we have that tensor_reduced.shape[1]
is the same as len(all_permutations_list)
.