transpose_list_list

  • full name: tenpy.tools.misc.transpose_list_list

  • parent module: tenpy.tools.misc

  • type: function

tenpy.tools.misc.transpose_list_list(D, pad=None)[source]

Returns a list of lists T, such that T[i][j] = D[j][i].

Parameters:
  • D (list of list) – to be transposed

  • pad – Used to fill missing places, if D is not rectangular.

Returns:

T – transposed, rectangular version of D. constructed such that T[i][j] = D[j][i] if i < len(D[j]) else pad

Return type:

list of lists