pythtb.TBModel.change_nonperiodic_vector#
- TBModel.change_nonperiodic_vector(fin_dir, new_latt_vec=None, to_home=True)[source]#
Change non-periodic lattice vector
Changes one of the non-periodic “lattice vectors”. Non-periodic lattice vectors are those that are not listed as periodic in the
periodic_dirsparameter. The orbital vectors are modified accordingly so that the actual (Cartesian) coordinates of orbitals remain unchanged.Removed in version 2.0.0: Parameter to_home_supress_warning has been removed.
- Parameters:
- fin_dirint
Index of non-periodic lattice vector to change.
Changed in version 2.0.0: Renamed from
np_dirfor clarity and consistency.- new_latt_vecarray_like, optional
The new non-periodic lattice vector. If None (default), the new non-periodic lattice vector is constructed to be orthogonal to all periodic vectors and to have the same length as the original non-periodic vector.
- to_homebool, optional
If
True(default), shift all orbitals to the home cell along periodic directions. Default behavior is to shift orbitals to the home cell.Changed in version 2.0.0: This parameter was previously not working as intended and is now fixed.
See also
- Boron nitride ribbon polarization
For an example.
Notes
This function is especially useful after using function cut_piece to create slabs, rods, or ribbons.
By default, the new non-periodic vector is constructed from the original by removing all components in the periodic space. This ensures that the Berry phases computed in the periodic space correspond to the usual expectations.
For example, after this change, the Berry phase computed for a ribbon depends only on the location of the Wannier center in the extended direction, not on its location in the transverse direction. Alternatively, the new non-periodic vector can be set explicitly via the
new_latt_vecparameter.
Examples
Modify slab model so that non-periodic third vector is perpendicular to the slab
>>> tb.change_nonperiodic_vector(2)