Skip to content

Latest commit

 

History

History
44 lines (33 loc) · 1.72 KB

README.md

File metadata and controls

44 lines (33 loc) · 1.72 KB

Platform Python Qiskit License Code style: Black Tests Coverage Status

hhl

HHL Quantum Linear Solver

The hhl-prototype allows to use the HHL algorithm to solve linear system of euqations. Original implementation was implemented by @anedumla : https://github.com/anedumla/quantum_linear_solvers

Installation

git clone https://github.com/QuantumApplicationLab/hhl_prototype
cd hhl_prototype
pip install -e .

Use

import numpy as np
from hhl_prototype import HHL
from qiskit.primitives import Estimator, Sampler

# create the matrix
A = np.random.rand(4,4)
A = A+A.T

# create the right hand side 
b = np.random.rand(4)

# create the solver and solve
hhl = HHL(estimator=Estimator(), sampler=Sampler())
hhl.solve(A, b)

Documentation

Tutorial: https://qiskit.org/textbook/ch-applications/hhl_tutorial.html