Minimizing a quadratic form with Hermitian matrix #2222
Unanswered
alhernandezanton
asked this question in
Q&A
Replies: 1 comment
-
Can you share a full script that replicates the error? It's not clear from this code why it wouldn't work. My instinct is it's related to using |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, I need want to solve the following problem. I want to fit a matrix generated by a model (
rho
) to a Hermitian matrix of complex numbers (rho_exp
) which has been measured experimentally. This array is the result of averaging over many measurements and thus has an associated covariance matrix (cov
). The way I want to do this fit is by minimizing the modulus of the difference array d = (rho_exp - rho).flatten(), weighted by the uncertainties of the measurements. One way to define this is with the quadratic form Q = d*(cov^-1)d, where * stands for complex conjugation. This function takes real values and must be minimized. The modelrho
must be subject to a certain set of constraints. The code I use for such purpose is the following:When I do this, I get an assertion error, because the solver goes through a reduction called 'complex2real', which checks if there are no imaginary values in the W matrix (I think). This quadratic function takes positive real values and thus there should be no problem to optimize it. Does anyone know how to solve this issue?
Thanks in advance
Beta Was this translation helpful? Give feedback.
All reactions