def METHOD_NAME(dim):
    # Start assembling constraints and variables.
    constraints = []
    # Make a complex variable for X.
    X = _complex_var(dim**2, dim**2, "X")
    # Make complex variables for rho0 and rho1.
    rho0 = _complex_var(dim, dim, "rho0")
    rho1 = _complex_var(dim, dim, "rho1")
    constraints += _make_constraints(rho0, rho1)
    # Finally, add the tricky positive semidefinite constraint.
    # Since we're using column-stacking, but Watrous used row-stacking,
    # we need to swap the order in Rho0 and Rho1. This is not straightforward,
    # as CVXPY requires that the constant be the first argument. To solve this,
    # We conjugate by SWAP.
    W = swap(dim, dim).full()
    W = Complex(re=W.real, im=W.imag)
    Rho0 = _conj(W, _kron(np.eye(dim), rho0))
    Rho1 = _conj(W, _kron(np.eye(dim), rho1))
    Y = cvxpy.bmat(
        [
            [Rho0.re, X.re, -Rho0.im, -X.im],
            [X.re.T, Rho1.re, X.im.T, -Rho1.im],
            [Rho0.im, X.im, Rho0.re, X.re],
            [-X.im.T, Rho1.im, X.re.T, Rho1.re],
        ]
    )
    constraints += [Y >> 0]
    return X, constraints