qmctorch.scf.calculator package

Submodules

qmctorch.scf.calculator.adf module

class qmctorch.scf.calculator.adf.CalculatorADF(atoms: list, atom_coords: list, basis: str, charge: int, spin: int, scf: str, units: str, molname: str, savefile: str)[source]

Bases: CalculatorBase

Initialize the ADF calculator.

Parameters:
  • atoms (list) – List of atom symbols.

  • atom_coords (list) – List of atomic coordinates.

  • basis (str) – Basis set name.

  • charge (int) – Molecular charge.

  • spin (int) – Spin multiplicity.

  • scf (str) – Self-consistent field method.

  • units (str) – Units for atomic coordinates.

  • molname (str) – Molecule name.

  • savefile (str) – File name to save results.

Raises:

ValueError – If charge or spin is not supported.

Returns:

None

run() SimpleNamespace[source]

Run the calculation using ADF.

init_plams() None[source]

Init PLAMS.

finish_plams() None[source]

Finish PLAMS.

get_plams_molecule() scm.plams.Molecule[source]

Returns a plams molecule object.

get_plams_settings() scm.plams.Settings[source]

Returns a plams setting object.

Returns:

A plams setting object.

Return type:

plams.Settings

get_basis_data(kffile: str) SimpleNamespace[source]

Save the basis information needed to compute the AO values.

Parameters:

kffile (str) – Path to the KF file.

Returns:

A namespace containing the basis information.

Return type:

SimpleNamespace

static read_array(kf: BinaryIO, section: str, name: str) numpy.ndarray[source]

read a data from the kf file

Parameters:
  • kf (BinaryIO) – kf file

  • section (str) – name of the section

  • name (str) – name of the property

Returns:

data

Return type:

np.ndarray

class qmctorch.scf.calculator.adf.CalculatorADF2019(atoms: List[str], atom_coords: List[numpy.ndarray], basis: str, charge: int, spin: int, scf: str, units: str, molname: str, savefile: str)[source]

Bases: CalculatorADF

Initialize the ADF2019 calculator.

Parameters:
  • atoms (list) – List of atom symbols.

  • atom_coords (list) – List of atomic coordinates.

  • basis (str) – Basis set name.

  • charge (int) – Molecular charge.

  • spin (int) – Spin multiplicity.

  • scf (str) – Self-consistent field method.

  • units (str) – Units of the coordinates; ‘bohr’ or ‘angs’.

  • molname (str) – Molecule name.

  • savefile (str) – File name to save results.

Returns:

None

get_plams_molecule() scm.plams.Molecule[source]

Returns a plams molecule object.

Returns:

A plams molecule object.

Return type:

plams.Molecule

get_plams_settings() scm.plams.Settings[source]

Returns a plams setting object.

Returns:

A plams setting object.

Return type:

plams.Settings

qmctorch.scf.calculator.calculator_base module

class qmctorch.scf.calculator.calculator_base.CalculatorBase(atoms, atom_coords, basis, charge, spin, scf, units, molname, calcname, savefile)[source]

Bases: object

run()[source]
save_data()[source]
static normalize_columns(mat)[source]

Normalize a matrix column-wise.

Parameters:

normalized (mat {np.ndarray} -- the matrix to be)

Returns:

np.ndarray – normalized matrix

qmctorch.scf.calculator.pyscf module

class qmctorch.scf.calculator.pyscf.CalculatorPySCF(atoms: List[str], atom_coords: List[numpy.ndarray], basis: str, charge: int, spin: int, scf: str, units: str, molname: str, savefile: str)[source]

Bases: CalculatorBase

Initialize the PySCF calculator.

Parameters:
  • atoms (list) – List of atom symbols.

  • atom_coords (list) – List of atomic coordinates.

  • basis (str) – Basis set name.

  • charge (int) – Molecular charge.

  • spin (int) – Spin multiplicity.

  • scf (str) – Self-consistent field method.

  • units (str) – Units of the coordinates; ‘bohr’ or ‘angs’.

  • molname (str) – Molecule name.

  • savefile (str) – File name to save results.

Returns:

None

run() SimpleNamespace[source]

Run the scf calculation using PySCF.

Returns:

Contains the basis set data.

Return type:

SimpleNamespace

get_basis_data(mol: pyscf.gto.M, rhf: pyscf.scf.RHF) SimpleNamespace[source]

Get the information about the basis

Parameters:
  • Molecule (mol {pyscf.gto.M} -- psycf)

  • object (rhf {pyscf.scf} -- scf)

Returns:

SimpleNamespace – basis data

get_atoms_str() str[source]

Refresh the atom string (use after atom move).

static get_bas_n(mol: pyscf.gto.M) List[str][source]

Module contents

class qmctorch.scf.calculator.CalculatorBase(atoms, atom_coords, basis, charge, spin, scf, units, molname, calcname, savefile)[source]

Bases: object

run()[source]
save_data()[source]
static normalize_columns(mat)[source]

Normalize a matrix column-wise.

Parameters:

normalized (mat {np.ndarray} -- the matrix to be)

Returns:

np.ndarray – normalized matrix

class qmctorch.scf.calculator.CalculatorADF(atoms: list, atom_coords: list, basis: str, charge: int, spin: int, scf: str, units: str, molname: str, savefile: str)[source]

Bases: CalculatorBase

Initialize the ADF calculator.

Parameters:
  • atoms (list) – List of atom symbols.

  • atom_coords (list) – List of atomic coordinates.

  • basis (str) – Basis set name.

  • charge (int) – Molecular charge.

  • spin (int) – Spin multiplicity.

  • scf (str) – Self-consistent field method.

  • units (str) – Units for atomic coordinates.

  • molname (str) – Molecule name.

  • savefile (str) – File name to save results.

Raises:

ValueError – If charge or spin is not supported.

Returns:

None

run() SimpleNamespace[source]

Run the calculation using ADF.

init_plams() None[source]

Init PLAMS.

finish_plams() None[source]

Finish PLAMS.

get_plams_molecule() scm.plams.Molecule[source]

Returns a plams molecule object.

get_plams_settings() scm.plams.Settings[source]

Returns a plams setting object.

Returns:

A plams setting object.

Return type:

plams.Settings

get_basis_data(kffile: str) SimpleNamespace[source]

Save the basis information needed to compute the AO values.

Parameters:

kffile (str) – Path to the KF file.

Returns:

A namespace containing the basis information.

Return type:

SimpleNamespace

static read_array(kf: BinaryIO, section: str, name: str) numpy.ndarray[source]

read a data from the kf file

Parameters:
  • kf (BinaryIO) – kf file

  • section (str) – name of the section

  • name (str) – name of the property

Returns:

data

Return type:

np.ndarray

class qmctorch.scf.calculator.CalculatorADF2019(atoms: List[str], atom_coords: List[numpy.ndarray], basis: str, charge: int, spin: int, scf: str, units: str, molname: str, savefile: str)[source]

Bases: CalculatorADF

Initialize the ADF2019 calculator.

Parameters:
  • atoms (list) – List of atom symbols.

  • atom_coords (list) – List of atomic coordinates.

  • basis (str) – Basis set name.

  • charge (int) – Molecular charge.

  • spin (int) – Spin multiplicity.

  • scf (str) – Self-consistent field method.

  • units (str) – Units of the coordinates; ‘bohr’ or ‘angs’.

  • molname (str) – Molecule name.

  • savefile (str) – File name to save results.

Returns:

None

get_plams_molecule() scm.plams.Molecule[source]

Returns a plams molecule object.

Returns:

A plams molecule object.

Return type:

plams.Molecule

get_plams_settings() scm.plams.Settings[source]

Returns a plams setting object.

Returns:

A plams setting object.

Return type:

plams.Settings

class qmctorch.scf.calculator.CalculatorPySCF(atoms: List[str], atom_coords: List[numpy.ndarray], basis: str, charge: int, spin: int, scf: str, units: str, molname: str, savefile: str)[source]

Bases: CalculatorBase

Initialize the PySCF calculator.

Parameters:
  • atoms (list) – List of atom symbols.

  • atom_coords (list) – List of atomic coordinates.

  • basis (str) – Basis set name.

  • charge (int) – Molecular charge.

  • spin (int) – Spin multiplicity.

  • scf (str) – Self-consistent field method.

  • units (str) – Units of the coordinates; ‘bohr’ or ‘angs’.

  • molname (str) – Molecule name.

  • savefile (str) – File name to save results.

Returns:

None

run() SimpleNamespace[source]

Run the scf calculation using PySCF.

Returns:

Contains the basis set data.

Return type:

SimpleNamespace

get_basis_data(mol: pyscf.gto.M, rhf: pyscf.scf.RHF) SimpleNamespace[source]

Get the information about the basis

Parameters:
  • Molecule (mol {pyscf.gto.M} -- psycf)

  • object (rhf {pyscf.scf} -- scf)

Returns:

SimpleNamespace – basis data

get_atoms_str() str[source]

Refresh the atom string (use after atom move).

static get_bas_n(mol: pyscf.gto.M) List[str][source]