A quantum VQE package
Project description
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}} }
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 quantum_vqe-0.1.2.1.tar.gz
.
File metadata
- Download URL: quantum_vqe-0.1.2.1.tar.gz
- Upload date:
- Size: 4.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.11
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4014eb863ee41b9fa0ccae433039e50877f6ea483a7ecf38658c7fc087b256b4 |
|
MD5 | d0752c845e3d6b1e7deca909e10b01c9 |
|
BLAKE2b-256 | aa3d7ec99f7daa7c41639ee59ca5168530a010f5e84ac3790a72fd3fdad2bc57 |
File details
Details for the file quantum_vqe-0.1.2.1-py3-none-any.whl
.
File metadata
- Download URL: quantum_vqe-0.1.2.1-py3-none-any.whl
- Upload date:
- Size: 5.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.11
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b6a851ccc774400cf461bf9aee6e5ea4a5d13eadb7df9eb501c861e971c848da |
|
MD5 | 1b27052383ab96e8ba343e447346383d |
|
BLAKE2b-256 | 5e8e302a56085afc788145888a79661a83c4429e3b8858271a9c313844c6d045 |