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 lowering for the lapack_dsyevd custom call #488

Merged
merged 5 commits into from
Feb 1, 2024
Merged

Conversation

maliasadi
Copy link
Member

@maliasadi maliasadi commented Jan 31, 2024

This lowering will enable the QJIT compilation of qml.BlockEncode and qml.qsvt with variable matrices.

For example, the compilation of the following circuits are now possible

@qml.qjit
@qml.qnode(dev)
def circuit1(A):
    qml.BlockEncode(A, wires=range(2))
    return qml.state()


>>> circuit1(np.array([[0.1, 0.2], [0.3, 0.4]]))
A = np.array([[0.1, 0.2], [0.3, 0.4]])
angles = np.array([0.1, 0.2, 0.3])

@qml.qjit
@qml.qnode(dev)
def circuit2(A):
    qml.qsvt(A, angles, wires=[0, 1])
    return qml.expval(qml.PauliZ(wires=0))

circuit2(A)

[sc-54971]
[sc-55370]

@maliasadi maliasadi added the compiler Pull requests that update the compiler label Jan 31, 2024
@rmoyard rmoyard self-requested a review February 1, 2024 18:42
Copy link
Contributor

@rmoyard rmoyard left a comment

Choose a reason for hiding this comment

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

Thanks for adding this function, it looks good 👍 Could add an integration test that would call this function and check for correctness?

Copy link
Contributor

@rmoyard rmoyard left a comment

Choose a reason for hiding this comment

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

Nice 💯

@dime10 dime10 merged commit 6c3e7d0 into main Feb 1, 2024
19 checks passed
@dime10 dime10 deleted the maa/dsyevd-lowering branch February 1, 2024 23:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler Pull requests that update the compiler
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants