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
The boundaries in the optimization routine of scipy.optimize.minimize are wrong for one of the parameters. Instead of going from 0 to pi it should go to 2 pi. Yes there are two minima, one in the 0 to pi and one in the pi to 2pi region, but the optimization can get stuck on the border, i.e. it returns 0 or pi as the parameter.
What did you expect to happen?
For classical-quantum states, i.e. \sum_i p_i | i X i | x rho_i the quantum discord should be 0. Diagonalized states are part of these, but the function in quimb does not output 0 as the quantum discord.
Minimal Complete Verifiable Example
importquimbasqus=np.random.rand(4)
s/=np.sum(s)
s.sort()
s=np.diag(np.flip(s))
print(s)
print(qu.quantum_discord(s)) # should give the output 0 but does not
Relevant log output
No response
Anything else we need to know?
This can be easily fixed by modifying the boundaries in opt = scipy.optimize.minimize( trial_qd, (qu.pi / 2 , qu.pi), method="SLSQP", bounds=((0,qu.pi), (0, 2 * qu.pi)) )
to be opt = scipy.optimize.minimize( trial_qd, (qu.pi , qu.pi), method="SLSQP", bounds=((0, 2 * qu.pi), (0, 2 * qu.pi)) )
I checked the fix and it works.
Environment
with the lates quimb environment
The text was updated successfully, but these errors were encountered:
I did try the fix but I still get non zero discords. However changing the optimizer to "COBYLA" seems to fix it. It seems that with "SLSQP" the optimization is unstable (depends on initial conditions) and doesn't converge well for diagonal states.
Also looking more carefully the optimization is over spherical coordinates $\theta$ and $\phi$ so I think the current bounds are right.
What happened?
The boundaries in the optimization routine of scipy.optimize.minimize are wrong for one of the parameters. Instead of going from 0 to pi it should go to 2 pi. Yes there are two minima, one in the 0 to pi and one in the pi to 2pi region, but the optimization can get stuck on the border, i.e. it returns 0 or pi as the parameter.
What did you expect to happen?
For classical-quantum states, i.e. \sum_i p_i | i X i | x rho_i the quantum discord should be 0. Diagonalized states are part of these, but the function in quimb does not output 0 as the quantum discord.
Minimal Complete Verifiable Example
Relevant log output
No response
Anything else we need to know?
This can be easily fixed by modifying the boundaries in
opt = scipy.optimize.minimize( trial_qd, (qu.pi / 2 , qu.pi), method="SLSQP", bounds=((0,qu.pi), (0, 2 * qu.pi)) )
to be
opt = scipy.optimize.minimize( trial_qd, (qu.pi , qu.pi), method="SLSQP", bounds=((0, 2 * qu.pi), (0, 2 * qu.pi)) )
I checked the fix and it works.
Environment
with the lates quimb environment
The text was updated successfully, but these errors were encountered: