Projector

Base classes and inheritance

All real space projectors are either derived from EuclideanProjector or RadialProjector. The former implements density projections on a euclidean grid with periodic boundary conditions. The latter can be used for projections on flexible grids for which grid coordinates and integration weights are explicitly provided (as e.g. in PySCF). Both of these projector types inherit from the BaseProjector class.

class neuralxc.projector.projector.BaseProjector
get_basis_rep(rho, positions, species, **kwargs)

Calculates the basis representation for a given real space density

Parameters:
  • rho (np.ndarray float (npoints) or (xpoints, ypoints, zpoints)) – Electron density in real space
  • positions (np.ndarray float (natoms, 3)) – atomic positions
  • species (list string) – atomic species (chem. symbols)
Returns:

c – Basis representation, dict keys correspond to atomic species.

Return type:

dict of np.ndarrays

class neuralxc.projector.projector.EuclideanProjector(unitcell, grid, basis_instructions, **kwargs)
__init__(unitcell, grid, basis_instructions, **kwargs)

Projector on euclidean grid with periodic bounday conditions

Parameters:
  • unitcell (numpy.ndarray float (3,3)) – Unitcell in bohr
  • grid (numpy.ndarray float (3)) – Grid points per unitcell
  • basis_instructions (dict) – Instructions that define basis
class neuralxc.projector.projector.RadialProjector(grid_coords, grid_weights, basis_instructions, **kwargs)
__init__(grid_coords, grid_weights, basis_instructions, **kwargs)

Projector for generalized grid (as provided by e.g. PySCF). More flexible than euclidean grid as only grid point coordinates and their integration weights need to be provided, however does not support periodic boundary conditions. Special use case: Radial grids, as used by all-electron codes.

Parameters:
  • grid_coords (numpy.ndarray (npoints, 3)) – Coordinates of radial grid points
  • grid_weights (numpy.ndarray (npoints)) – Grid weights for integration
  • basis_instructions (dict) – Instructions that defines basis

Radial basis

Starting from from these definitions, NeuralXC implements two projectors that differ in their radial basis functionals. OrthoProjector implements an orthonormal polynomial basis whereas GaussianProjector uses Gaussian type orbitals similar to those used in quantum chemistry codes. Both projectors come in a euclidean and radial version.

class neuralxc.projector.polynomial.OrthoProjector(unitcell, grid, basis_instructions, **kwargs)

Implements orthonormal basis functions

_registry_name:‘ortho’
class neuralxc.projector.polynomial.OrthoRadialProjector(grid_coords, grid_weights, basis_instructions, **kwargs)
_registry_name:‘ortho_radial’
class neuralxc.projector.gaussian.GaussianProjector(unitcell, grid, basis_instructions, **kwargs)

Implements GTO basis

_registry_name:‘gaussian’
class neuralxc.projector.gaussian.GaussianRadialProjector(grid_coords, grid_weights, basis_instructions, **kwargs)
_registry_name:‘gaussian_radial’

PySCF projector

If GTO orbitals in both projection and DFT calculation, projection integrals can be computed analytically. For this purpoes we have implemented a projector that works with PySCF. Future version of NeuralXC will implement a more general density matrix projector class that works with other gto codes as well.

class neuralxc.projector.pyscf.PySCFProjector(mol, basis_instructions, **kwargs)
_registry_name:‘pyscf’
__init__(mol, basis_instructions, **kwargs)

Projector class specific to usage with PySCF. Instead of working with electron density on real space grid, density matrix is projected using analytical integrals.

Parameters:
  • mol (pyscf.gto.M) – Contains information about atoms and GTO basis
  • basis_instructions (dict) –
    Basis instructions containing following values:
    • spec_agnostic, bool (False)
      Use same basis for every atomic species?
    • operator, {‘delta’, ‘rij’} (‘delta’)
      Operator in overlap integral used for projection, delta means standard 3-center overalp, rij with coulomb kernel.
    • delta, bool (False)
      Use delta density (atomic density subracted)
    • basis, str
      Either name of PySCF basis (e.g. ccpvdz-jkfit) or file containing basis.
get_basis_rep(dm, **kwargs)

Project density matrix dm onto set of basis functions and return the projection coefficients (coeff)