triqs.operators.util.op_struct.set_operator_structure

triqs.operators.util.op_struct.set_operator_structure(spin_names, n_orb, off_diag)[source]

Build the operator block structure for the given spin and orbital names.

The shape of the structure follows the same convention as get_mkind(): one block per spin when off_diag is True, one block per (spin, orbital) pair otherwise.

Parameters:
spin_nameslist of str

Names of the spins, e.g. ['up', 'down'].

n_orbint

Number of orbitals.

off_diagbool

If True, blocks carry orbital off-diagonal elements; otherwise the blocks are pure ('spin_orbital', 0) blocks of size one.

Returns:
list

Block structure of the operators in the form [[block_name, block_size], ...].