Skip to content

Added a demo for Resource Estimation of Matrix Inversion using QSVT#1667

Open
Jaybsoni wants to merge 17 commits intomasterfrom
qsvt_re
Open

Added a demo for Resource Estimation of Matrix Inversion using QSVT#1667
Jaybsoni wants to merge 17 commits intomasterfrom
qsvt_re

Conversation

@Jaybsoni
Copy link
Contributor

Title:
A new demo using the resource estimation functionality for CFD example using QSVT.

Summary:

Relevant references:

Possible Drawbacks:

Related GitHub Issues:


  • GOALS — Why are we working on this now?
  • Promote the new PL feature (estimator module)
  • Show a PL implementation of a recent paper (https://arxiv.org/pdf/2404.02819)
  • This demo should teach users how to estimate the cost of the QSVT based algorithm for solving LSEs.
  • We aim to highlight all of the practical considerations a user must make when specializing the algorithm for their specific problem instance.
  • How should I select my polynomial approximation 1/x (with what error?)
  • How does changing the block-encoding affect the cost of my algorithm?
  • This demo should estimate the cost for a useful application of the algorithm.
  • AUDIENCE — Who is this for?
  • Algo Researcher:

    • Expert knowledge of quantum algorithms & resource estimation
    • Lacks knowledge of PennyLane
    • Lacks knowledge of PennyLane Resource Estimation
  • Algo Software Dev:

    • Familiar with quantum algorithms & resource estimation
    • Familiar with PennyLane
    • Lacks knowledge of PennyLane Resource Estimation
  • KEYWORDS — What words should be included in the marketing post?

QSVT, Resource Estimation, Matrix Inversion, CFD, Linear systems of equations,

  • Which of the following types of documentation is most similar to your file?
    (more details here)
  • Tutorial
  • Demo
  • How-to

@github-actions
Copy link

👋 Hey, looks like you've updated some demos!

🐘 Don't forget to update the dateOfLastModification in the associated metadata files so your changes are reflected in Glass Onion (search and recommendations).

Please hide this comment once the field(s) are updated. Thanks!

@github-actions
Copy link

github-actions bot commented Jan 21, 2026

Your preview is ready 🎉!

You can view your changes here

Deployed at: 2026-02-05 18:57:23 UTC

@Jaybsoni Jaybsoni requested review from a team as code owners January 21, 2026 16:13
Copy link
Contributor

@KetpuntoG KetpuntoG left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job @Jaybsoni ! 🚀
Leaving a few comments here 😄

print(resources)

##############################################################################
# Here the :class:`~.pennylane.estimator.compact_hamiltonian.PauliHamiltonian` class is used to
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would like to know why this are the resources, something like: note that by default we decompose the target get_set [...]. There is probably another demo you can link for the basics of the resource estimation functionality

#
# Polynomial Approximations of the Inverse Function
# -------------------------------------------------
# The cost of QSVT is directly proportional to the degree of the polynomial transformation. More
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd recommend to link the matrix inversion demo for more details

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that could clarify a bit better the concept of kappa, right now it is not very clear

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea!

#
# Diagonal Matrices & the Walsh-Hadamard Transform
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
# Let's start with the :math:`D_{k}` operators. These are a list of diagonal operators where
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The operator D_k is not diagonal, it is a block encoding of a diagonal matrix

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It becomes block diagonal when we include the multiplexer. But I guess my point is that each individual D_i is a diagonal operator no?

Comment on lines 209 to 215
# |
#
# .. figure:: ../_static/demonstration_assets/re_qsvt/WH_a.png
# :align: center
# :width: 90%
# :target: javascript:void(0)
#
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We may not be using the best notation in the paper 🙈
To clarify, the U in this image is D_k in the previous circuit
You could change the names in the picture

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed the image!

num_diag_wires = int(np.ceil(np.log2(size_diagonal)))
list_of_diagonal_ops = []

for _ in range(num_diags):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[research question, ignore in the demo] Wait, is it me or we should be able to merge all the diagonals into just one? it seems the structure would easily merge 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

its just CNOTs and RZ, I imagine it should be mergable!

Copy link
Contributor

@AntonNI8 AntonNI8 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Initial pass through 😄

@Alex-Preciado Alex-Preciado removed the request for review from a team February 5, 2026 21:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants