pennylane icon indicating copy to clipboard operation
pennylane copied to clipboard

Add Fast Approximate BLock-Encodings (FABLE) template

Open soranjh opened this issue 2 years ago • 2 comments
trafficstars

Feature details

⚠️ This issue is part of an internal assignment and not meant for external contributors.

The Fast Approximate BLock-Encodings (FABLE) algorithm is an efficient method to block encode arbitrary matrices. Adding the qml.FABLE template to PennyLane complements the existing block-encoding functionalities.

The template can be used in a quantum circuit, similar to qml.BlockEncode, as

A = np.random.random((4, 4))
dev = qml.device('default.qubit')

@qml.qnode(dev)
def circuit():
    qml.FABLE(A, tol = 0.1)  
    return qml.state()

Implementation

This demo provides details to construct the FABLE block encoding circuit.

The qml.FABLE operation should be implemented as a template and added to the subroutines module.

Requirements

  1. The qml.FABLE operation should correctly block-encode a matrix.
  2. The qml.FABLE operation should accept a user-defined tolerance for adjusting the approximation level.
  3. The differentiability of the workflow should be tested wrt the matrix elements with at least one framework, e.g., autograd, JAX.

soranjh avatar Nov 16 '23 14:11 soranjh

Hi. I have implemented FABLE as a template, but I am a little confused on what you mean when it comes to testing the "differentiability of the workflow". Is the intention to test how changes to the matrix elements change the output of the FABLE algorithm?

Also, as of right now the FABLE template does not support non-square matrices and matrices that have imaginary values. I saw originally in the paper they account for imaginary values as well as implement some form of subnormalization factor. Should that be implemented as well?

PR#5107 for reference.

austingmhuang avatar Jan 25 '24 11:01 austingmhuang

Hi. I have implemented FABLE as a template, but I am a little confused on what you mean when it comes to testing the "differentiability of the workflow". Is the intention to test how changes to the matrix elements change the output of the FABLE algorithm?

Also, as of right now the FABLE template does not support non-square matrices and matrices that have imaginary values. I saw originally in the paper they account for imaginary values as well as implement some form of subnormalization factor. Should that be implemented as well?

PR#5107 for reference.

Thanks @austingmhuang Will answer these in the PR.

soranjh avatar Jan 25 '24 15:01 soranjh