sandialabs / pyGSTi

A python implementation of Gate Set Tomography
http://www.pygsti.info
Apache License 2.0
136 stars 55 forks source link

Some inefficiency in SDP construction #159

Closed rileyjmurray closed 1 year ago

rileyjmurray commented 3 years ago

Hi pyGSTI developers. This is just a note that the following use of CVXPY can be made more efficient.

https://github.com/pyGSTio/pyGSTi/blob/dd4ad669931c7f75e026456470cf33ac5b682d0d/pygsti/tools/optools.py#L326-L348

Specifically, the constraints sig0 == sig0.T, sig1 == sig1.T can be removed if the lines

        sig0 = _cvxpy.Variable(shape=(smallDim, smallDim))  # rho0.real
        sig1 = _cvxpy.Variable(shape=(smallDim, smallDim))  # rho1.real

are changed to

        sig0 = _cvxpy.Variable(shape=(smallDim, smallDim), symmetric=True)  # rho0.real
        sig1 = _cvxpy.Variable(shape=(smallDim, smallDim), symmetric=True)  # rho1.real

Using full matrices for the antisymmetric variables tau0 and tau1 is also inefficient, but that doesn't have a one-line fix.

rileyjmurray commented 1 year ago

Reopening until the next release.

sserita commented 1 year ago

Closed with release of 0.9.12.