triqs.operators.util.U_matrix.subarray

triqs.operators.util.U_matrix.subarray(a, idxlist, n=None)[source]

Extract a subarray from a matrix-like object.

Parameters:
  • a (matrix or array)

  • idxlist (list of tuples) – Columns that need to be extracted for each dimension.

Returns:

subarray

Return type:

matrix or array

Examples

idxlist = [(0),(2,3),(0,1,2,3)] gives

  • column 0 for 1st dim,

  • columns 2 and 3 for 2nd dim,

  • columns 0, 1, 2 and 3 for 3rd dim.