Defining real space 2D coordinates for honeycomb lattice sites
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
integer, | private, | parameter | :: | N | = | 6 | |
real(kind=8), | private, | parameter | :: | PI | = | 4d0*atan(1d0) |
Pretty print of xy coordinates in static arrays
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(xy), | intent(in) | :: | S | |||
integer, | intent(in), | optional | :: | unit |
default = $stdout |
|
logical, | intent(in), | optional | :: | quiet |
default = .false. |
Pretty print of xy coordinates in dynamic arrays
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(xy_lattice), | intent(in) | :: | S | |||
integer, | intent(in), | optional | :: | unit |
default = $stdout |
|
logical, | intent(in), | optional | :: | quiet |
default = .false. |
Base type for 2D points
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
real(kind=8), | public | :: | x | ||||
real(kind=8), | public | :: | y |
generic, public :: operator(==) => eq_xy | |
generic, public :: operator(/=) => neq_xy | |
procedure, private :: eq_xy | |
procedure, private :: neq_xy |
A 2D point extension for inequivalent sites
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
real(kind=8), | public | :: | x | ||||
real(kind=8), | public | :: | y | ||||
character(len=1), | public | :: | label |
A or B (sublattice) |
|||
integer, | public | :: | key | = | 0 |
for lattice lookup |
generic, public :: operator(==) => eq_xy | |
generic, public :: operator(/=) => neq_xy |
Wrapper type for storing dynamically sized collections of lattice sites
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
type(xy_site), | public, | allocatable | :: | site(:) | |||
integer, | public | :: | size |
generic, public :: operator(==) => eq_lattice | |
generic, public :: operator(/=) => neq_lattice | |
procedure, public :: push_back | |
procedure, private :: eq_lattice | |
procedure, private :: neq_lattice |
Convert hex coordinates to real 2D lattice sites [returning the xy coordinates for the unique unit-cell, sites "A" and "B": this of course does not account for border effects, so would be suitable only for simple, periodized, systems, which for now are out of scope.] Actual real-space layout has to be specified by passing a (scalar) unit_cell object.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(unit_cell), | intent(in) | :: | layout | |||
type(hex), | intent(in) | :: | H | |||
character(len=1), | intent(in) | :: | label |
A or B |
Convert hex coordinates to real 2D space [returning the xy coordinates for the hexagon corners, as appropriatiely wrapped in the "xy_lattice" type] Actual real-space layout has to be specified by passing a (scalar) unit_cell object.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(unit_cell), | intent(in) | :: | layout | |||
type(hex), | intent(in) | :: | H |
Convert hex coordinates to real 2D space [returning the xy coordinates of the hexagon center] Actual real-space layout has to be specified by passing a (scalar) unit_cell object.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(unit_cell), | intent(in) | :: | layout | |||
type(hex), | intent(in) | :: | H |
Generate a type(xy_lattice) object from any given hex array, provided a suitable layout (unit-cell)
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(unit_cell), | intent(in) | :: | layout | |||
type(hex), | intent(in) | :: | hexagons(:) |
Extract sublattice, given a lattice and a label ("A" or "B")
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(xy_lattice), | intent(in) | :: | lattice | |||
character(len=1), | intent(in) | :: | label |
A or B |
An ordered-keys set union for xy_lattices. It compares the lattice sites, looking at their x and y coordinates only: equal x,y entries are inserted in C just once, so to make it a set. A and B must be sets too. The sublattice labels are preserved in the process, assuming that two sites with the same x,y pertain to the same sublattice. For A the keys are assumed to be 1:size(A), and preserved as such (with an assertion). The keys of B are instead discarded, so to be replaced by size(A):size(C), which thus amounts to have result C uniquely indexed as 1, 2, ... , size(A) + size(B). This allows building consistently indexed matrices to act on the lattice array, such as real-space tight-binding hamiltonians. The keys would then be used to index other real space quantities, such as LDOS, Chern marker, local magnetization, and so on.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(xy_lattice), | intent(in) | :: | A | |||
type(xy_lattice), | intent(in) | :: | B |
polymorphic equality overload for xy_lattice type
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(xy_lattice), | intent(in) | :: | A | |||
class(xy_lattice), | intent(in) | :: | B |
polymorphic inequality overload for xy_lattice type
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(xy_lattice), | intent(in) | :: | A | |||
class(xy_lattice), | intent(in) | :: | B |
Poor man implementation of a dynamic array, a là std::vector (but without preallocation and smart doubling...)
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(xy_lattice), | intent(inout) | :: | vec | |||
type(xy_site), | intent(in) | :: | val |
Pretty print of xy coordinates in static arrays
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(xy), | intent(in) | :: | S | |||
integer, | intent(in), | optional | :: | unit |
default = $stdout |
|
logical, | intent(in), | optional | :: | quiet |
default = .false. |
Pretty print of xy coordinates in dynamic arrays
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(xy_lattice), | intent(in) | :: | S | |||
integer, | intent(in), | optional | :: | unit |
default = $stdout |
|
logical, | intent(in), | optional | :: | quiet |
default = .false. |