public pure function xy_ordered_union(A, B) result(C)
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.
Nodes of different colours represent the following:
Solid arrows point from a procedure to one which it calls. Dashed
arrows point from an interface to procedures which implement that interface.
This could include the module procedures in a generic interface or the
implementation in a submodule of an interface in a parent module.
Nodes of different colours represent the following:
Solid arrows point from a procedure to one which it calls. Dashed
arrows point from an interface to procedures which implement that interface.
This could include the module procedures in a generic interface or the
implementation in a submodule of an interface in a parent module.