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
keydoes not name an existing block, or if the integer is out of range.- TypeError
If
keyis neither astrnor anint.