Qiskit Nature PySCF: Third-party integration plugin of Qiskit Nature + PySCF.
Project description
Qiskit Nature PySCF
Qiskit Nature PySCF is a third-party integration plugin of Qiskit Nature + PySCF.
Installation
We encourage installing Qiskit Nature 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.
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.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file qiskit-nature-pyscf-0.1.0.tar.gz
.
File metadata
- Download URL: qiskit-nature-pyscf-0.1.0.tar.gz
- Upload date:
- Size: 12.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.7.15
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 168bf7ca5c8ac09048c591d0a67a917aa4fe6ff550a5799bd0be880b67c66848 |
|
MD5 | 39253634b62adc3b403b499f612c6b04 |
|
BLAKE2b-256 | d75dbf09c73e59f8d5c02770853682cfa6e601c000a12740254cde0261bce7a7 |
File details
Details for the file qiskit_nature_pyscf-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: qiskit_nature_pyscf-0.1.0-py3-none-any.whl
- Upload date:
- Size: 11.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.7.15
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d513491ddfce8ec88889219cacf4d68aed34f996587fa8414160b4be0beecc94 |
|
MD5 | 3d711274a74e1b81b5ea299bf58837f7 |
|
BLAKE2b-256 | 46d75a5f745fb9b2cd882b87913ab518f4cd33ce6cd0942886711143760e3906 |