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

The IndexError key-not-found issue from updateCache in LQ #657

Open
maliasadi opened this issue Mar 21, 2024 · 0 comments
Open

The IndexError key-not-found issue from updateCache in LQ #657

maliasadi opened this issue Mar 21, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@maliasadi
Copy link
Member

Using the C++ modules of LQ in Catalyst along with the Python interface may raise IndexError: unordered_map::at: key not found from updateCache in ./gates/KernelMap.hpp when multiple versions of LQ for accessing the Python and C++ modules are loaded.

The issue is related to the fact that Catalyst Runtime builds the C++ modules of LQ from source and Catalyst Frontend imports the Python interface shipped with the PyPI package. With the current setup, the LQ dynamic dispatcher will be triggered twice in the Catalyst pipeline,

  1. with the PL device initialization: qml.device('lighnting.qubit', wires=n)
  2. when the compiled program is linked against the LQ shared library

The cached kernels in the dynamic dispatcher is not well-scoped and thread-local and as such using multiple versions of LQ in one process (or from both Python and C++ in Catalyst) will lead to some error messages about missing kernels or operations.

@maliasadi maliasadi added the bug Something isn't working label Mar 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant