PySCFGroundStateSolver#
- class PySCFGroundStateSolver(solver)[source]#
Bases:
GroundStateSolver
A PySCF-based GroundStateSolver for Qiskit Nature.
This class provides a
GroundStateSolver
for Qiskit Nature, leveraging thefci
module of PySCF. This is utility does not enable any Quantum algorithms to be used (since it replaces them in the Qiskit workflow) but instead provides a useful utility for debugging classical computational workflows based on Qiskit Nature. More importantly, it provides a more efficient implementation of what Qiskit otherwise achieves using aNumPyMinimumEigensolver
in combination with afilter_criterion
. For non-singlet spin ground states the setup using Qiskit components is a lot more involved, whereas this class provides an easy-to-use alternative.Here is an example use cas:
from pyscf import fci from qiskit_nature.second_q.drivers import MethodType, PySCFDriver from qiskit_nature.second_q.transformers import ActiveSpaceTransformer from qiskit_nature_pyscf import PySCFGroundStateSolver driver = PySCFDriver( atom="O 0.0 0.0 0.0; O 0.0 0.0 1.5", basis="sto3g", spin=2, method=MethodType.UHF, ) problem = driver.run() transformer = ActiveSpaceTransformer(4, 4) problem = transformer.transform(problem) solver = PySCFGroundStateSolver(fci.direct_uhf.FCI()) result = solver.solve(problem) print(result)
For more details please to the documentation of PySCF and Qiskit Nature.
- Parameters:
solver (fci.direct_spin1.FCISolver) – a FCI solver provided by PySCF.
Attributes
Returns the qubit mapper.
Returns the solver.
Methods
get_qubit_operators
(problem[, aux_operators])This solver does not deal with qubit operators and this method raises a RuntimeError.
solve
(problem[, aux_operators])Finds the ground-state of the provided problem.
Returns whether the eigensolver supports auxiliary operators.