Qiskit Nature PySCF
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
import numpy as np
from qiskit.primitives import Estimator
from qiskit_algorithms import VQE
from qiskit_algorithms.optimizers import SLSQP
from qiskit_nature.second_q.algorithms import GroundStateEigensolver
from qiskit_nature.second_q.circuit.library import HartreeFock, UCCSD
from qiskit_nature.second_q.mappers import ParityMapper
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 = 2
nalpha, nbeta = 1, 1
nelec = nalpha + nbeta
cas = mcscf.CASCI(h_f, norb, nelec)
mapper = ParityMapper(num_particles=(nalpha, nbeta))
ansatz = UCCSD(
norb,
(nalpha, nbeta),
mapper,
initial_state=HartreeFock(
norb,
(nalpha, nbeta),
mapper,
),
)
vqe = VQE(Estimator(), ansatz, SLSQP())
vqe.initial_point = np.zeros(ansatz.num_parameters)
algorithm = GroundStateEigensolver(mapper, vqe)
cas.fcisolver = QiskitSolver(algorithm)
cas.run()
More detailed information for this plugin can be found in its Documentation. For further information and explanations we recommend to check out the documentation of PySCF and Qiskit Nature.
Citation
If you use this plugin, please cite the following references:
- PySCF, as per these instructions.
- Qiskit, as per the provided BibTeX file.
- Qiskit Nature, as per https://doi.org/10.5281/zenodo.7828767
Metadata
Release files for qiskit-nature-pyscf 0.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| qiskit-nature-pyscf-0.4.0.tar.gz | 17.7 kB | Without provenance | Details for qiskit-nature-pyscf-0.4.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| qiskit_nature_pyscf-0.4.0-py3-none-any.whl | Python 3 | none | any | Details for qiskit_nature_pyscf-0.4.0-py3-none-any.whl |
Total release size: 33.5 kB
Release files / qiskit-nature-pyscf-0.4.0.tar.gz
| Download URL | qiskit-nature-pyscf-0.4.0.tar.gz |
|---|---|
| Size | 17.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6a2440ecf5992006f04f571e5f8ea2b1c44702733e9bb8a1a9d36545bd0c981a
|
|
BLAKE2b-256 checksum How to use checksums |
4b568550c157ecb66e0b999c53c4ad4568ba3539f93dbe3d2740ce9e233af1f3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/4.0.2 CPython/3.11.8
|
Release files / qiskit_nature_pyscf-0.4.0-py3-none-any.whl
| Download URL | qiskit_nature_pyscf-0.4.0-py3-none-any.whl |
|---|---|
| Size | 15.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
833910cca49dc625d432fd01068185dbca5da27a54db9a0f1f7263f172bb533b
|
|
BLAKE2b-256 checksum How to use checksums |
d2f84c6bf854ef1cd6baaa3b167ede4094af74f1e5487c597230e69a17c14d1a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/4.0.2 CPython/3.11.8
|
Security for qiskit-nature-pyscf 0.4.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.