qmctorch.scf package

Subpackages

Submodules

qmctorch.scf.molecule module

class qmctorch.scf.molecule.Molecule(atom: str = None, calculator: str = 'adf', scf: str = 'hf', basis: str = 'dzp', unit: str = 'bohr', charge: int = 0, spin: int = 0, name: str = None, load: str = None, save_scf_file: bool = False, redo_scf: bool = False, rank: int = 0, mpi_size: int = 0)[source]

Bases: object

Create a molecule in QMCTorch

Parameters:
  • atom (str, optional) – Defines the atoms and their positions. Defaults to None. - At1 x y z; At2 x y z … : Provide the atomic coordinate directly - <file>.xyz : Provide the path to an .xyz file containing the atomic coordinates

  • calculator (str, optional) – Select SCF calculator. Defaults to ‘adf’. - ‘pyscf’ : PySCF calculator - ‘adf’ : ADF2020+ calculator - ‘adf2019’ : ADF2019 calculator

  • scf (str, optional) – Select SCF level of theory. Defaults to ‘hf’. - ‘hf’ : Hartree-Fock calculation - ‘dft’ : Density Functional Theory using LDA

  • charge (int, optional) – Extra charge on the molecule. Defaults to 0.

  • spin (int, optional) – Excess of spin-up electrons on the molecule. Defaults to 0.

  • basis (str, optional) – Select the basis set. Defaults to ‘dzp’.

  • unit (str, optional) – Units of the coordinates; ‘bohr’ or ‘angs’. Defaults to ‘bohr’.

  • name (str, optional) – Name of the molecule. Defaults to None.

  • load (str, optional) – Path to a HDF5 file to load. Defaults to None.

  • save_scf_file (bool, optional) – Save the SCF file (when applicable). Defaults to False.

  • redo_scf (bool, optional) – If true, ignore existing HDF5 file and redo SCF calculation.

  • rank (int, optional) – Rank of the process. Defaults to 0.

  • mpi_size (int, optional) – Size of the MPI world.

Returns:

None

Examples

>>> from qmctorch.scf import Molecule
>>> mol = Molecule(atom='H 0 0 0; H 0 0 1', unit='angs',
...                calculator='adf', basis='dzp')
log_data() None[source]
domain(method: str) Dict[source]

Returns information to initialize the walkers

Parameters:

method (str) – ‘center’, all electron at the center of the system ‘uniform’, all electrons in a cube surrounding the molecule ‘normal’, all electrons in a sphere surrounding the molecule ‘atomic’, electrons around the atoms

Returns:

dictionary containing corresponding information

Return type:

dict

Examples::
>>> mol = Molecule('h2.xyz')
>>> domain = mol.domain('atomic')
print_total_energy() None[source]

Print the SCF energy of the molecule.

Examples::
>>> mol = Molecule('h2.xyz', calculator='adf', basis='sz')
>>> mol.print_total_energy()
get_total_energy() float[source]

Get the value of the total energy.

Module contents

class qmctorch.scf.Molecule(atom: str = None, calculator: str = 'adf', scf: str = 'hf', basis: str = 'dzp', unit: str = 'bohr', charge: int = 0, spin: int = 0, name: str = None, load: str = None, save_scf_file: bool = False, redo_scf: bool = False, rank: int = 0, mpi_size: int = 0)[source]

Bases: object

Create a molecule in QMCTorch

Parameters:
  • atom (str, optional) – Defines the atoms and their positions. Defaults to None. - At1 x y z; At2 x y z … : Provide the atomic coordinate directly - <file>.xyz : Provide the path to an .xyz file containing the atomic coordinates

  • calculator (str, optional) – Select SCF calculator. Defaults to ‘adf’. - ‘pyscf’ : PySCF calculator - ‘adf’ : ADF2020+ calculator - ‘adf2019’ : ADF2019 calculator

  • scf (str, optional) – Select SCF level of theory. Defaults to ‘hf’. - ‘hf’ : Hartree-Fock calculation - ‘dft’ : Density Functional Theory using LDA

  • charge (int, optional) – Extra charge on the molecule. Defaults to 0.

  • spin (int, optional) – Excess of spin-up electrons on the molecule. Defaults to 0.

  • basis (str, optional) – Select the basis set. Defaults to ‘dzp’.

  • unit (str, optional) – Units of the coordinates; ‘bohr’ or ‘angs’. Defaults to ‘bohr’.

  • name (str, optional) – Name of the molecule. Defaults to None.

  • load (str, optional) – Path to a HDF5 file to load. Defaults to None.

  • save_scf_file (bool, optional) – Save the SCF file (when applicable). Defaults to False.

  • redo_scf (bool, optional) – If true, ignore existing HDF5 file and redo SCF calculation.

  • rank (int, optional) – Rank of the process. Defaults to 0.

  • mpi_size (int, optional) – Size of the MPI world.

Returns:

None

Examples

>>> from qmctorch.scf import Molecule
>>> mol = Molecule(atom='H 0 0 0; H 0 0 1', unit='angs',
...                calculator='adf', basis='dzp')
log_data() None[source]
domain(method: str) Dict[source]

Returns information to initialize the walkers

Parameters:

method (str) – ‘center’, all electron at the center of the system ‘uniform’, all electrons in a cube surrounding the molecule ‘normal’, all electrons in a sphere surrounding the molecule ‘atomic’, electrons around the atoms

Returns:

dictionary containing corresponding information

Return type:

dict

Examples::
>>> mol = Molecule('h2.xyz')
>>> domain = mol.domain('atomic')
print_total_energy() None[source]

Print the SCF energy of the molecule.

Examples::
>>> mol = Molecule('h2.xyz', calculator='adf', basis='sz')
>>> mol.print_total_energy()
get_total_energy() float[source]

Get the value of the total energy.