Issues with HHL algorithm implementation

Hi,

I am facing some issues with HHL implementation here: https://resources.wolframcloud.com/ExampleRepository/resources/HarrowHassidimLloyd-HHL-algorithm/

Whenever I alter the matrix (maintaining hermiticity!), the results start to differ (right after one decimal point) between the simulated quantum and classical.

For example, if I take p*A, where p=1.25, it did not produce the expected outcome.

The same issue persisted when I picked A using Abs[SymmetricMatrix[RandomVariate[GaussianOrthogonalMatrixDistribution]]]

Later, I increased the matrix dimension to 8 (in addition to changing the precision accordingly).

I would like to know if anyone else has faced similar issues and if anyone has any remarks.

Thank you in advance.
Arun

Thanks for your feedback. We will respond soon with an updated example.

Here is a clean HHL that works for any Hermitian matrix and any dimension. Please note that the precision of HHL depends on the number of phase-estimation qubits (3rd argument). Our algorithm does not need rescaling etc that imposes some conditions (e.g. eigenvalues from 0 to 1, only). Let’s know if any question or issues.