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)[fuente]#
Bases:
ElectronicStructureDriver
A Second-Quantization driver for Qiskit Nature using the PySCF library.
Referencias
- Parámetros:
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.
- Muestra:
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)[fuente]#
Checks that PySCF supports this method.
- Parámetros:
method (MethodType) – the SCF method type.
- Muestra:
UnsupportMethodError – If the method is not supported.
- static from_molecule(molecule, *, basis='sto3g', method=MethodType.RHF, driver_kwargs=None)[fuente]#
Creates a driver from a molecule.
- Parámetros:
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.
- Devuelve:
The constructed driver instance.
- Tipo del valor devuelto:
- run()[fuente]#
Runs the driver to produce a result.
- Devuelve:
ElectronicStructureProblem produced by the run driver.
- Muestra:
QiskitNatureError – if an error during the PySCF setup or calculation occurred.
- Tipo del valor devuelto:
- run_pyscf()[fuente]#
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.
- Muestra:
QiskitNatureError – If an invalid HF method type was supplied.
- to_problem(*, basis=ElectronicBasis.MO, include_dipole=True)[fuente]#
Extends the
to_qcschema()
method and translates theQCSchema
object to anElectronicStructureProblem
.- Parámetros:
basis (ElectronicBasis) – the
ElectronicBasis
in which to construct the problem.include_dipole (bool) – whether or not to include an
ElectronicDipoleMoment
property in the generated problem (if the data is available).
- Devuelve:
- Tipo del valor devuelto: