Skip to main content

An open source Python package for molecular and condensed matter VQE research

Project description

VqePy

Installation

VqePy requires Python 3.9 or newer.

To install VqePy on macOS or Linux, open a terminal and run:

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. 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. 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. 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
  2. Interface
  3. Differential method

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 (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, 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.

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

vqepy-0.0.0.tar.gz (48.4 kB view details)

Uploaded Source

Built Distribution

vqepy-0.0.0-py3-none-any.whl (27.8 kB view details)

Uploaded Python 3

File details

Details for the file vqepy-0.0.0.tar.gz.

File metadata

  • Download URL: vqepy-0.0.0.tar.gz
  • Upload date:
  • Size: 48.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.18

File hashes

Hashes for vqepy-0.0.0.tar.gz
Algorithm Hash digest
SHA256 e9f55f85f6b853ffc482327dfb76bf22c36cf2949b17a55e84a6561fdb7ec7d9
MD5 3860b56011a48a151333dca2e0f57058
BLAKE2b-256 8260ebc39a286239711f893036235e4ad70b34903480bc7fa5f1d653289fc6de

See more details on using hashes here.

File details

Details for the file vqepy-0.0.0-py3-none-any.whl.

File metadata

  • Download URL: vqepy-0.0.0-py3-none-any.whl
  • Upload date:
  • Size: 27.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.18

File hashes

Hashes for vqepy-0.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 79388b0fd3f400b64549ea53665f770736342743ee75bd92a4da46ca49f8058f
MD5 0b8cf761a1d19f936c8c268da3e5dd5e
BLAKE2b-256 e6bfdc625a3119266f37a1bec8b72adfd8a97951224caccfc11f91ac93bc20dc

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page