You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ok, so I tracked it down to a problem with calculating the metric tensor.
Apparently the batched input isn't expected in those calculations and when interpreting the output of the quantum circuit, pennylane expects a shape of 2^n (at least it tries to squeezes the result in such a shape).
This however causes weird behavior where the combination of actual number of qubits and the batch size relates in such a way that only n_qubits*batch_size being log2 succeed.
However, if by chance, we have such a configuration, calculation takes almost forever because the metric tensor matrix then spans a n_qubits*batch_size matrix.
Fixed it by adjusting the processing_fn method in metric_tensor.py such that it averages over all probs within a batch before processing the covariance matrices (needed for gradient calc and root cause of above mentioned problem).
However, processing is (still?) terribly slow.. maybe I'm missing sth.?
Describe the bug
When choosing a batch size that is not log2, QNG fails.
To Reproduce
Set split optimizer to QNG (quantum model) and batch size to e.g. 10 and then run kedro.
Expected behavior
No problems
Screenshots
Hardware
N/A
Additional context
N/A
The text was updated successfully, but these errors were encountered: