# VqePy
## Installation
VqePy requires Python 3.9 or newer.
To install VqePy on macOS or Linux, open a terminal and run:
```Shell
python3 -m pip install vqepy
```
Other way to do it, is clone the repository and and call all the functions adding the PATH.
## Tesis project
This library was a project to get a degree in computer science in the UTFSM University.
The main idea is implement a few variational quantum algorithms to study condensed matter and chemistry models and give a basic template to study complex phenomena. This project didnt want to be another quantum library. This should be see as a high level implementation to study systems with a fixed route to be executed, so, the user only need to give the parameters and just the minimun programming is needed.
## Parameters
Here, all the parameters of each class are listed.
### Hamiltonians
#### Molecules
The parameters considered here, come from the definition of the methods defined in pennylane [Molecular](https://docs.pennylane.ai/en/stable/code/api/pennylane.qchem.molecular_hamiltonian.html#pennylane.qchem.molecular_hamiltonian). Here we list the ones considered:
1. Mapping (mapping).
2. Charge (charge).
3. Multiplicity (mult).
4. Basis set (basis).
5. Differential method (method).
6. Active electrons (active_electrons).
7. Active orbitals (active_orbitals).
We recomended to not let any of this as a None value, to have a correct execution.
#### Fermi-Hubbard
The parameters considered here, come from the definition of the hamiltonian indicated here [Tenpy Hamiltonian](https://tenpy.readthedocs.io/en/latest/reference/tenpy.models.hubbard.FermiHubbardModel.html#tenpy.models.hubbard.FermiHubbardModel). Here we list the ones considerated:
1. t hopping (hopping).
2. On-site potencial U (U).
3. Potencial V (V).
4. Electric field (E).
5. Number of sites (sites).
We recomended to not let any of this as a None value, to have a correct execution.
#### Fermi-Hubbard
The parameters considered here, come from the definition of the hamiltonian indicated here [Wikipedia Hamiltonian](https://en.wikipedia.org/wiki/Quantum_Heisenberg_model). Here we list the ones considerated:
1. Exchange's vector (J): [Jx, Jy, Jz] .
2. Magnetic field's vector (h): [hx, hy, hz] .
3. Number of spins (sites).
The values of the exchange and magnetic field are the same for all the corresponding terms. We recomended to not let any of this as a None value, to have a correct execution.
### Ansatz
Here there are a lot of element of the base library to take into account, i recommended review:
1. [Base](https://docs.pennylane.ai/en/stable/code/qml_devices.html)
2. [Interface](https://docs.pennylane.ai/en/stable/code/qml_interfaces.html)
3. [Differential method](https://docs.pennylane.ai/en/stable/introduction/interfaces.html)
#### UCCSD Ansatz
This ansatz should be use with molecules and Fermi-Hubbard hamiltonian
1. Number of repetitions of the curcuit (repetitions): Here the number should 1
2. Base structure for circuits execution(base)
3. Interface of execution of the circuits (interface)
4. Number of electrons of the system (electrons)
5. Number of qubits of the circuit (qubits).
6. Differential method of the ansatz (diff_method): adjoint and best is recommended.
#### k-UpCCGSD Ansatz
This ansatz should be use with molecules and Fermi-Hubbard hamiltonian
1. Number of repetitions of the curcuit (repetitions)
2. Base structure for circuits execution(base)
3. Interface of execution of the circuits (interface)
4. Number of electrons of the system (electrons)
5. Number of qubits of the circuit (qubits).
6. Differential method of the ansatz (diff_method): adjoint and best is recommended.
#### Hardware Efficient Ansatz
This ansatz should be use with spin system
1. Number of repetitions of the curcuit (repetitions)
2. Base structure for circuits execution(base)
3. Interface of execution of the circuits (interface)
4. Number of electrons of the system (electrons)
5. Number of qubits of the circuit (qubits).
6. Differential method of the ansatz (diff_method): adjoint and best is recommended.
7. Pattern of the non local gates (pattert): chain or ring
There also the begin state of size 2**n that is needed.
#### Custom Ansatz
This ansatz should be use with molecules and Fermi-Hubbard hamiltonian
1. Number of repetitions of the curcuit (repetitions)
2. Base structure for circuits execution(base)
3. Interface of execution of the circuits (interface)
4. Number of electrons of the system (electrons)
5. Number of qubits of the circuit (qubits).
6. Differential method of the ansatz (diff_method): adjoint and best is recommended.
Other elements are the set of singles and doubled given gates obteined from the ADAPT-VQE. There also the begin state of size 2**n.
### Optimizers
#### Pennylane's optimizers
1. Number of parameters (number).
2. Maximum number of iterations (maxiter).
3. Theta optimizer (theta): list of optimizer (generic, adam or adagrad) and learning rate.
4. X optimizer (x): list of optimizer (generic, adam or adagrad) and learning rate.
5. Tolerance of relative error (tol).
#### Scipy's optimizers
1. Number of parameters (number).
2. Maximum number of iterations (maxiter).
3. Optimizer [scipy method section](https://docs.scipy.org/doc/scipy/reference/generated/scipy.optimize.minimize.html) (type).
4. Tolerance of relative error (tol).
#### Adapt optimizer
1. Maximum number of iterations (maxiter).
2. Optimizer (theta): list of optimizer (generic) and learning rate.
3. Tolerance of relative error (tol).
4. Number of electrons (electrons).
5. Number of qubits (qubits).
6. Sz proyection value (sz) (I recommend keek that value as 0).
#### Jax's optimizers
1. Number of parameters (number).
2. Maximum number of iterations (maxiter).
3. Theta optimizer (theta): list of optimizer (adam or adagrad) and learning rate.
4. X optimizer (x): list of optimizer (adam or adagrad) and learning rate.
5. Tolerance of relative error (tol).
### Lattice
For the construction of the lattice, we use the library networkx, for the purpose of the code, the parameters are the following:
1. Bound type (bound): boolean value, open (false) and periodic (close).
2. Lattice type (lattice): chain, triangle, square, hexagon.
3. Size of the lattice (size): tuple of integers (x,y).
I recommended reviewing my repository [my codes](https://github.com/javinoram/FH-Mol), where I have a few workflows using this code to compute VQE in molecules and 1D Fermi-Hubbard. This could be helpful to understand how to use it.
Raw data
{
"_id": null,
"home_page": "",
"name": "vqepy",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": "",
"keywords": "quantum chemistry,variational methods,condensed matter",
"author": "",
"author_email": "",
"download_url": "https://files.pythonhosted.org/packages/e2/e4/107affebb6539b78a979121c140dfea53e5cb81213c66d4486d4c92a340e/vqepy-1.0.1.tar.gz",
"platform": null,
"description": "# VqePy\n\n## Installation\n\nVqePy requires Python 3.9 or newer.\n\nTo install VqePy on macOS or Linux, open a terminal and run:\n```Shell\npython3 -m pip install vqepy\n```\n\nOther way to do it, is clone the repository and and call all the functions adding the PATH.\n\n## Tesis project\nThis library was a project to get a degree in computer science in the UTFSM University.\n\nThe main idea is implement a few variational quantum algorithms to study condensed matter and chemistry models and give a basic template to study complex phenomena. This project didnt want to be another quantum library. This should be see as a high level implementation to study systems with a fixed route to be executed, so, the user only need to give the parameters and just the minimun programming is needed.\n\n\n## Parameters\nHere, all the parameters of each class are listed.\n\n### Hamiltonians\n\n#### Molecules\nThe parameters considered here, come from the definition of the methods defined in pennylane [Molecular](https://docs.pennylane.ai/en/stable/code/api/pennylane.qchem.molecular_hamiltonian.html#pennylane.qchem.molecular_hamiltonian). Here we list the ones considered:\n1. Mapping (mapping).\n2. Charge (charge).\n3. Multiplicity (mult).\n4. Basis set (basis).\n5. Differential method (method).\n6. Active electrons (active_electrons).\n7. Active orbitals (active_orbitals).\n\nWe recomended to not let any of this as a None value, to have a correct execution.\n\n#### Fermi-Hubbard\nThe parameters considered here, come from the definition of the hamiltonian indicated here [Tenpy Hamiltonian](https://tenpy.readthedocs.io/en/latest/reference/tenpy.models.hubbard.FermiHubbardModel.html#tenpy.models.hubbard.FermiHubbardModel). Here we list the ones considerated:\n1. t hopping (hopping).\n2. On-site potencial U (U).\n3. Potencial V (V).\n4. Electric field (E).\n5. Number of sites (sites).\n\nWe recomended to not let any of this as a None value, to have a correct execution.\n\n\n#### Fermi-Hubbard\nThe parameters considered here, come from the definition of the hamiltonian indicated here [Wikipedia Hamiltonian](https://en.wikipedia.org/wiki/Quantum_Heisenberg_model). Here we list the ones considerated:\n1. Exchange's vector (J): [Jx, Jy, Jz] .\n2. Magnetic field's vector (h): [hx, hy, hz] .\n3. Number of spins (sites).\n\nThe values of the exchange and magnetic field are the same for all the corresponding terms. We recomended to not let any of this as a None value, to have a correct execution.\n\n### Ansatz\nHere there are a lot of element of the base library to take into account, i recommended review:\n1. [Base](https://docs.pennylane.ai/en/stable/code/qml_devices.html)\n2. [Interface](https://docs.pennylane.ai/en/stable/code/qml_interfaces.html)\n3. [Differential method](https://docs.pennylane.ai/en/stable/introduction/interfaces.html)\n\n#### UCCSD Ansatz\nThis ansatz should be use with molecules and Fermi-Hubbard hamiltonian\n1. Number of repetitions of the curcuit (repetitions): Here the number should 1\n2. Base structure for circuits execution(base)\n3. Interface of execution of the circuits (interface)\n4. Number of electrons of the system (electrons)\n5. Number of qubits of the circuit (qubits).\n6. Differential method of the ansatz (diff_method): adjoint and best is recommended.\n\n#### k-UpCCGSD Ansatz\nThis ansatz should be use with molecules and Fermi-Hubbard hamiltonian\n1. Number of repetitions of the curcuit (repetitions)\n2. Base structure for circuits execution(base)\n3. Interface of execution of the circuits (interface)\n4. Number of electrons of the system (electrons)\n5. Number of qubits of the circuit (qubits).\n6. Differential method of the ansatz (diff_method): adjoint and best is recommended.\n\n#### Hardware Efficient Ansatz\nThis ansatz should be use with spin system\n1. Number of repetitions of the curcuit (repetitions)\n2. Base structure for circuits execution(base)\n3. Interface of execution of the circuits (interface)\n4. Number of electrons of the system (electrons)\n5. Number of qubits of the circuit (qubits).\n6. Differential method of the ansatz (diff_method): adjoint and best is recommended.\n7. Pattern of the non local gates (pattert): chain or ring\n\nThere also the begin state of size 2**n that is needed.\n\n#### Custom Ansatz\nThis ansatz should be use with molecules and Fermi-Hubbard hamiltonian\n1. Number of repetitions of the curcuit (repetitions)\n2. Base structure for circuits execution(base)\n3. Interface of execution of the circuits (interface)\n4. Number of electrons of the system (electrons)\n5. Number of qubits of the circuit (qubits).\n6. Differential method of the ansatz (diff_method): adjoint and best is recommended.\n\nOther elements are the set of singles and doubled given gates obteined from the ADAPT-VQE. There also the begin state of size 2**n.\n\n### Optimizers\n#### Pennylane's optimizers\n1. Number of parameters (number).\n2. Maximum number of iterations (maxiter).\n3. Theta optimizer (theta): list of optimizer (generic, adam or adagrad) and learning rate.\n4. X optimizer (x): list of optimizer (generic, adam or adagrad) and learning rate.\n5. Tolerance of relative error (tol).\n\n#### Scipy's optimizers\n1. Number of parameters (number).\n2. Maximum number of iterations (maxiter).\n3. Optimizer [scipy method section](https://docs.scipy.org/doc/scipy/reference/generated/scipy.optimize.minimize.html) (type).\n4. Tolerance of relative error (tol).\n\n#### Adapt optimizer\n1. Maximum number of iterations (maxiter).\n2. Optimizer (theta): list of optimizer (generic) and learning rate.\n3. Tolerance of relative error (tol).\n4. Number of electrons (electrons).\n5. Number of qubits (qubits).\n6. Sz proyection value (sz) (I recommend keek that value as 0).\n\n#### Jax's optimizers\n1. Number of parameters (number).\n2. Maximum number of iterations (maxiter).\n3. Theta optimizer (theta): list of optimizer (adam or adagrad) and learning rate.\n4. X optimizer (x): list of optimizer (adam or adagrad) and learning rate.\n5. Tolerance of relative error (tol).\n\n### Lattice\nFor the construction of the lattice, we use the library networkx, for the purpose of the code, the parameters are the following:\n1. Bound type (bound): boolean value, open (false) and periodic (close). \n2. Lattice type (lattice): chain, triangle, square, hexagon. \n3. Size of the lattice (size): tuple of integers (x,y).\n\n\nI recommended reviewing my repository [my codes](https://github.com/javinoram/FH-Mol), where I have a few workflows using this code to compute VQE in molecules and 1D Fermi-Hubbard. This could be helpful to understand how to use it.\n",
"bugtrack_url": null,
"license": "",
"summary": "An open source Python package for molecular and condensed matter VQE research",
"version": "1.0.1",
"project_urls": {
"Source": "https://github.com/javinoram/VqePy",
"website": "https://github.com/javinoram/VqePy"
},
"split_keywords": [
"quantum chemistry",
"variational methods",
"condensed matter"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "8e5eaf91d36dfb0c5d852c30a0af6f7427bc1106c7536d9947d245f485231395",
"md5": "83657eecb6cd95b3d5d8aa1fadca10bc",
"sha256": "c5c2d902e1c64bd8c2f45ead470b27887186bd75a441c521b37e209660674c72"
},
"downloads": -1,
"filename": "vqepy-1.0.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "83657eecb6cd95b3d5d8aa1fadca10bc",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10",
"size": 28202,
"upload_time": "2024-02-23T18:07:10",
"upload_time_iso_8601": "2024-02-23T18:07:10.283474Z",
"url": "https://files.pythonhosted.org/packages/8e/5e/af91d36dfb0c5d852c30a0af6f7427bc1106c7536d9947d245f485231395/vqepy-1.0.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "e2e4107affebb6539b78a979121c140dfea53e5cb81213c66d4486d4c92a340e",
"md5": "b69892faf52582fca3bfea584f8af676",
"sha256": "d7b0ed11e284f0938eb51ff9160e8652ee1b62b203bb716693c7fe418bfdbf50"
},
"downloads": -1,
"filename": "vqepy-1.0.1.tar.gz",
"has_sig": false,
"md5_digest": "b69892faf52582fca3bfea584f8af676",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10",
"size": 48760,
"upload_time": "2024-02-23T18:07:12",
"upload_time_iso_8601": "2024-02-23T18:07:12.126860Z",
"url": "https://files.pythonhosted.org/packages/e2/e4/107affebb6539b78a979121c140dfea53e5cb81213c66d4486d4c92a340e/vqepy-1.0.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-02-23 18:07:12",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "javinoram",
"github_project": "VqePy",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [
{
"name": "pyscf",
"specs": []
},
{
"name": "numpy",
"specs": []
},
{
"name": "scipy",
"specs": []
},
{
"name": "pennylane",
"specs": []
},
{
"name": "pandas",
"specs": []
},
{
"name": "matplotlib",
"specs": []
},
{
"name": "jax",
"specs": []
},
{
"name": "pennylane-qiskit",
"specs": []
},
{
"name": "qiskit_ibm_provider",
"specs": []
},
{
"name": "pyyaml",
"specs": []
},
{
"name": "networkx",
"specs": []
},
{
"name": "basis-set-exchange",
"specs": []
},
{
"name": "ipykernel",
"specs": []
},
{
"name": "pennylane-lightning",
"specs": []
},
{
"name": "jaxopt",
"specs": []
},
{
"name": "optax",
"specs": []
}
],
"lcname": "vqepy"
}