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)[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.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)[source]

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

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_k_grid(args, mycell, kmesh, k_ibz, ir_list, conj_list, weight, ind, num_ik)[source]

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

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)[source]
green_mbtools.mint.gdf_s_metric.make_j3c(mydf, cell, j2c_sqrt=True, exx=False)[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)[source]

green_mbtools.mint.integral_utils

green_mbtools.mint.integral_utils.compute_ewald_correction(args, maindf, kmesh, nao, filename='df_ewald.h5')[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.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.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.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.avg(kpts, X)[source]

Average momentum dependent quantity

green_mbtools.mint.ortho_utils.canonical_orbitals(S, dm, F_up, F_dn, T_up, T_dn, kmesh, Debug_print=False)[source]
green_mbtools.mint.ortho_utils.natural_orbitals(S, dm, F_up, F_dn, T_up, T_dn, kmesh, Debug_print=False)[source]

Compute transformation matricies for natural orbtial basis from spin-averaged density matrix —

green_mbtools.mint.ortho_utils.normalize(Sv)[source]
green_mbtools.mint.ortho_utils.symmetrical_orbitals(S, dm, F_up, F_dn, T_up, T_dn, kmesh, Debug_print=False)[source]
green_mbtools.mint.ortho_utils.wrap_k(k)[source]

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 integrals for correlated methods

compute_twobody_finitesize_correction(mydf=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 give 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