Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add block encoding with matrix access oracles demo #943

Merged
merged 75 commits into from
Nov 27, 2023
Merged

Conversation

soranjh
Copy link
Contributor

@soranjh soranjh commented Oct 2, 2023

Title:
Block encoding with matrix access oracles

Summary:
This demo explains a general block encoding method that can be very efficient for sparse and structured matrices. It complements block encoding with linear combination of unitaries.

Relevant references:

Possible Drawbacks:

Related GitHub Issues:

@soranjh soranjh added the ci:build-all-qml-demos Build all the Demos for this Pull Request label Oct 4, 2023
@soranjh soranjh changed the title [WIP] add introduction to block encoding demo [WIP] add block encoding with matrix query oracles demo Oct 4, 2023
@github-actions
Copy link

github-actions bot commented Oct 5, 2023

Thank you for opening this pull request.

You can find the built site at this link.

Deployment Info:

  • Pull Request ID: 943
  • Deployment SHA: 05ef7a8ef006dc7929c06a1bd4503fd612fd1fd8
    (The Deployment SHA refers to the latest commit hash the docs were built from)

Note: It may take several minutes for updates to this pull request to be reflected on the deployed site.

demonstrations/tutorial_block_encoding.py Outdated Show resolved Hide resolved
demonstrations/tutorial_block_encoding.py Outdated Show resolved Hide resolved
demonstrations/tutorial_block_encoding.py Outdated Show resolved Hide resolved
demonstrations/tutorial_block_encoding.py Outdated Show resolved Hide resolved
demonstrations/tutorial_block_encoding.py Outdated Show resolved Hide resolved
demonstrations/tutorial_block_encoding.py Show resolved Hide resolved
demonstrations/tutorial_block_encoding.py Outdated Show resolved Hide resolved
@KetpuntoG
Copy link
Contributor

From what we have discussed in person, the confusion may come since you don't see the clear separation between the two algorithms. It may seem that the spare matrix case is a particular case of Fable but they work differently. For that reason, I would clarify it in the introduction. After showing the structure of this type of encodings, say:

"In this demo we are going to work with two particular algorithms based on oracles: the FABLE method and another method that focuses on sparse matrices."

So here you already start talking about FABLE, you talk about UA with the formulas and say that we will always take the same size |i> and |j>, representing the row and column indexes (I think). Remark that in this algorithm you always take UB as a SWAP gate whose goal is to order the indices in the right way.

Then you get to the sparse matrix block. Here you start by saying that this is a different method that seeks to optimize the algorithm for situations where the matrix is sparse. You also say something like "Unlike the FABLE algorithm, in this case the |j> register will not store the column "j" but will store b(i,j). b(i, j) means [...]. In this way we can greatly improve the efficiency since the number of qubits will not grow with the size of the matrix but with the number of non-empty entries. With this in mind, note that we will find a small difference in the construction of UA, we will simply have to adapt the indexes to the new definition:

[formula]

On the other hand UB is in charge of returning precisely that b(i,j) value we were commenting:

[formula]

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.

Just some typos :)

demonstrations/tutorial_block_encoding.py Outdated Show resolved Hide resolved
demonstrations/tutorial_block_encoding.py Outdated Show resolved Hide resolved
demonstrations/tutorial_block_encoding.py Outdated Show resolved Hide resolved
demonstrations/tutorial_block_encoding.py Outdated Show resolved Hide resolved
demonstrations/tutorial_block_encoding.py Outdated Show resolved Hide resolved
demonstrations/tutorial_block_encoding.py Outdated Show resolved Hide resolved
demonstrations/tutorial_block_encoding.py Outdated Show resolved Hide resolved
demonstrations/tutorial_block_encoding.py Outdated Show resolved Hide resolved
demonstrations/tutorial_block_encoding.py Outdated Show resolved Hide resolved
demonstrations/tutorial_block_encoding.metadata.json Outdated Show resolved Hide resolved
demonstrations/tutorial_block_encoding.py Outdated Show resolved Hide resolved
demonstrations/tutorial_block_encoding.py Outdated Show resolved Hide resolved
demonstrations/tutorial_block_encoding.py Outdated Show resolved Hide resolved
demonstrations/tutorial_block_encoding.py Outdated Show resolved Hide resolved
demonstrations/tutorial_block_encoding.py Outdated Show resolved Hide resolved
demonstrations/tutorial_block_encoding.py Outdated Show resolved Hide resolved
demonstrations/tutorial_block_encoding.py Outdated Show resolved Hide resolved
@KetpuntoG
Copy link
Contributor

Great Job @Jaybsoni ! It was not an easy topic but now it's clear 🚀
You can have the honors of clicking on the merge button 😉

@Jaybsoni Jaybsoni merged commit 39e155e into master Nov 27, 2023
10 checks passed
@Jaybsoni Jaybsoni deleted the add_block_encoding branch November 27, 2023 14:26
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.

4 participants