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

[Bug] QuantumNaturalGradient not compatible with trainable feature maps #23

Open
DanieleCucurachi opened this issue Sep 25, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@DanieleCucurachi
Copy link
Collaborator

When optimizing a QuantumModel using QuantumNaturalGradient, an error occurs if a feature map with trainable parameters is utilized. The following error message is encountered:

Intel MKL ERROR: Parameter 6 was incorrect on entry to DGELSD. Working... 

...

File "/home/...python3.10//site-packages/qadence_libs/qinfo_tools/qng.py", line 158, in step qng_spsa(vparams_values, vparams_keys, grad_vec, lr, circuit, self.state, epsilon, beta) 
File "/home/.../python3.10/site-packages/qadence_libs/qinfo_tools/qng.py", line 231, in qng_spsa transf_grad = torch.linalg.lstsq( 
RuntimeError: false INTERNAL ASSERT FAILED at "../aten/src/ATen/native/BatchLinearAlgebra.cpp":1537, please report a bug to PyTorch. 
torch.linalg.lstsq: Argument 6 has illegal value. Most certainly there is a bug in the implementation calling the backend library.

This issue appears to stem from incompatible dimensions or invalid input to the least squares solver. It seems that the current Quantum Natural Gradient (QNG) implementation does not properly account for the additional trainable parameters of the feature map.

@DanieleCucurachi DanieleCucurachi added the bug Something isn't working label Sep 25, 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

2 participants