xy_neighbors Module

Defining all neighbors shells for given xy lattices


Uses

  • module~~xy_neighbors~~UsesGraph module~xy_neighbors xy_neighbors module~hex_layout hex_layout module~xy_neighbors->module~hex_layout module~xy_coordinates xy_coordinates module~xy_neighbors->module~xy_coordinates stdlib_sorting stdlib_sorting module~xy_neighbors->stdlib_sorting module~xy_coordinates->module~hex_layout assert_m assert_m module~xy_coordinates->assert_m module~hex_coordinates hex_coordinates module~xy_coordinates->module~hex_coordinates module~hex_coordinates->assert_m

Used by

  • module~~xy_neighbors~~UsedByGraph module~xy_neighbors xy_neighbors module~honeyplots honeyplots module~honeyplots->module~xy_neighbors module~honeytools honeytools module~honeytools->module~xy_neighbors

Variables

Type Visibility Attributes Name Initial
integer, private, parameter :: N = 6
real(kind=8), private, parameter :: PI = 4d0*atan(1d0)

Functions

public pure function xy_nn_hop(layout, S, i) result(Ni)

Return the nearest neighbor of a lattice site, by hopping in the i-th direction. You can feed any i ∈ ℤ, but you can get only 3 inequivalent neighbors, depending on the label of the given site: "A" and "B" activate two different suitable sets of hopping directions. A lattice layout is required to build the concrete hopping vectors.

Arguments

Type IntentOptional Attributes Name
type(unit_cell), intent(in) :: layout
type(xy_site), intent(in) :: S
integer, intent(in) :: i

Return Value type(xy_site)

public pure function xy_nnn_hop(layout, S, i) result(Ni)

Return the i-th next-nearest neighbor of a lattice site, by taking two xy_nn_hops in the suitable direction. You can feed any i ∈ ℤ, but you can get only 6 inequivalent neighbors, depending on the label of the given site: "A" and "B" activate two different suitable sets of NN hops, A lattice layout is required to build the concrete hoppings.

Arguments

Type IntentOptional Attributes Name
type(unit_cell), intent(in) :: layout
type(xy_site), intent(in) :: S
integer, intent(in) :: i

Return Value type(xy_site)

private pure function ith_A_offset(layout, i) result(offset)

Compute the offset vector connecting a site with label "A", to its i-th neighbor, returning a (scalar) xy coordinate. It takes any i ∈ ℤ, but there will only be 3 inequivalent output vectors, pointing to the three nearest neighbors.

Arguments

Type IntentOptional Attributes Name
type(unit_cell), intent(in) :: layout
integer, intent(in) :: i

Return Value type(xy)

private pure function ith_B_offset(layout, i) result(offset)

Compute the offset vector connecting a site with label "B", to its i-th neighbor, returning a (scalar) xy coordinate. It takes any i ∈ ℤ, but there will only be 3 inequivalent output vectors, pointing to the three nearest neighbors.

Arguments

Type IntentOptional Attributes Name
type(unit_cell), intent(in) :: layout
integer, intent(in) :: i

Return Value type(xy)


Subroutines

public pure subroutine xy_nearest_neighbors(lattice, nn_mask)

Build a mask for the nearest neighbors of a given lattice. It is a NxN matrix, with N the number of sites in the lattice, stocking .true. values only for the pairs of sites linked by a "NN-bond". It calls internally xy_shells, for all inter-site distances, so if you need more than NNs consider calling xy_shells directly. Note that we provide a similar subroutine for next-nearest-neighbors, which optionally gives also the NNs, so if just two shells are needed you should call that.

Read more…

Arguments

Type IntentOptional Attributes Name
type(xy_lattice), intent(in) :: lattice
logical, intent(out), allocatable :: nn_mask(:,:)

public pure subroutine xy_next_nearest_neighbors(lattice, nnn_mask, nn_mask)

Build a mask for the next-nearest neighbors of a given lattice. It is a NxN matrix, with N the number of sites in the lattice, storing .true. values only for the pairs of sites linked by a "NNN-bond". Optionally builds a nearest-neighbors mask, too. It calls internally xy_shells, for all inter-site distances, so if you need more than NNNs consider calling xy_shells directly. Note that we provide a similar subroutine for nearest-neighbors only, so if you just need NNs consider calling it.

Read more…

Arguments

Type IntentOptional Attributes Name
type(xy_lattice), intent(in) :: lattice
logical, intent(out), allocatable :: nnn_mask(:,:)
logical, intent(out), optional, allocatable :: nn_mask(:,:)

public pure subroutine xy_shells(lattice, shell_table, distance_set)

Build a /ordered/ set of all inter-atomic distances in a given xy_lattice and a table storing distances among all sites. Searching this matrix for the n-th set entry gives a mask of all pairs of atomic sites that are n-th order neigbors. E.g. shell_table == distance_set(1) would provide a mask for nearest neighbors, from which we can build the tight-binding hopping term of the corresponding lattice hamiltonian.

Arguments

Type IntentOptional Attributes Name
type(xy_lattice), intent(in) :: lattice
real(kind=8), intent(out), allocatable :: shell_table(:,:)
real(kind=8), intent(out), allocatable :: distance_set(:)