Supercells

void rs_hopping_to_supercell(diverge_model_t *m, int *nr)
[source]

map model to a cubic supercell. requires diverge_model_t.hop, diverge_model_t.n_hop, and diverge_model_t.lattice to be set and modifies those members, as well as diverge_model_t.positions and diverge_model_t.n_orb.

Note

The orbital sign convention can be changed by a call to diverge_supercell_set_sign().

Special case of rs_hopping_to_fractcell() with \(N^j_i = \delta_{ij} n^r_i\).

Note

This function does not touch, “see”, or change the vertex elements. Users are hence advised to set interaction components after mapping the non-interacting parts of the model to a supercell.

Parameters:
  • m (diverge_model_t*) – input/output model

  • nr (int[3]) – description of the cubic supercell \(n^r\). the new lattice vectors are given as \(L_i = n^r_i l_i\), with \(l_i\) the old lattice vectors.

void rs_hopping_to_fractcell(diverge_model_t *m, int *N1, int *N2, int *N3)
[source]

map hopping parameters and model to supercell and allow matrix supercells wrt. to the old lattice vectors. requires diverge_model_t.hop, diverge_model_t.n_hop, and diverge_model_t.lattice to be set and modifies those members, as well as diverge_model_t.positions and diverge_model_t.n_orb.

Note

The orbital sign convention can be changed by a call to diverge_supercell_set_sign().

Note

This function does not touch, “see”, or change the vertex elements. Users are hence advised to set interaction components after mapping the non-interacting parts of the model to a supercell.

The supercell lattice vectors are given as \(L_j = \sum_i N^j_i l_i\). In case N2 == N3 == NULL, make call to rs_hopping_to_supercell() with N1 as nr.

Parameters:
  • m (diverge_model_t*) – input/output model

  • N1 (int[3]) – integer coordinates \(N^1\) for first supercell vector

  • N2 (int[3]) – integer coordinates \(N^2\) for first supercell vector

  • N3 (int[3]) – integer coordinates \(N^3\) for first supercell vector

void rs_hopping_to_fractcell_mat(diverge_model_t *m, int *N123)
[source]

same as rs_hopping_to_fractcell() but with matrix N123[3][3] for supercell, where each row corresponds to one supercell vector.

void diverge_model_to_supercell(diverge_model_t *m, int *nr)
[source]

same as rs_hopping_to_supercell(), but also maps (real space) vertex elements

void diverge_model_to_fractcell(diverge_model_t *m, int *N1, int *N2, int *N3)
[source]

same as rs_hopping_to_fractcell(), but also maps (real space) vertex elements

void diverge_model_to_fractcell_mat(diverge_model_t *m, int *N123)
[source]

same as rs_hopping_to_fractcell_mat(), but also maps (real space) vertex elements

void diverge_supercell_set_sign(double sign)
[source]

to swap the orbital convention in supercells, use this function to set -1 instead of the default, i.e., 1. Not thread-safe. Call before generation.

int diverge_supercell_swap_hop(void)
[source]

to swap the orbital convention only in the hoppings, not in the positions. returns whether original state is used. Also not thread-safe, call before generation.

struct diverge_supercell_configure_t
[source]

structure to set/get configuration of supercell, cf. diverge_supercell_configure().

float sign
[source]

sign (±1, cf. diverge_supercell_set_sign()). If qnanf_isnan(sign) do not change this value and only return current setting.

int swap
[source]

swap orbitals (0|1, cf. diverge_supercell_swap_hop()). If swap==-1 do not change this value and only return current setting.

diverge_supercell_configure_t diverge_supercell_configure(diverge_supercell_configure_t cfg)
[source]

advanced configuration interface that also returns previous state. See diverge_supercell_configure_t for parameters. Comprehensive wrapper around both diverge_supercell_set_sign() and diverge_supercell_swap_hop().