green_mbtools.mint

green_mbtools.mint.common_utils

green_mbtools.mint.common_utils.add_common_params(parser)[source]

Define common command line arguments for Green python module

green_mbtools.mint.common_utils.add_pbc_params(parser)[source]

Define PBC-specific command line arguments for Green python module

green_mbtools.mint.common_utils.check_high_symmetry_path(args)[source]

Check that selected high-symmetry path is correct for the chosen simulation parameters

Parameters:

args (map) – simulation parameters

green_mbtools.mint.common_utils.compute_df_int_dca(args, mycell, kmesh, lattice_kmesh, nao, X_k)[source]

Generate density-fitting integrals for correlated methods using q-averaging over the super-lattice points to compensate finite-size error

Parameters:
  • args (map) – simulation parameters

  • mycell (pyscf.pbc.Cell or pyscf.Mol) – unit cell object

  • kmesh (numpy.ndarray) – reciprocal space grid

  • lattice_kmesh (numpy.ndarray) – super-lattice k-points

  • nao (int) – number of atomic orbitals in the unit cell

  • X_k (numpy.ndarray) – trasformation matrix for projection onto an orthogonal space

green_mbtools.mint.common_utils.compute_ewald_correction(args, cell, kmesh, filename, X_k=None)[source]
green_mbtools.mint.common_utils.construct_gdf(args, mycell, kmesh=None)[source]

Construct Gaussian Density Fitting obejct for a given parameters and unit cell. We make sure to disable range-separeting implementation

green_mbtools.mint.common_utils.construct_mol_gdf(args, mycell)[source]

Construct Gaussian Density Fitting obejct for a given parameters and unit cell. We make sure to disable range-separeting implementation

green_mbtools.mint.common_utils.extract_ase_data(a, atoms)[source]

For a given data in XYZ format generate parameters in ASE format

Parameters:
  • a (str) – string containing lattice vectros in XYZ format

  • atoms (str) – string containin atoms positions in XYZ format

Returns:

numpy array of lattice vectors, list of atom symbols, and list of atom coordinates

Return type:

tuple

green_mbtools.mint.common_utils.fold_back_to_1stBZ(kpts)[source]

Map each k-point from a given list of scaled k-points into the first Brillouin zone

Parameters:

kpts (numpy.ndarray) – list of k-points

Returns:

k-points folded into 1st Brillouin-zone

Return type:

numpy.ndarray

green_mbtools.mint.common_utils.high_symmetry_path(cell, args)[source]

Compute high-symmetry k-path

Parameters:
  • cell (pyscf.pbc.Cell) – unit-cell object

  • args (map) – simulation parameters

Returns:

k-points on the chosen high-symmetry path; corresponding non-interacting Hamiltonian and overlap matrix, and linear k-point axis and labels (used in band structure plots)

Return type:

tuple

green_mbtools.mint.common_utils.init_k_mesh(args, mycell)[source]

init k-points mesh for GDF

Parameters:
  • args (map) – simulation parameters

  • mycell (pyscf.pbc.Cell) – unit cell for simulation

Returns:

  • numpy.ndarray – k-mesh for the Brillouin Zone

  • numpy.ndarray – k-mesh with unique k-points, forming the irreducible k-mesh

  • numpy.ndarray – indices of irreducible k-points in the input k-list

  • numpy.ndarray – truth table for whether a k-point has an irreducible time-reversal equivalent

  • numpy.ndarray – weights for each irreducible k-point (degeneracy)

  • numpy.ndarray – inverse index, associating each k-point with its unique equivalent

  • int – number of irreducible k-points

green_mbtools.mint.common_utils.init_mol_params(params=None)[source]

Initialize argparse.ArgumentParser for Green/WeakCoupling python module and return a prased parameters map with parameters specific for molecular calculations

green_mbtools.mint.common_utils.init_pbc_params(params=None)[source]

Initialize argparse.ArgumentParser for Green/WeakCoupling python module and return a prased parameters map with parameters specific for periodic calculations

green_mbtools.mint.common_utils.init_q_mesh(args, mycell, k_mesh, save_data=True)[source]

Initialize q-mesh for GDF

Parameters:
  • mycell (pyscf.pbc.Cell) – unit cell for simulation

  • k_mesh (numpy.ndarray) – k-mesh for the Brillouin Zone

Returns:

q-mesh struct for the Brillouin Zone

Return type:

pyscf.pbc.lib.kpts.KPoints

green_mbtools.mint.common_utils.inversion_sym(kmesh_scaled)[source]

For a given list of the scaled k-points in the full Brillouin zone select k-points that are equivalent by the time-reversal symmetry and return them and their corresponding weight and index

Parameters:

kpts (numpy.ndarray) – list of scaled k-points

Returns:

  • numpy.ndarray – indices of irreducible k-points in the input k-list

  • numpy.ndarray – inverse index, associating each k-point with its unique equivalent

  • numpy.ndarray – weights for each irreducible k-point (degeneracy)

  • numpy.ndarray – truth table for whether a k-point has an irreducible time-reversal equivalent

green_mbtools.mint.common_utils.mol_cell(args)[source]

Initialize PySCF unit cell object for a given system

green_mbtools.mint.common_utils.orthogonalize(mydf, orth, X_k, X_inv_k, F, T, hf_dm, S, mf=None)[source]

Transform Fock-matrix, non-interacting Hamiltonian, density matrix and overlap matrix into an orthogonal basis.

orth selects the per-k transformation:
  • “none” : identity (AO basis preserved)

  • “lowdin” : symmetric S^{-1/2} orthogonalization

  • “mo” : canonical molecular orbitals from mf.mo_coeff

  • “natural” : natural orbitals from the mean-field density matrix

mf is required for “mo”; “natural” uses hf_dm. Per-k basis construction is delegated to ortho_utils.{lowdin,mo,natural}_per_k.

green_mbtools.mint.common_utils.parse_basis(basis_list)[source]

Parse information about chosen basis sets

Parameters:

basis_list (str) – basis-set information

Returns:

basis-set information usable in initialization of pyscf Cell object

Return type:

list

green_mbtools.mint.common_utils.parse_geometry(g)[source]

Parse geometry of the system

green_mbtools.mint.common_utils.pbc_cell(args)[source]

Initialize PySCF unit cell object for a given system

green_mbtools.mint.common_utils.print_high_symmetry_points(args)[source]

For given simulation parameters, generate and print list of lattice special points

Parameters:

args (map) – simulation parameters

green_mbtools.mint.common_utils.read_dm(dm0, dm_file)[source]

Read density matrix from smaller kmesh

green_mbtools.mint.common_utils.save_data(args, mycell, mf, kmesh, ind, weight, num_ik, ir_list, conj_list, Nk, nk, NQ, F, S, T, hf_dm, madelung, Zs, last_ao)[source]

Save data in Green/WeakCoupling format into a hdf5 file

green_mbtools.mint.common_utils.solve_mean_field(args, mydf, mycell)[source]

Obtain pySCF mean-field solution for a given parameters, unit-cell object and density-fitting object

green_mbtools.mint.common_utils.solve_mol_mean_field(args, mydf, mycell)[source]

Obtain pySCF mean-field solution for a given parameters, unit-cell object and density-fitting object

green_mbtools.mint.common_utils.store_auxcell_kstruct_ops_info(args, auxcell, kmesh)[source]

Store symmetry operation information for k-points into hdf5 file in Green’WeakCoupling format for auxcell only case

Parameters:
  • args (map) – simulation parameters

  • auxcell (pyscf.pbc.gto.Cell) – auxiliary unit cell for density-fitting

  • kmesh (numpy.ndarray) – k-mesh for the Brillouin Zone

  • aux_kstruct (pyscf.pbc.symm.KPointsSymmetry) – k-point symmetry structure for aux-basis

green_mbtools.mint.common_utils.store_k_grid(args, mycell, kmesh, k_ibz, ir_list, conj_list, weight, ind, num_ik, kstruct=None)[source]

Store reciprocal space information into a hdf5 file in Green’WeakCoupling format

green_mbtools.mint.common_utils.store_kstruct_ops_info(args, mycell, kmesh, kstruct, X_k=None, X_inv_k=None)[source]

Store symmetry operation information for k-points into a hdf5 file in Green’WeakCoupling format

Parameters:
  • args (map) – simulation parameters

  • mycell (pyscf.pbc.Cell) – unit cell for simulation

  • kmesh (numpy.ndarray) – k-mesh for the Brillouin Zone

  • kstruct (pyscf.pbc.symm.KPointsSymmetry) – k-point symmetry structure

  • X_k (numpy.ndarray, optional) – Orthogonalization matrices in the full BZ, shape (nk, nao, nao) (or spin-orbital analog). Required together with X_inv_k when args.orth != "none" to rotate AO-space symmetry operators into the orthogonalized basis.

  • X_inv_k (numpy.ndarray, optional) – Inverse orthogonalization matrices on irreducible k-points, indexed by kstruct.bz2ibz representatives. Used as X_k[k] @ U_ao[k] @ X_inv_k[k_ir].

Notes

The function writes/updates the following datasets under /symmetry/k in args.output_path:

  • n_stars: number of k-point stars.

  • stars/<i>: indices of BZ points in star i.

  • k_sym_transform_ao: one AO-space symmetry transform per BZ k-point, mapping each point to its representative irreducible k-point.

For args.x2c < 2, k_sym_transform_ao is built from get_representation. For args.x2c == 2, the full double-group spinor representation \(D^{1/2}(R^{-1}) \otimes U_\text{orbital}(R^{-1})\) is stored via get_spinor_representation().

Returns:

Data is written directly to the HDF5 file.

Return type:

None

green_mbtools.mint.common_utils.store_mol_symmetry_info(args, mycell, auxcell, kmesh=None)[source]

Store trivial symmetry information for molecular calculations.

Molecular cases use a single Gamma-point only, so the k- and q-mesh symmetry datasets are all one-point identity mappings.

green_mbtools.mint.common_utils.transform(Z, X, X_inv)[source]

Transform Z into X basis

Parameters:
  • Z (numpy.ndarray) – Object to be transformed

  • X (numpy.ndarray) – Transformation matrix

  • X_inv (numpy.ndarray) – Inverse transformation matrix

Returns:

Z in new basis

Return type:

numpy.ndarray

green_mbtools.mint.common_utils.wrap_1stBZ(k)[source]

wrap scaled k into [-0.5,0.5) range :type k: :param k: value of k-point at some dimension

green_mbtools.mint.common_utils.wrap_k(k)[source]

green_mbtools.mint.gdf_s_metric

green_mbtools.mint.gdf_s_metric.check_eri(j3c1, j3c2, kptij_lst)[source]
green_mbtools.mint.gdf_s_metric.compute_j2c_sqrt(uniq_kptji_id, j2c, linear_dep_threshold=1e-09)[source]
green_mbtools.mint.gdf_s_metric.make_j2c_sqrt(mydf, cell, space_symm=True, tr_symm=True, rsgdf=False)[source]
green_mbtools.mint.gdf_s_metric.make_j3c(mydf, cell, j2c_sqrt=True, exx=False, space_symm=False, tr_symm=True)[source]

The inefficient incore version of make_j3c

green_mbtools.mint.gdf_s_metric.make_j3c_outcore(mydf, cell, basename='df_int', rsgdf=False, j2c_sqrt=True, exx=False)[source]

The outcore version of make_j3c

green_mbtools.mint.gdf_s_metric.make_kptij_lst(kpts, kpts_band=None)[source]
green_mbtools.mint.gdf_s_metric.sqrt_j2c(mydf, j2c)[source]
green_mbtools.mint.gdf_s_metric.transformation_PW_to_auxbasis(mydf, cell, j2c_sqrt, qs, space_symm=False, tr_symm=True)[source]

green_mbtools.mint.integral_utils

class green_mbtools.mint.integral_utils.GreenGDF(cell, kpts=array([[0., 0., 0.]]))[source]

Bases: GDF

green_mbtools.mint.integral_utils.cholesky_decomposed_metric(j2c_k, cell, inv=False)[source]

Calculate the Cholesky decomposition of the j2c metric for a given k-point, or its inverse if requested.

Parameters:
  • j2c_k (_type_) – j2c metric for a specific k-point.

  • cell (_type_) – information about the unit cell, used for error handling and potential adjustments based on dimensionality.

  • inv (bool, optional) – Whether to return the inverse of the Cholesky decomposition, by default False

Returns:

  • j2c_sqrt_k or j2c_sqrt_inv_k (ndarray) – Cholesky decomposition of the j2c metric (lower triangular matrix L such that j2c_k = L @ L†) or its inverse (L⁻¹), depending on the value of inv.

  • j2c_negative (ndarray or None) – If the j2c metric has negative eigenvalues (which can occur in 2D systems with certain Fourier transform conventions), this will contain the corresponding eigenvectors. Otherwise, it will be None.

green_mbtools.mint.integral_utils.compute_ewald_correction(args, maindf, kmesh, nao, filename='df_ewald.h5', X_k=None)[source]
green_mbtools.mint.integral_utils.compute_integrals(args, mycell, mydf, kmesh, nao, X_k=None, basename='df_int', cderi_name='cderi.h5', keep=True, keep_after=False, cderi_name2='cderi_ewald.h5')[source]
green_mbtools.mint.integral_utils.compute_kG(k, Gv, wrap_around, mesh, cell)[source]
green_mbtools.mint.integral_utils.eigenvalue_decomposed_metric(j2c_k, cell, inv=False)[source]
green_mbtools.mint.integral_utils.get_coarsegrained_coulG(lattice_kmesh, cell, k=array([0., 0., 0.]), exx=False, mf=None, mesh=None, Gv=None, wrap_around=True, omega=None, **kwargs)[source]

Calculate the coarse-grained Coulomb kernel for all G-vectors, handling G=0 and exchange. This routine overrides get_coulG to perform interaction coarse-graining.

green_mbtools.mint.integral_utils.integrals_grid(mycell, kmesh)[source]
green_mbtools.mint.integral_utils.kpair_reduced_lists(kptis, kptjs, kptij_idx, kmesh, a)[source]
green_mbtools.mint.integral_utils.make_gdf_kptij_lst_jk(kstruct)[source]

[WIP] Build GDF k-point-pair list for get_jk All combinations:

k_ibz != k_bz
k_bz  == k_bz
green_mbtools.mint.integral_utils.weighted_coulG_ewald(mydf, kpt, exx, mesh, omega=None)[source]
green_mbtools.mint.integral_utils.weighted_coulG_ewald_2nd(mydf, kpt, exx, mesh)[source]

green_mbtools.mint.kpt_utils

green_mbtools.mint.kpt_utils.build_q_struct(mycell, k_mesh, space_symm=False, tr_symm=True)[source]

Initialize q-mesh for GDF

Parameters:
  • mycell (pyscf.pbc.Cell) – unit cell for simulation

  • k_mesh (numpy.ndarray) – k-mesh for the Brillouin Zone

  • space_symm (bool) – utilize space group symmetry for qmesh reduction

  • tr_symm (bool) – utilize time-reversal symmetry for qmesh reduction

Returns:

q-mesh struct for the Brillouin Zone

Return type:

pyscf.pbc.lib.kpts.KPoints

green_mbtools.mint.kpt_utils.wrap_k(k)[source]

green_mbtools.mint.namespace

class green_mbtools.mint.namespace.Namespace(params)[source]

Bases: object

Generic namespace class that can be set by a dictionary object and return None for missing arguments

green_mbtools.mint.ortho_utils

green_mbtools.mint.ortho_utils.build_X_kspace(mode, kstruct, mycell, S_ibz, *, F_ibz=None, dm_ibz=None, mo_coeff_ibz=None, spinor=False, tol_sing=1e-09, tol_degen=1e-08)[source]

Build orthogonalization matrices (X_k, X_inv_k) over the full BZ.

X is constructed only at IBZ k-points using one of the per-k primitives, then propagated to every star member via the space-group + time-reversal representations carried by kstruct. See _propagate_X_to_star for the convention.

Parameters:
  • mode ({"lowdin", "symmetric_lowdin", "mo", "natural"}) – IBZ primitive to use.

  • kstruct (pyscf.pbc.lib.kpts.KPoints) – Same object the rest of mbtools uses (e.g. from kpt_utils.build_q_struct(mycell, kmesh, space_symm=True, tr_symm=True)).

  • mycell (pyscf.pbc.gto.Cell) – Required for the AO-space representations.

  • S_ibz ((n_ibz, n, n) ndarray) – Overlap at IBZ k-points, in the order kstruct.kpts_scaled[kstruct.ibz2bz].

  • F_ibz ((n_ibz, n, n) ndarray, optional) – Fock at IBZ. Required for mode="natural" (degeneracy tie-breaking) and for mode="mo" when mo_coeff_ibz is not provided (spin-averaged Fock is used to derive MOs).

  • dm_ibz ((n_ibz, n, n) ndarray, optional) – Spin-averaged / total density matrix at IBZ. Required for mode="natural".

  • mo_coeff_ibz ((n_ibz, n, n_mo) ndarray, optional) – MO coefficients at IBZ. Preferred input for mode="mo".

  • spinor (bool, default False) – If True, use the double-group spinor representation (get_spinor_representation). Currently only supported with mode="lowdin".

  • tol_sing (float) – Threshold for discarding small eigenvalues of S in the Löwdin primitive.

  • tol_degen (float) – Tolerance used by the natural-mode Fock tie-breaker to detect degenerate occupation blocks.

Returns:

  • X_k ((nk, n_ortho, n) complex128 ndarray)

  • X_inv_k ((nk, n, n_ortho) complex128 ndarray)

green_mbtools.mint.ortho_utils.build_X_kspace_from_ao_reps(mode, S_ibz, ibz2bz, bz2ibz, k_sym_transform_ao, *, tr_conj=None, F_ibz=None, dm_ibz=None, mo_coeff_ibz=None, tol_sing=1e-09, tol_degen=1e-08)[source]

Build (X_k, X_inv_k) from precomputed AO-space rotations.

Identical to build_X_kspace but consumes the symmetry information that common_utils.store_kstruct_ops_info already writes into input.h5 under /symmetry/k

  • ibz2bz (n_ibz,) BZ indices of IBZ reps

  • bz2ibz (nk,) IBZ index for each BZ point

  • k_sym_transform_ao (nk, n, n) stored AO rotation U(k)

  • tr_conj (nk,) bool TR partner flags

— instead of (kstruct, mycell). Designed for callers like the SEET pre-processor which read these arrays from h5 and do not carry a PySCF KPoints object.

For non-TR points, M(k) = U M(k_ir) U†; for TR points the stored U already incorporates the conjugation factor (e.g. for X2C double group, (U_spinor @ Θ).conj()) and the reconstruction is M(k) = (U M(k_ir) U†).conj(). The function applies the matching rule for X automatically — callers do not need to special-case TR.

Parameters mirror build_X_kspace; mode semantics are identical. spinor is implicit in the basis size of S_ibz / k_sym_transform_ao (both are nso × nso for X2C).

Returns:

  • X_k ((nk, n_ortho, n) complex128 ndarray)

  • X_inv_k ((nk, n, n_ortho) complex128 ndarray)

green_mbtools.mint.ortho_utils.lowdin_per_k(Sk, tol=1e-09)[source]

Symmetric (Löwdin) S^{-1/2} orthogonalization for a single k-point.

Returns (X, X_inv) in the convention used by common_utils.transform (i.e. transforms apply as X Z X†):

X     = S^{-1/2}   (shape (n_ortho, nao))
X_inv = S^{+1/2}   (shape (nao, n_ortho))

Eigenvalues of Sk below tol are discarded.

green_mbtools.mint.ortho_utils.mo_per_k(Sk, C_k)[source]

Canonical-MO basis for a single k-point from MO coefficients C_k satisfying C† S C = I.

Returns (X = C†, X_inv = S C) in the X Z X† convention.

green_mbtools.mint.ortho_utils.natural_per_k(Sk, dmk)[source]

Natural-orbital basis at one k-point from density matrix dmk.

Diagonalises S^{-1/2} dm S^{-1/2} to obtain S-orthonormal natural orbitals C_NO = S^{-1/2} u (columns) with C_NO† S C_NO = I and C_NO† dm C_NO = diag(occ). Returns (X, X_inv) in the same X Z X† convention as mo_per_k:

X = C_NO† (shape (n_ortho, nao)) X_inv = S @ C_NO (shape (nao, n_ortho))

green_mbtools.mint.ortho_utils.symmetric_lowdin_per_k(Sk, tol=1e-09)[source]

Symmetric (Hermitian) Löwdin orthogonalization for a single k-point.

Returns (X = S^{-1/2}, X_inv = S^{+1/2}) — both Hermitian (nao, nao) matrices — in the X Z X† convention. Distinguished from lowdin_per_k (canonical Löwdin) by being Hermitian rather than rectangular.

Eigenvalues of Sk below tol are treated pseudo-inversely: their contribution is zeroed in both X and X_inv, the same convention LA.pinv applies (see pesto/orth.py). The output stays Hermitian and square, but in the rank-deficient case X @ X_inv reduces to the projector onto the kept subspace rather than the identity (Hermitian symmetric Löwdin cannot simultaneously be a strict left inverse on a rank-deficient basis). When linear dependencies are present and a strict X @ X_inv = I contract is required, use lowdin_per_k (canonical, rectangular).

green_mbtools.mint.pyscf_init

class green_mbtools.mint.pyscf_init.pyscf_init(args)[source]

Bases: object

Initialization class for Green project

args

simulation parameters

Type:

map

cell

unit cell object

Type:

pyscf.pbc.cell

kmesh

Monkhorst-Pack reciprocal space grid

Type:

numpy.ndarray

cell_object()[source]
compute_df_int(nao, X_k)[source]
df_object(mydf=None)[source]
mean_field_input(mydf=None)[source]
mf_object(mydf=None)[source]
class green_mbtools.mint.pyscf_init.pyscf_mol_init(args=None)[source]

Bases: pyscf_init

Initialization class for molecular systems in the Green project

cell_object()[source]
compute_df_int(nao, X_k)[source]

Generate density-fitting integrals for correlated methods

df_object(mydf=None)[source]
mean_field_input(mydf=None)[source]

Solve a give mean-field problem and store the solution in the Green/WeakCoupling format

Parameters:

mydf (pyscf.df) – pyscf density-fitting object, will be generated if None

mf_object(mydf=None)[source]
class green_mbtools.mint.pyscf_init.pyscf_pbc_init(args=None)[source]

Bases: pyscf_init

Initialization class for periodic / solid-state systems for the Green project

cell_object()[source]
compute_df_int(nao, X_k)[source]

Generate density-fitting (DF) three-center Coulomb integrals for correlated methods.

This routine always produces the mean-field DF integral set written to args.hf_int_path. A second, correlated DF integral set written to args.int_path is generated here only for the ewald finite-size correction path.

  1. Mean-field integrals (written to args.hf_int_path): Standard DF integrals L^Q_{pq}(k_i, k_j) for all symmetry- irreducible k-point pairs, computed with the bare Coulomb kernel. These are used in the mean-field and Hartree-Fock steps.

  2. Finite-size correction handling:

    • gf2 / gw / gw_s: delegates to compute_twobody_finitesize_correction(), which uses the GF2 Ewald subtraction scheme or the GW plane-wave transformation respectively, then returns early. In these branches, compute_integrals(..., basename=args.int_path, ...) is not called by this function.

    • ewald (default): builds a second set of three-center integrals with the Ewald Coulomb kernel via green_igen.df._make_j3c and passes them to compute_integrals as cderi_name2; the diagonal pairs in the output are then replaced by the Ewald-corrected values and written to args.int_path.

Parameters:
  • nao (int) – Number of non-relativistic atomic orbitals per k-point. Always cell.nao_nr() regardless of the X2C level, because the Coulomb integrals are non-relativistic.

  • X_k (list of ndarray) –

    Per-k-point orthogonalisation matrices X(k). The specific form depends on args.orth:

    • "lowdin" — canonical Löwdin, X(k) = Lambda^{-1/2} V† (rectangular when small eigenvalues of S are dropped).

    • "symmetric_lowdin" — Hermitian Löwdin, X(k) = S(k)^{-1/2} (square; treats sub-tol eigenvalues pseudo-inversely).

    • "mo" — canonical MOs, X(k) = C(k)† with X_inv = S(k) @ C(k).

    • "natural" — natural orbitals, X(k) = C_NO(k)† with X_inv = S(k) @ C_NO(k) and C_NO the S-orthonormal eigenvectors of S^{-1/2} dm S^{-1/2}.

    When orthogonalisation is disabled (args.orth == "none"), X_k contains identity transforms for each k-point rather than an empty list.

compute_twobody_finitesize_correction(mydf=None, X_k=None)[source]
df_object(mydf=None)[source]
evaluate_gw_correction(mydf=None)[source]
evaluate_high_symmetry_path()[source]
mean_field_input(mydf=None)[source]

Solve a given mean-field problem and store the solution in the Green/WeakCoupling format

Parameters:

mydf (pyscf.pbc.df) – pyscf density-fitting object, will be generated if None

mf_object(mydf=None)[source]

green_mbtools.mint.seet_init

class green_mbtools.mint.seet_init.seet_init(args)[source]

Bases: object

SEET pre-processing class. Computes proper orthogonal transformation and projection matricies

args

simulation parameters

Type:

map

get_input_data()[source]

Read weak-coupling solution

to_full_bz(X, conj_list, ir_list, bz_index, k_ind)[source]

Project moment-dependent quantity onto full Brillouin zone

green_mbtools.mint.symmetry_utils

green_mbtools.mint.symmetry_utils.check_kspace_symmetry_breaking(inp_file, datasets)[source]

Report symmetry reconstruction residuals for k-resolved matrix quantities.

Parameters:
  • inp_file (string) – Path to input.h5 file that contains all the output from initialization

  • datasets (list) – List of datasets in the input file, for which symmetry checks need to be performed

green_mbtools.mint.symmetry_utils.fold_to_unit_cell(r_cart_scaled)[source]

Fold a scaled (fractional) coordinate into the primary unit cell.

Parameters:
  • r_cart_scaled (array_like) – Scaled/fractional coordinate to be folded, shape (3,). This should be in the same convention as Cell.get_scaled_atom_coords() (i.e. expressed in units of the lattice vectors, not in Cartesian units). The parameter name is historical and does not imply Cartesian coordinates.

  • mycell (pyscf.pbc.gto.cell.Cell) – The unit cell object from PySCF.

Returns:

  • frac (ndarray) – The folded scaled/fractional coordinate within the unit cell, shape (3,). Each component is wrapped into the interval [-0.5, 0.5) to match the atom coordinate convention used elsewhere in this module.

  • Fold a Cartesian coordinate into the primary unit cell.

  • Parameters

  • ———–

  • r_cart_scaled (array_like) – Scaled cartesian coordinate to be folded (3,).

  • mycell (pyscf.pbc.gto.cell.Cell) – The unit cell object from PySCF.

  • Returns

  • ———–

  • r_rel (ndarray) – The folded Cartesian coordinate within the unit cell (3,).

green_mbtools.mint.symmetry_utils.generate_permutation_info(mycell, symm_op, tol=1e-08, verbose=False)[source]

Generate permutation info for given symmetry operation on the atoms of unit cell.

Parameters:
  • mycell (pyscf.pbc.gto.cell.Cell) – The unit cell object from PySCF.

  • symm_op (pyscf.pbc.symm.space_group.SPGElement) – The symmetry operation element from PySCF.

  • tol (float, optional) – Tolerance for numerical comparisons, by default 1e-10

  • verbose (bool, optional) – If True, print detailed information, by default False

Returns:

  • partner_idx (int) – Index of the atom that is the partner under the symmetry operation.

  • pos_diff (ndarray) – The positional difference vector due to folding into the unit cell (3,).

green_mbtools.mint.symmetry_utils.get_orbital_index(atom_idx, n_, L_, mycell)[source]

Get the starting and ending index of orbitals for a given atom and angular momentum.

Parameters:
  • atom_idx (int) – Index of the atom in the unit cell.

  • n_ – Principal quantum number.

  • L_ – Angular momentum quantum number.

  • mycell (pyscf.pbc.gto.cell.Cell) – The unit cell object from PySCF.

Returns:

  • orb_start (int) – Starting index of the orbitals.

  • orb_end (int) – Ending index of the orbitals.

green_mbtools.mint.symmetry_utils.get_representation(bz_idx, symm_op_idx, mycell, kstruct, tol=1e-05, verbose=False)[source]

Get the representation matrix for given symmetry operation on the atoms of unit cell.

Parameters:
  • bz_idx (int) – Index of the k-point in the Brillouin zone.

  • symm_op_idx (int) – Index of the symmetry operation element from PySCF.

  • mycell (pyscf.pbc.gto.cell.Cell) – The unit cell object from PySCF.

  • kstruct (pyscf.pbc.symm.KPointsSymmetry) – k-point symmetry structure for aux-basis

  • tol (float, optional) – Tolerance for atom-position matching in generate_permutation_info. Default is 1e-5, matching generate_permutation_info’s own default. Note: PySCF stores fractional translations with ~6 decimal places (e.g. 0.666667 instead of 2/3), introducing ~3e-7 residuals after applying the operation. A tighter tol (e.g. 1e-10) would therefore fail for any lattice whose space-group translations are not integers.

  • verbose (bool, optional) – If True, print detailed information, by default False

Returns:

repr_matrix – The representation matrix for the symmetry operation (nao, nao).

Return type:

ndarray

green_mbtools.mint.symmetry_utils.get_spinor_representation(bz_idx, symm_op_idx, mycell, kstruct, tol=1e-05, verbose=False)[source]

Double-group spinor AO representation \(D^{1/2}(R^{-1}) \otimes U_\text{orbital}(R^{-1})\).

Reads the rotation directly from kstruct.ops[symm_op_idx], converts it to a Cartesian rotation, lifts it to SU(2) via rotation_matrix_to_su2(), and combines it with the orbital representation from get_representation().

PySCF’s Dmats use the passive (inverse) convention \(D^L(R^{-1})\), so get_representation() returns \(U_\text{orbital}(R^{-1})\). The matching SU(2) factor is therefore \(D^{1/2}(R^{-1}) = D^{1/2}(R)^\dagger\), i.e. the conjugate transpose of the direct lift.

Parameters:
  • bz_idx (int) – Index of the BZ k-point.

  • symm_op_idx (int) – Index of the symmetry operation in kstruct.ops.

  • mycell (pyscf.pbc.gto.Cell) – PySCF unit cell.

  • kstruct (pyscf.pbc.lib.kpts.KPoints) – k-point symmetry structure from mycell.make_kpts(...).

  • tol (float, optional) – Tolerance passed to get_representation for atom-position matching. Default 1e-5 matches generate_permutation_info’s own default and accommodates PySCF’s ~6 decimal-place translation precision (~3e-7 residuals). See get_representation for full discussion.

Returns:

u_spinor – Full spinor AO representation, nso = 2 * nao.

Return type:

(nso, nso) complex ndarray

green_mbtools.mint.symmetry_utils.rotation_matrix_to_su2(R_cart)[source]

Return the SU(2) representative of a proper 3D Cartesian rotation matrix.

For a rotation by angle \(\varphi\) about unit axis \(\hat{n}\):

\[D^{1/2}(R) = \cos(\varphi/2)\,I_2 + i\sin(\varphi/2)\,(\hat{n}\cdot\boldsymbol{\sigma})\]
Parameters:

R_cart ((3, 3) float ndarray) – Proper rotation matrix (det = +1) in Cartesian coordinates.

Returns:

su2

Return type:

(2, 2) complex ndarray