sunqm / qiskit-nature-pyscf

Documentation at https://qiskit-community.github.io/qiskit-nature-pyscf/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Qiskit Nature PySCF

LicenseBuild StatusCoverage Status

Qiskit Nature PySCF is a third-party integration plugin of Qiskit Nature + PySCF.

Installation

We encourage installing Qiskit Nature PySCF via the pip tool (a python package manager).

pip install qiskit-nature-pyscf

pip will handle all dependencies automatically and you will always install the latest (and well-tested) version. It will also install Qiskit Nature if needed.

If you want to work on the very latest work-in-progress versions, either to try features ahead of their official release or if you want to contribute to Qiskit Nature PySCF, then you can install from source.

Usage

This plugin couples the APIs of PySCF and Qiskit Nature, enabling a user of PySCF to leverage Quantum-based algorithms implemented in Qiskit to be used in-place of their classical counterparts.

Active Space Calculations

One very common approach is to use a Quantum algorithm to find the ground state in an active space calculation. To this extent, this plugin provides the QiskitSolver class, which you can inject directly into your CASCI or CASSCF simulation objects of PySCF.

Below we show a simple example of how to do this.

from pyscf import gto, scf, mcscf

from qiskit.algorithms.optimizers import SLSQP
from qiskit.primitives import Estimator
from qiskit_nature.second_q.algorithms import GroundStateEigensolver, VQEUCCFactory
from qiskit_nature.second_q.circuit.library import UCCSD
from qiskit_nature.second_q.mappers import ParityMapper, QubitConverter

from qiskit_nature_pyscf import QiskitSolver

mol = gto.M(atom="Li 0 0 0; H 0 0 1.6", basis="sto-3g")

h_f = scf.RHF(mol).run()

norb, nelec = 2, 2

cas = mcscf.CASCI(h_f, norb, nelec)

converter = QubitConverter(ParityMapper(), two_qubit_reduction=True)

vqe = VQEUCCFactory(Estimator(), UCCSD(), SLSQP())

algorithm = GroundStateEigensolver(converter, vqe)

cas.fcisolver = QiskitSolver(algorithm)

cas.run()

More detailed documentation can be found at Documentation. For more detailed explanations we recommend to check out the documentation of PySCF and Qiskit Nature.

About

Documentation at https://qiskit-community.github.io/qiskit-nature-pyscf/

License:Apache License 2.0


Languages

Language:Python 93.2%Language:Makefile 4.1%Language:Shell 2.7%