quantumBENCH is a Python package for benchmarking quantum computers and their performance of the Variational Quantum Eigensolver (VQE) on chemical systems. This package aims to contribute to materials discovery and design by providing tools for quantum chemistry simulations.
- Generate qubit operators from molecular data
- Compute energies using VQE and classical solvers
- Supports various quantum devices and optimizers
You can install the package using pip. First, clone the repository:
git clone https://github.com/niapollard/quantumBENCH.git
cd quantumBENCHThen install the package:
pip install .You can find installation examples in Google Colab notebooks below
| Notebooks | Google Colab | Descriptions |
|---|---|---|
| Cube File Generation | Example of cube file generation for electronic denisty visualization.. | |
| Bond Distance Plot | Example of varying the bond distance between two Aluminum atoms with plot. | |
| Classical Optimizer Variation | Example of obtaining VQE energies with varied classical optimizers. | |
| Quantum Circuit Variation | Example of obtaining VQE energies with varied quantum circuit type (circuits obtained from Jarvis-tools). | |
| Varying Number of Repetitions | Example of obtaining VQE energies with varied number of quantum circuit repetitions. | |
| Quantum Simulator Variation | Example of obtaining VQE energies with varied quantum simulator type. | |
| Varying Basis Sets | Example of obtaining VQE energies with varied basis set type. |
Here's an example of how to use the package:
from quantum_vqe import get_qubit_op, get_energy
from qiskit.algorithms.optimizers import SLSQP
from qiskit.providers.aer import AerSimulator
from qiskit_nature.drivers import Molecule
from qiskit_nature.mappers.second_quantization import JordanWignerMapper
# Define a molecule
molecule = Molecule(geometry=[['H', [0., 0., 0.]], ['H', [0., 0., 0.735]]], multiplicity=1, charge=0)
# Get the qubit operator
res1 = get_qubit_op(molecule)
# Define an optimizer and quantum device
optimizer = SLSQP(maxiter=1000)
device = Aer.get_backend('statevector_simulator')
# Compute the energy
res = get_energy(optimizer, device, res1['qubit_op'])
print("Computed Energy:", res['eigenvalue'])get_qubit_op(molecule, basis='sto3g', functional='lda', method=MethodType.RKS, driver_type=ElectronicStructureDriverType.PYSCF, mapper=JordanWignerMapper())molecule: The molecule to be simulated.basis: The basis set to be used (default: 'sto3g').functional: The functional to be used (default: 'lda').method: The method to be used (default:MethodType.RKS).driver_type: The electronic structure driver type (default:ElectronicStructureDriverType.PYSCF).mapper: The mapper to convert to qubit operator (default:JordanWignerMapper).
Returns a dictionary with the keys:
qubit_op: The qubit operator.converter: The qubit converter.problem_reduced: The reduced electronic structure problem.numpy_solver: The numpy solver.
get_energy(optimizer, device, qubit_op, seed=42, reps=1)optimizer: The optimizer to be used.device: The quantum device to be used.qubit_op: The qubit operator.seed: The seed for the random number generator (default: 42).reps: The number of repetitions (default: 1).
Returns a dictionary with the keys:
eigenvalue: The computed eigenvalue.vqe: The VQE instance.qi: The quantum instance.
Contributions are welcome! Please submit a pull request or open an issue to discuss changes.
This project is licensed under the NIST License - see the LICENSE file for details.
- This package uses Qiskit, an open-source SDK for working with quantum computers.
Note: This project was originally developed under the github.com/usnistgov organization. New updates and developments will be carried out here.
For more information, please contact Nia Pollard.
Replace `https://github.com/yourusername/quantum_vqe.git` and `your.email@example.com` with your actual GitHub repository URL and email address. This `README.md` provides a comprehensive guide to installing, using, and contributing to your package.