dgamore.symmetrize_new#
Standalone preprocessing script (a second installed console script) that converts a w2dynamics worm-sampled two-particle vertex file into the symmetrized density/magnetic two-particle Green’s function file consumed by the main DGA routine. It provides the band/spin compound-index bookkeeping for the worm components, extracts the required spin combinations, builds \(G^{(2)}_{\mathrm{dens}}\) and \(G^{(2)}_{\mathrm{magn}}\) assuming SU(2) symmetry, and writes them to an HDF5 output file. Running the module interactively prompts for the input and output filenames.
Functions
|
Readline tab-completion callback for filesystem paths (used for the interactive filename prompts). |
|
Encodes per-leg orbital indices into a compound (orbital-only) index. |
|
Encodes per-leg band and spin indices into a compound index for an |
|
Encodes per-leg band and spin indices into a compound index for a two-legged object (see |
|
Encodes per-leg band and spin indices into a compound index for a four-legged object (see |
|
Extracts the two-particle Green's function components from the vertex file for given indices and group string. |
|
Determines the bosonic and fermionic frequency counts from the shape of the first stored vertex element. |
|
Lists the worm component indices for the given two-leg orbital combinations (both equal-spin sectors). |
|
Lists the worm component indices for the given four-leg orbital combinations, over the spin sectors relevant under SU(2) symmetry. |
|
Lists the worm component indices over all two-orbital combinations, keeping only the spin combinations relevant for the density and magnetic channels under SU(2) symmetry. |
|
Lists the worm component indices over all four-orbital combinations, keeping only the spin combinations relevant for the density and magnetic channels under SU(2) symmetry. |
|
Lists the worm component indices over the orbital-diagonal two-orbital combinations only, keeping the spin combinations relevant for the density and magnetic channels under SU(2) symmetry. |
|
Lists the worm component indices over the four-orbital combinations excluding the |
|
Decodes a compound (orbital-only) index into its per-leg orbital indices. |
|
Decodes a compound index into its per-leg band and spin components for an |
|
Decodes a compound index into band and spin components for a two-legged object (see |
|
Decodes a compound index into band and spin components for a four-legged object (see |
|
Writes the given two-particle Green's functions to the (module-level) output HDF5 file in the per-bosonic- frequency, per-orbital-component layout expected by the DGA input reader. |
- dgamore.symmetrize_new.complete(text, state)[source]#
Readline tab-completion callback for filesystem paths (used for the interactive filename prompts).
- Parameters:
text – The current text being completed.
state – The index of the match requested by readline.
- Returns:
The
state-th matching path (directories suffixed with/), or None if there are no more matches.
- dgamore.symmetrize_new.component2index_band(num_bands: int, n_dims: int, b: list) int[source]#
Encodes per-leg orbital indices into a compound (orbital-only) index.
- dgamore.symmetrize_new.component2index_general(num_bands: int, n_dims: int, bands: list, spins: list) int[source]#
Encodes per-leg band and spin indices into a compound index for an
n_dims-legged object.- Parameters:
- Returns:
The 1-based compound index.
- Raises:
AssertionError – If
num_bandsis not a positive integer.- Return type:
- dgamore.symmetrize_new.component2index_general_2dims(num_bands: int, bands: list, spins: list) int[source]#
Encodes per-leg band and spin indices into a compound index for a two-legged object (see
component2index_general()).
- dgamore.symmetrize_new.component2index_general_4dims(num_bands: int, bands: list, spins: list) int[source]#
Encodes per-leg band and spin indices into a compound index for a four-legged object (see
component2index_general()).
- dgamore.symmetrize_new.extract_g2_general(group_string: str, indices: list, file: File, niw: int, niv: int) tuple[source]#
Extracts the two-particle Green’s function components from the vertex file for given indices and group string. Returns the components \(G2_{\uparrow\uparrow\uparrow\uparrow}, G2_{\downarrow\downarrow\downarrow\downarrow}\), \(G2_{\downarrow\downarrow\uparrow\uparrow}, G2_{\uparrow\uparrow\downarrow\downarrow}\), \(G2_{\uparrow\downarrow\downarrow\uparrow}\) and \(G2_{\downarrow\uparrow\uparrow\downarrow}\).
- Parameters:
- Returns:
The six spin-component arrays
(g2_uuuu, g2_dddd, g2_dduu, g2_uudd, g2_uddu, g2_duud).- Return type:
- dgamore.symmetrize_new.get_niw_niv(vertex_file, g4iw_groupstring, indices)[source]#
Determines the bosonic and fermionic frequency counts from the shape of the first stored vertex element.
- Parameters:
vertex_file – The open input vertex
h5py.File.g4iw_groupstring – The HDF5 group path of the worm-sampled vertex.
indices – The component indices (the first is used to read the shape).
- Returns:
The tuple
(niw, niv)of positive bosonic and fermionic frequency counts.- Raises:
AssertionError – If the stored shape has an odd fermionic or even bosonic frequency count.
- dgamore.symmetrize_new.get_worm_components_2dims(num_bands: int, orbs: list[list[int]]) list[int][source]#
Lists the worm component indices for the given two-leg orbital combinations (both equal-spin sectors).
- dgamore.symmetrize_new.get_worm_components_4dims(num_bands: int, orbs: list[list[int]]) list[int][source]#
Lists the worm component indices for the given four-leg orbital combinations, over the spin sectors relevant under SU(2) symmetry.
- dgamore.symmetrize_new.get_worm_components_all_2dims(num_bands: int) list[int][source]#
Lists the worm component indices over all two-orbital combinations, keeping only the spin combinations relevant for the density and magnetic channels under SU(2) symmetry.
- dgamore.symmetrize_new.get_worm_components_all_4dims(num_bands: int) list[int][source]#
Lists the worm component indices over all four-orbital combinations, keeping only the spin combinations relevant for the density and magnetic channels under SU(2) symmetry.
- dgamore.symmetrize_new.get_worm_components_partial_2dims(num_bands: int) list[int][source]#
Lists the worm component indices over the orbital-diagonal two-orbital combinations only, keeping the spin combinations relevant for the density and magnetic channels under SU(2) symmetry.
- dgamore.symmetrize_new.get_worm_components_partial_4dims(num_bands: int) list[int][source]#
Lists the worm component indices over the four-orbital combinations excluding the
ijjj/jijj/jjij/jjjipatterns, keeping the spin combinations relevant for the density and magnetic channels under SU(2) symmetry.
- dgamore.symmetrize_new.index2component_band(num_bands: int, n_dims: int, ind: int) list[source]#
Decodes a compound (orbital-only) index into its per-leg orbital indices.
- dgamore.symmetrize_new.index2component_general(num_bands: int, n_dims: int, ind: int) tuple[ndarray, ndarray, ndarray][source]#
Decodes a compound index into its per-leg band and spin components for an
n_dims-legged object.
- dgamore.symmetrize_new.index2component_general_2dims(num_bands: int, ind: int) tuple[ndarray, ndarray, ndarray][source]#
Decodes a compound index into band and spin components for a two-legged object (see
index2component_general()).
- dgamore.symmetrize_new.index2component_general_4dims(num_bands: int, ind: int) tuple[ndarray, ndarray, ndarray][source]#
Decodes a compound index into band and spin components for a four-legged object (see
index2component_general()).
- dgamore.symmetrize_new.save_to_file(g2_list: list[ndarray], names: list[str], niw: int, nb: int, ineq: int)[source]#
Writes the given two-particle Green’s functions to the (module-level) output HDF5 file in the per-bosonic- frequency, per-orbital-component layout expected by the DGA input reader.
- Parameters:
g2_list (list[ndarray]) – The two-particle Green’s function arrays to write.
names (list[str]) – The channel names (one per array, e.g.
["dens", "magn"]).niw (int) – Number of positive bosonic frequencies.
nb (int) – Number of bands.
ineq (int) – The inequivalent-atom index used in the output group path.
- Returns:
None.
- Raises:
AssertionError – If
g2_listandnameshave different lengths.