PySCFDriver#

class PySCFDriver(atom='H 0.0 0.0 0.0; H 0.0 0.0 0.735', *, unit=DistanceUnit.ANGSTROM, charge=0, spin=0, basis='sto3g', method=MethodType.RHF, xc_functional='lda,vwn', xcf_library='libxc', conv_tol=1e-09, max_cycle=50, init_guess=InitialGuess.MINAO, max_memory=None, chkfile=None)[source]#

Bases: ElectronicStructureDriver

A Second-Quantization driver for Qiskit Nature using the PySCF library.

References

https://pyscf.org/

প্যারামিটার:
  • atom (str | list[str]) -- A string (or a list thereof) denoting the elements and coordinates of all atoms in the system. Two formats are allowed; first, the PySCF-style XYZ format which is a list of strings formatted as {element symbol} {x_coord} {y_coord} {z_coord}. If a single string is given, the list entries should be joined by ; as in the example: H 0.0 0.0 0.0; H 0.0 0.0 0.735. Second, the Z-Matrix format which is explained at 1. The previous example would be written as H; H 3 0.735. See also 2 for more details on geometry specifications supported by PySCF.

  • unit (DistanceUnit) -- Denotes the unit of coordinates. Valid values are given by the UnitsType enum.

  • charge (int) -- The charge of the molecule.

  • spin (int) -- The spin of the molecule. In accordance with PySCF's definition, the spin equals \(2*S\), where \(S\) is the total spin number of the molecule.

  • basis (str) -- A basis set name as recognized by PySCF (3), e.g. sto3g (the default), 321g, etc. Note, that more advanced configuration options like a Dictionary or custom basis sets are not allowed for the moment. Refer to 4 for an extensive list of PySCF's valid basis set names.

  • method (MethodType) -- The SCF method type to be used for the PySCF calculation. While the name refers to HF methods, the PySCFDriver also supports KS methods. Refer to the MethodType for a list of the supported methods.

  • xc_functional (str) -- One of the predefined Exchange-Correlation functional names as recognized by PySCF (5). Defaults to PySCF's default: 'lda,vwn'. __Note: this setting only has an effect when a KS method is chosen for method.__

  • xcf_library (str) -- The Exchange-Correlation functional library to be used. This can be either 'libxc' (the default) or 'xcfun'. Depending on this value, a different set of values for xc_functional will be available. Refer to 5 for more details.

  • conv_tol (float) -- The SCF convergence tolerance. See 6 for more details.

  • max_cycle (int) -- The maximum number of SCF iterations. See 6 for more details.

  • init_guess (InitialGuess) -- The method to make the initial guess for the SCF starting point. Valid values are given by the InitialGuess enum. See 6 for more details.

  • max_memory (int | None) -- The maximum memory that PySCF should use. See 6 for more details.

  • chkfile (str | None) -- The path to a PySCF checkpoint file from which to load a previously run calculation. The data stored in this file is assumed to be already converged. Refer to 6 and 7 for more details.

রেইজেস:

QiskitNatureError -- An invalid input was supplied.

Attributes

atom#

Returns the atom.

basis#

return basis

charge#

Returns the charge.

chkfile#

Returns the path to the PySCF checkpoint file.

conv_tol#

Returns the SCF convergence tolerance.

init_guess#

Returns the method for the initial guess.

max_cycle#

Returns the maximum number of SCF iterations.

max_memory#

Returns the maximum memory allowance for the calculation.

method#

Returns Hartree-Fock/Kohn-Sham method

spin#

Returns the spin.

unit#

Returns the unit.

xc_functional#

Returns the Exchange-Correlation functional.

xcf_library#

Returns the Exchange-Correlation functional library.

Methods

static check_method_supported(method)[source]#

Checks that PySCF supports this method.

প্যারামিটার:

method (MethodType) -- the SCF method type.

রেইজেস:

UnsupportMethodError -- If the method is not supported.

static from_molecule(molecule, *, basis='sto3g', method=MethodType.RHF, driver_kwargs=None)[source]#

Creates a driver from a molecule.

প্যারামিটার:
  • molecule (MoleculeInfo) -- the molecular information.

  • basis (str) -- the basis set.

  • method (MethodType) -- the SCF method type.

  • driver_kwargs (dict[str, Any] | None) -- keyword arguments to be passed to driver.

রিটার্নস:

The constructed driver instance.

রিটার্ন টাইপ:

PySCFDriver

run()[source]#

Runs the driver to produce a result.

রিটার্নস:

ElectronicStructureProblem produced by the run driver.

রেইজেস:

QiskitNatureError -- if an error during the PySCF setup or calculation occurred.

রিটার্ন টাইপ:

ElectronicStructureProblem

run_pyscf()[source]#

Runs the PySCF calculation.

This method is part of the public interface to allow the user to easily overwrite it in a subclass to further tailor the behavior to some specific use case.

রেইজেস:

QiskitNatureError -- If an invalid HF method type was supplied.

static to_driver_basis(basis)[source]#

Converts basis to a driver acceptable basis.

প্যারামিটার:

basis (str) -- The basis set to be used.

রিটার্নস:

A driver acceptable basis.

রিটার্ন টাইপ:

str

to_problem(*, basis=ElectronicBasis.MO, include_dipole=True)[source]#

Extends the to_qcschema() method and translates the QCSchema object to an ElectronicStructureProblem.

প্যারামিটার:
রিটার্নস:

An ElectronicStructureProblem.

রিটার্ন টাইপ:

ElectronicStructureProblem

to_qcschema(*, include_dipole=True)[source]#

Extracts all available information after the driver was run into a QCSchema object.

প্যারামিটার:

include_dipole (bool) -- whether or not to include the custom dipole integrals in the QCSchema.

রিটার্নস:

A QCSchema storing all extracted system data computed by the driver.

রিটার্ন টাইপ:

QCSchema