code: def get_voigt_dict(rank):
          
          vdict = {}
          for ind in itertools.product(*[range(3)] * rank):
              v_ind = ind[:rank % 2]
              for j in range(rank // 2):
                  pos = rank % 2 + 2 * j
                  v_ind += (reverse_voigt_map[ind[pos:pos + 2]],)
              vdict[ind] = v_ind
          return vdict
docs: Returns a dictionary that maps indices in the tensor to those
          in a voigt representation based on input rank
  
          Args:
              rank (int): Tensor rank to generate the voigt map