pythtb.WFArray.roll_states_with_pbc#

WFArray.roll_states_with_pbc(shift_vec, flatten_spin_axis=True, strip_boundary=False)[source]#

Roll states with periodic boundary conditions.

This method rolls the wavefunction states according to the given shift vector, applying the appropriate boundary phases to axes that have periodic boundary conditions.

Parameters:
shift_veclist[int]

List of integer shifts for each axis.

flatten_spin_axisbool, optional

Whether to flatten the spin axis into the orbital axis, by default True.

strip_boundarybool, optional

Whether to strip the boundary after rolling, by default False. This will remove the boundary states along axes with non-periodic boundary conditions.

Returns:
np.ndarray

The rolled wavefunction states with applied boundary conditions.

Examples

>>> rolled_wfa = wfa.roll_states_with_pbc([1, 0])
>>> np.allclose(rolled_wfa[4, 3], rolled_wfa[3, 3])
True