Skip to content

atomgptlab/benchqc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 

Repository files navigation

BenchQC

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.

Features

  • Generate qubit operators from molecular data
  • Compute energies using VQE and classical solvers
  • Supports various quantum devices and optimizers

Installation

You can install the package using pip. First, clone the repository:

git clone https://github.com/niapollard/quantumBENCH.git
cd quantumBENCH

Then install the package:

pip install .

You can find installation examples in Google Colab notebooks below

Examples

Notebooks Google Colab Descriptions
Cube File Generation Open in Google Colab Example of cube file generation for electronic denisty visualization..
Bond Distance Plot Open in Google Colab Example of varying the bond distance between two Aluminum atoms with plot.
Classical Optimizer Variation Open in Google Colab Example of obtaining VQE energies with varied classical optimizers.
Quantum Circuit Variation Open in Google Colab Example of obtaining VQE energies with varied quantum circuit type (circuits obtained from Jarvis-tools).
Varying Number of Repetitions Open in Google Colab Example of obtaining VQE energies with varied number of quantum circuit repetitions.
Quantum Simulator Variation Open in Google Colab Example of obtaining VQE energies with varied quantum simulator type.
Varying Basis Sets Open in Google Colab Example of obtaining VQE energies with varied basis set type.

Usage

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'])

API Reference

get_qubit_op

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

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.

Contributing

Contributions are welcome! Please submit a pull request or open an issue to discuss changes.

License

This project is licensed under the NIST License - see the LICENSE file for details.

Acknowledgments

  • 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.

Contact

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.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages