Skip to main content

Quantum VQE Package

The Quantum VQE (Variational Quantum Eigensolver) package is a Python library for simulating the VQE algorithm on quantum computers. It utilizes the Qiskit framework to create and optimize quantum circuits that estimate the ground state energy of a given Hamiltonian.

Features

  • Implementation of the VQE algorithm using Qiskit.
  • Functions to create variational ansatzes for quantum circuits.
  • Optimization routines to find the minimum eigenvalue of the Hamiltonian.
  • Utilities for validating input Hamiltonians.

Installation

Before installing the Quantum VQE package, ensure that you have Python 3.7 or higher and pip installed.

To install the Quantum VQE package, run the following command in your terminal:

pip install git+https://github.com/SweatyCrayfish/quantum_vqe.git

Alternatively, you can clone the repository and install the package locally:

git clone https://github.com/SweatyCrayfish/quantum_vqe.git
cd quantum_vqe
pip install .

Usage

Here is a simple example of how to use the Quantum VQE package to find the ground state energy of a Hamiltonian:

from qiskit.opflow import X, Z, I
from quantum_vqe.vqe import create_vqe_ansatz, optimize_vqe
from qiskit import Aer

Define your Hamiltonian. For example, for a simple 2-qubit system:

hamiltonian = (X ^ X) + (Z ^ I)
Define the quantum backend
backend = Aer.get_backend('statevector_simulator')
circuit, parameters = create_vqe_ansatz(num_qubits=2)
Optimize the circuit parameters
result = optimize_vqe(circuit, hamiltonian, backend)
print(f"Ground state energy: {result.fun}")

For more detailed examples, please refer to the examples/ directory in the repository.

Development

To contribute to the Quantum VQE package, you can clone the repository and set up a development environment:

git clone https://github.com/SweatyCrayfish/quantum_vqe.git
cd quantum_vqe
pip install -e .

Testing

To run the tests for the Quantum VQE package, navigate to the package root and execute:

python -m unittest discover tests

License

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

Authors

  • Viktor Veselov - Initial work

Acknowledgments

  • The Qiskit community for providing the framework to build upon.

Citation

If you use this package in your research, please cite it as follows:

@misc{quantum_vqe, author = {Viktor Veselov}, title = {Quantum VQE: A Variational Quantum Eigensolver Package}, year = {2023}, publisher = {GitHub}, journal = {GitHub repository}, howpublished = {url{https://github.com/SweatyCrayfish/quantum_vqe}} }

Metadata

Release files for quantum-vqe 0.1.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for quantum-vqe 0.1.2.1
File Size Uploaded
quantum_vqe-0.1.2.1.tar.gz 4.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for quantum-vqe 0.1.2.1
File Interpreter ABI Platform
quantum_vqe-0.1.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 10.1 kB

Release files / quantum_vqe-0.1.2.1.tar.gz

Download URL quantum_vqe-0.1.2.1.tar.gz
Size 4.5 kB
Tags Source
SHA-256 checksum
How to use checksums
4014eb863ee41b9fa0ccae433039e50877f6ea483a7ecf38658c7fc087b256b4
BLAKE2b-256 checksum
How to use checksums
aa3d7ec99f7daa7c41639ee59ca5168530a010f5e84ac3790a72fd3fdad2bc57
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.11

Release files / quantum_vqe-0.1.2.1-py3-none-any.whl

Download URL quantum_vqe-0.1.2.1-py3-none-any.whl
Size 5.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b6a851ccc774400cf461bf9aee6e5ea4a5d13eadb7df9eb501c861e971c848da
BLAKE2b-256 checksum
How to use checksums
5e8e302a56085afc788145888a79661a83c4429e3b8858271a9c313844c6d045
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.11

Release history Release notifications | RSS feed

This release

0.1.2.1 This release

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page