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)[ソース]#

ベースクラス: ElectronicStructureDriver

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

参照

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)[ソース]#

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)[ソース]#

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()[ソース]#

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()[ソース]#

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)[ソース]#

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)[ソース]#

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

パラメータ:
戻り値:

An ElectronicStructureProblem.

戻り値の型:

ElectronicStructureProblem

to_qcschema(*, include_dipole=True)[ソース]#

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