quantum-vqe


Namequantum-vqe JSON
Version 0.1.2.1 PyPI version JSON
download
home_pagehttps://github.com/SweatyCrayfish/quantum_vqe
SummaryA quantum VQE package
upload_time2023-11-03 22:12:03
maintainer
docs_urlNone
authorViktor Veselov
requires_python
license
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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:
```bash
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:
```python
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:
```python
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:
```bash
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}}
}

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/SweatyCrayfish/quantum_vqe",
    "name": "quantum-vqe",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "",
    "author": "Viktor Veselov",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/aa/3d/7ec99f7daa7c41639ee59ca5168530a010f5e84ac3790a72fd3fdad2bc57/quantum_vqe-0.1.2.1.tar.gz",
    "platform": null,
    "description": "# Quantum VQE Package\r\n\r\nThe 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.\r\n\r\n# Features\r\n\r\n- Implementation of the VQE algorithm using Qiskit.\r\n- Functions to create variational ansatzes for quantum circuits.\r\n- Optimization routines to find the minimum eigenvalue of the Hamiltonian.\r\n- Utilities for validating input Hamiltonians.\r\n\r\n# Installation\r\n\r\nBefore installing the Quantum VQE package, ensure that you have Python 3.7 or higher and pip installed.\r\n\r\nTo install the Quantum VQE package, run the following command in your terminal:\r\n```\r\npip install git+https://github.com/SweatyCrayfish/quantum_vqe.git\r\n```\r\nAlternatively, you can clone the repository and install the package locally:\r\n```bash\r\ngit clone https://github.com/SweatyCrayfish/quantum_vqe.git\r\ncd quantum_vqe\r\npip install .\r\n```\r\n# Usage\r\n\r\nHere is a simple example of how to use the Quantum VQE package to find the ground state energy of a Hamiltonian:\r\n```python\r\nfrom qiskit.opflow import X, Z, I\r\nfrom quantum_vqe.vqe import create_vqe_ansatz, optimize_vqe\r\nfrom qiskit import Aer\r\n```\r\nDefine your Hamiltonian. For example, for a simple 2-qubit system:\r\n```python\r\nhamiltonian = (X ^ X) + (Z ^ I)\r\nDefine the quantum backend\r\nbackend = Aer.get_backend('statevector_simulator')\r\ncircuit, parameters = create_vqe_ansatz(num_qubits=2)\r\nOptimize the circuit parameters\r\nresult = optimize_vqe(circuit, hamiltonian, backend)\r\nprint(f\"Ground state energy: {result.fun}\")\r\n```\r\nFor more detailed examples, please refer to the examples/ directory in the repository.\r\n\r\n# Development\r\n\r\nTo contribute to the Quantum VQE package, you can clone the repository and set up a development environment:\r\n```bash\r\ngit clone https://github.com/SweatyCrayfish/quantum_vqe.git\r\ncd quantum_vqe\r\npip install -e .\r\n```\r\n# Testing\r\n\r\nTo run the tests for the Quantum VQE package, navigate to the package root and execute:\r\n```\r\npython -m unittest discover tests\r\n```\r\n# License\r\n\r\nThis project is licensed under the MIT License - see the LICENSE file for details.\r\n\r\n# Authors\r\n\r\n- Viktor Veselov - Initial work\r\n\r\n# Acknowledgments\r\n\r\n- The Qiskit community for providing the framework to build upon.\r\n\r\n# Citation\r\n\r\nIf you use this package in your research, please cite it as follows:\r\n\r\n@misc{quantum_vqe,\r\n  author = {Viktor Veselov},\r\n  title = {Quantum VQE: A Variational Quantum Eigensolver Package},\r\n  year = {2023},\r\n  publisher = {GitHub},\r\n  journal = {GitHub repository},\r\n  howpublished = {url{https://github.com/SweatyCrayfish/quantum_vqe}}\r\n}\r\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "A quantum VQE package",
    "version": "0.1.2.1",
    "project_urls": {
        "Homepage": "https://github.com/SweatyCrayfish/quantum_vqe"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5e8e302a56085afc788145888a79661a83c4429e3b8858271a9c313844c6d045",
                "md5": "1b27052383ab96e8ba343e447346383d",
                "sha256": "b6a851ccc774400cf461bf9aee6e5ea4a5d13eadb7df9eb501c861e971c848da"
            },
            "downloads": -1,
            "filename": "quantum_vqe-0.1.2.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "1b27052383ab96e8ba343e447346383d",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 5685,
            "upload_time": "2023-11-03T22:12:02",
            "upload_time_iso_8601": "2023-11-03T22:12:02.449012Z",
            "url": "https://files.pythonhosted.org/packages/5e/8e/302a56085afc788145888a79661a83c4429e3b8858271a9c313844c6d045/quantum_vqe-0.1.2.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "aa3d7ec99f7daa7c41639ee59ca5168530a010f5e84ac3790a72fd3fdad2bc57",
                "md5": "d0752c845e3d6b1e7deca909e10b01c9",
                "sha256": "4014eb863ee41b9fa0ccae433039e50877f6ea483a7ecf38658c7fc087b256b4"
            },
            "downloads": -1,
            "filename": "quantum_vqe-0.1.2.1.tar.gz",
            "has_sig": false,
            "md5_digest": "d0752c845e3d6b1e7deca909e10b01c9",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 4455,
            "upload_time": "2023-11-03T22:12:03",
            "upload_time_iso_8601": "2023-11-03T22:12:03.670062Z",
            "url": "https://files.pythonhosted.org/packages/aa/3d/7ec99f7daa7c41639ee59ca5168530a010f5e84ac3790a72fd3fdad2bc57/quantum_vqe-0.1.2.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-11-03 22:12:03",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "SweatyCrayfish",
    "github_project": "quantum_vqe",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "quantum-vqe"
}
        
Elapsed time: 0.81939s