triqs.gfs.block_gf.BlockGf.__getitem__

BlockGf.__getitem__(key)[source]

Access a block by string name or integer position.

Parameters:
keystr or int

Block name (e.g. 'up') or zero-based block index (negative integers count from the end).

Returns:
Gf

The requested block (a reference, not a copy).

Raises:
IndexError

If key does not name an existing block, or if the integer is out of range.

TypeError

If key is neither a str nor an int.