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

Allow specifying basis_set as an empty set to qml.compile #6793

Open
albi3ro opened this issue Jan 9, 2025 · 0 comments · May be fixed by #6821
Open

Allow specifying basis_set as an empty set to qml.compile #6793

albi3ro opened this issue Jan 9, 2025 · 0 comments · May be fixed by #6821
Labels
good first issue Good for newcomers

Comments

@albi3ro
Copy link
Contributor

albi3ro commented Jan 9, 2025

We currently have a basis_set keyword argument to qml.compile that specifies which operations to not decompose. If an operation is not in the basis set and does not have a decomposition, we leave it be.

We may sometimes want to decompose anything that can potentially be decomposed:

@partial(qml.compile, basis_set={})
@qml.qnode(qml.device('default.qubit'))
def circuit():
    qml.U2(0.5, 0.6, 0)
    return qml.expval(qml.Z(0))

The above syntax should indicate "as long as it has a decomposition, decompose it".

Right now we interpret {} as Falsy, and change the basis set to qml.ops.__all__. Instead, we should interpret {}, (), and [] (any non-None) object, as an actual basis set. An empty basis set should be a valid basis set.

@albi3ro albi3ro added the good first issue Good for newcomers label Jan 9, 2025
@sotskopa sotskopa linked a pull request Jan 14, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant