pyscf.pbc.tools package¶
Submodules¶
pyscf.pbc.tools.k2gamma module¶
Convert the k-sampled MO/integrals to corresponding Gamma-point supercell MO/integrals.
Zhihao Cui <zcui@caltech.edu> Qiming Sun <osirpt.sun@gmail.com>
See also the original implementation at https://github.com/zhcui/local-orbital-and-cdft/blob/master/k2gamma.py
-
pyscf.pbc.tools.k2gamma.
get_phase
(cell, kpts, kmesh=None)¶ The unitary transformation that transforms the supercell basis k-mesh adapted basis.
-
pyscf.pbc.tools.k2gamma.
k2gamma
(kmf, kmesh=None)¶ convert the k-sampled mean-field object to the corresponding supercell gamma-point mean-field object.
- math:
C_{nu ‘ n’} = C_{vecRmu, veck m} = frac{1}{sqrt{N_{UC}}} e^{ii veckcdotvecR} C^{veck}_{mu m}
-
pyscf.pbc.tools.k2gamma.
mo_k2gamma
(cell, mo_energy, mo_coeff, kpts, kmesh=None)¶
-
pyscf.pbc.tools.k2gamma.
to_supercell_ao_integrals
(cell, kpts, ao_ints)¶ Transform from the unitcell k-point AO integrals to the supercell gamma-point AO integrals.
-
pyscf.pbc.tools.k2gamma.
to_supercell_mo_integrals
(kmf, mo_ints)¶ Transform from the unitcell k-point MO integrals to the supercell gamma-point MO integrals.
pyscf.pbc.tools.lattice module¶
-
pyscf.pbc.tools.lattice.
get_ase_alkali_halide
(A='Li', B='Cl')¶
-
pyscf.pbc.tools.lattice.
get_ase_atom
(formula)¶
-
pyscf.pbc.tools.lattice.
get_ase_diamond_cubic
(atom='C')¶ Get the ASE atoms for cubic (8-atom) diamond unit cell.
-
pyscf.pbc.tools.lattice.
get_ase_diamond_primitive
(atom='C')¶ Get the ASE atoms for primitive (2-atom) diamond unit cell.
-
pyscf.pbc.tools.lattice.
get_ase_graphene
(vacuum=5.0)¶ Get the ASE atoms for primitive (2-atom) graphene unit cell.
-
pyscf.pbc.tools.lattice.
get_ase_graphene_xxx
(vacuum=5.0)¶ Get the ASE atoms for primitive (2-atom) graphene unit cell.
-
pyscf.pbc.tools.lattice.
get_ase_rocksalt
(A='Li', B='Cl')¶
-
pyscf.pbc.tools.lattice.
get_ase_wurtzite
(A='Zn', B='O')¶
-
pyscf.pbc.tools.lattice.
get_ase_zincblende
(A='Ga', B='As')¶
-
pyscf.pbc.tools.lattice.
get_bandpath_fcc
(ase_atom, npoints=30)¶
pyscf.pbc.tools.make_test_cell module¶
-
pyscf.pbc.tools.make_test_cell.
make_cell
(L, mesh)¶
-
pyscf.pbc.tools.make_test_cell.
test_cell_cu_metallic
(mesh=[9, 9, 9])¶ Copper unit cell w/ special basis giving non-equal number of occupied orbitals per k-point
-
pyscf.pbc.tools.make_test_cell.
test_cell_n0
(L=5, mesh=[9, 9, 9])¶
-
pyscf.pbc.tools.make_test_cell.
test_cell_n1
(L=5, mesh=[9, 9, 9])¶
-
pyscf.pbc.tools.make_test_cell.
test_cell_n2
(L=5, mesh=[9, 9, 9])¶
-
pyscf.pbc.tools.make_test_cell.
test_cell_n3
(mesh=[9, 9, 9])¶ Take ASE Diamond structure, input into PySCF and run
-
pyscf.pbc.tools.make_test_cell.
test_cell_n3_diffuse
()¶ Take ASE Diamond structure, input into PySCF and run
pyscf.pbc.tools.pbc module¶
-
pyscf.pbc.tools.pbc.
cell_plus_imgs
(cell, nimgs)¶ Create a supercell via nimgs[i] in each +/- direction, as in get_lattice_Ls(). Note this function differs from :fun:`super_cell` that super_cell only stacks the images in + direction.
- Args:
cell : instance of
Cell
nimgs : (3,) array- Returns:
supcell : instance of
Cell
-
pyscf.pbc.tools.pbc.
cutoff_to_gs
(a, cutoff)¶ Deprecated. Replaced by function cutoff_to_mesh.
-
pyscf.pbc.tools.pbc.
cutoff_to_mesh
(a, cutoff)¶ Convert KE cutoff to FFT-mesh
uses KE = k^2 / 2, where k_max ~ pi / grid_spacing
- Args:
- a(3,3) ndarray
The real-space unit cell lattice vectors. Each row represents a lattice vector.
- cutofffloat
KE energy cutoff in a.u.
- Returns:
mesh : (3,) array
-
pyscf.pbc.tools.pbc.
fft
(f, mesh)¶ Perform the 3D FFT from real (R) to reciprocal (G) space.
After FFT, (u, v, w) -> (j, k, l). (jkl) is in the index order of Gv.
FFT normalization factor is 1., as in MH and in numpy.fft.
- Args:
- f(nx*ny*nz,) ndarray
The function to be FFT’d, flattened to a 1D array corresponding to the index order of
cartesian_prod()
.- mesh(3,) ndarray of ints (= nx,ny,nz)
The number G-vectors along each direction.
- Returns:
- (nx*ny*nz,) ndarray
The FFT 1D array in same index order as Gv (natural order of numpy.fft).
-
pyscf.pbc.tools.pbc.
fftk
(f, mesh, expmikr)¶ Perform the 3D FFT of a real-space function which is (periodic*e^{ikr}).
fk(k+G) = sum_r fk(r) e^{-i(k+G)r} = sum_r [f(k)e^{-ikr}] e^{-iGr}
-
pyscf.pbc.tools.pbc.
get_coulG
(cell, k=array([0., 0., 0.]), exx=False, mf=None, mesh=None, Gv=None, wrap_around=True, **kwargs)¶ Calculate the Coulomb kernel for all G-vectors, handling G=0 and exchange.
- Args:
- k(3,) ndarray
k-point
- exxbool or str
Whether this is an exchange matrix element.
mf : instance of
SCF
- Returns:
- coulG(ngrids,) ndarray
The Coulomb kernel.
- mesh(3,) ndarray of ints (= nx,ny,nz)
The number G-vectors along each direction.
-
pyscf.pbc.tools.pbc.
get_lattice_Ls
(cell, nimgs=None, rcut=None, dimension=None, discard=True)¶ Get the (Cartesian, unitful) lattice translation vectors for nearby images. The translation vectors can be used for the lattice summation.
-
pyscf.pbc.tools.pbc.
get_monkhorst_pack_size
(cell, kpts)¶
-
pyscf.pbc.tools.pbc.
gs_to_cutoff
(a, gs)¶ Deprecated. Replaced by function mesh_to_cutoff.
-
pyscf.pbc.tools.pbc.
ifft
(g, mesh)¶ Perform the 3D inverse FFT from reciprocal (G) space to real (R) space.
Inverse FFT normalization factor is 1./N, same as in numpy.fft but different from MH (they use 1.).
- Args:
- g(nx*ny*nz,) ndarray
The function to be inverse FFT’d, flattened to a 1D array corresponding to the index order of span3.
- mesh(3,) ndarray of ints (= nx,ny,nz)
The number G-vectors along each direction.
- Returns:
- (nx*ny*nz,) ndarray
The inverse FFT 1D array in same index order as Gv (natural order of numpy.fft).
-
pyscf.pbc.tools.pbc.
ifftk
(g, mesh, expikr)¶ Perform the 3D inverse FFT of f(k+G) into a function which is (periodic*e^{ikr}).
fk(r) = (1/Ng) sum_G fk(k+G) e^{i(k+G)r} = (1/Ng) sum_G [fk(k+G)e^{iGr}] e^{ikr}
-
pyscf.pbc.tools.pbc.
madelung
(cell, kpts)¶
-
pyscf.pbc.tools.pbc.
mesh_to_cutoff
(a, mesh)¶ Convert #grid points to KE cutoff
-
pyscf.pbc.tools.pbc.
precompute_exx
(cell, kpts)¶
-
pyscf.pbc.tools.pbc.
super_cell
(cell, ncopy)¶ Create an ncopy[0] x ncopy[1] x ncopy[2] supercell of the input cell Note this function differs from :fun:`cell_plus_imgs` that cell_plus_imgs creates images in both +/- direction.
- Args:
cell : instance of
Cell
ncopy : (3,) array- Returns:
supcell : instance of
Cell
pyscf.pbc.tools.pyscf_ase module¶
pyscf.pbc.tools.pywannier90 module¶
pyscf.pbc.tools.tril module¶
-
pyscf.pbc.tools.tril.
tril_index
(ki, kj)¶
-
pyscf.pbc.tools.tril.
unpack_tril
(in_array, nkpts, kp, kq, kr, ks)¶