Skip to content

VQE feature (CuTensornet) for VRP use case #85

Description

@NithyasriVS

Feature description: there are two primary levels.

  1. Algorithm Level: A workflow for VQE executing on Qibotn backend's CuTensornet platform

An independent VQE function for Qibotn which runs the VQE minimize API of Qibo with a custom loss function that ensures the execution happens on tensor network backend and takes care of the data compatibility between what we have in Qibotn vs what minimize() wants. The inputs are Hamiltonian, Circuit Ansatz, initial parameters for optimization.

Example Usage:

import qibo
from qibo import models, hamiltonians, Circuit, gates
import numpy as np
from vqe_tn import run_vqe

computation_settings = {
            "MPI_enabled": False,
            "MPS_enabled": False,
            "NCCL_enabled": False,
            "expectation_enabled": False
}

qibo.set_backend(backend="qibotn", platform="cutensornet", runcard=computation_settings)

nqubits = 4
c = Circuit(nqubits)
for i in range(0, nqubits):
    c.add(gates.RX(i,0))

initial_parameters = 0.01 * np.random.random(nqubits)

ham = hamiltonians.XXZ(nqubits)

vqe_circuit = run_vqe(c, ham, initial_parameters)
result = vqe_circuit() # Execute the circuit that has the final params from optimization set
print(result.state())
  1. Application Level: An exploratory use case making use of the algorithm level to solve Vehicle Routing Problem, a popular combinatorial optimization problem in the field of logistics.

The VRP scenario taken here is a single vehicle traveling to n customer locations (based on the input data/distance matrix), which is formulated into a QUBO, with constraints that get imposed with penalty if violated. For example, one constraint is that the vehicle must start and end at the depot. Three such constraints are applied and linear and quadratic terms of QUBO are extracted. Since, we want to perform quantum simulation, we convert from the binary model (0,1) to an Ising model (1,-1) using the terms, allowing us to get the corresponding Hamiltonian from our QUBO formulation (inspiration taken from qibo's QAP under applications). This Hamiltonian becomes an input for our VQE function.

This feature is for my Final Year Project (2024-2025) titled "Exploring the Utilization of Tensor Networks for Quantum Circuit Simulation and its Use Case Application". The aim of the project is to implement a working workflow for VQE in Qibotn and explore an use case correspondingly.

Rationale is that VQE is a good candidate for combinatorial optimization problems like in our case, VRP, which makes it a good exploration for tensor networks.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions