Is this what you wanted?
julia> using Convex, SCS
julia> T = [1 2;3 4]
2×2 Matrix{Int64}:
1 2
3 4
julia> n = size(T,1)
2
julia> Y₀ = Semidefinite(n)
Variable
size: (2, 2)
sign: real
vexity: affine
id: 454…141
julia> Y₁ = Semidefinite(n)
Variable
size: (2, 2)
sign: real
vexity: affine
id: 146…599
julia> problem = minimize(maximum(diag(Y₀))/2 + maximum(diag(Y₁))/2)
minimize
└─ + (convex; real)
├─ * (convex; real)
│ ├─ maximum (convex; real)
│ │ └─ …
│ └─ 0.5
└─ * (convex; real)
├─ maximum (convex; real)
│ └─ …
└─ 0.5
status: `solve!` not called yet
julia> problem.constraints += ([Y₀ T; T' Y₁] ⪰ 0)
1-element Vector{Constraint}:
sdp constraint (affine)
└─ transpose (affine; real)
└─ hcat (affine; real)
├─ transpose (affine; real)
│ └─ …
└─ transpose (affine; real)
└─ …
julia> solver = SCS.Optimizer()
SCS.Optimizer
julia> solve!(problem, solver)
------------------------------------------------------------------
SCS v3.2.0 - Splitting Conic Solver
(c) Brendan O'Donoghue, Stanford University, 2012
------------------------------------------------------------------
problem: variables n: 11, constraints m: 29
cones: z: primal zero / dual free vars: 9
l: linear vars: 4
s: psd vars: 16, ssize: 3
settings: eps_abs: 1.0e-04, eps_rel: 1.0e-04, eps_infeas: 1.0e-07
alpha: 1.50, scale: 1.00e-01, adaptive_scale: 1
max_iters: 100000, normalize: 1, rho_x: 1.00e-06
acceleration_lookback: 10, acceleration_interval: 10
lin-sys: sparse-direct
nnz(A): 31, nnz(P): 0
------------------------------------------------------------------
iter | pri res | dua res | gap | obj | scale | time (s)
------------------------------------------------------------------
0| 7.07e+00 1.00e+00 1.91e+01 9.37e-02 1.00e-01 9.23e-05
100| 1.51e-06 4.22e-06 4.90e-05 4.00e+00 1.00e-01 1.64e-03
------------------------------------------------------------------
status: solved
timings: total: 1.86e-03s = setup: 2.05e-04s + solve: 1.66e-03s
lin-sys: 1.12e-04s, cones: 1.34e-03s, accel: 1.27e-05s
------------------------------------------------------------------
objective = 3.999977
------------------------------------------------------------------
julia> problem.status
OPTIMAL::TerminationStatusCode = 1
julia> problem.optval
4.0000017440202935
I am not familiar with this particular problem and therefore I just translated your code without much insight. What confused me was the line n = length(T); which then means that Y0 and Y1 are 4x4 matrices, but this does not fit then, does it?