Conic Optimization
1. Introduction
This note introduces some central ideas behind the implementation of efficient interior-point methods for solving conic programs. A large portion of the theory section is based on the papers for the conic solvers Clarabel11 You can play around with a few examples using a Wasm-compiled Clarabel here. [1] and CVXOPT [2]. What this note adds is some essential implementation details that were left out of the original two papers (e.g. iterative refinement, matrix equilibration, and handling of the structure of the scaling matrices).
2. Primal and dual problems
We will in this text consider optimization problems where the objective function is at most quadratic and the constraints are conic (including the zero cone in order to model equality constraints). The general form of such (primal) problems is the following
(1)
where is the decision variable, is the slack variable, and , , , . Furthermore, is a composite i.e. the Cartesian product of cones () with each of the cones of dimension being of the following types
- The zero cone: (used to model equality constraints).
- The nonnegative cone: .
- The second-order cone: .
- The exponential cone:
- The power cone: with .
- The positive semidefinite cone: .
where creates a symmetric matrix from the vector . This can be done in a plethora of ways, but we will use the definition from Clarabel, which fills the lower triangle row by row
(2)
where the scaling of have been introduced on the off-diagonal elements in order to preserve the inner product, i.e. . Furthermore, we denote the inverse operation by , i.e. an operation that creates a vector from a symmetric matrix . The nonnegative, second-order, and positive semidefinite cones are examples of symmetric cones which are a special class of cones that have a lot of nice properties. The exponential and power cones are examples of nonsymmetric cones which do not have the same nice properties as symmetric cones, but are still very useful in practice. The zero cone is a special case that is used to model equality constraints.
2.1. The dual problem
The primal optimization problem of interest can equivalently be written as
(3)
where the conic constraint can be understood as a generalized inequality, i.e.
(4)
However, the standard form (similar to LPs) requires that the inequality is turned the other way. As such we negate the expression, resulting in
(5)
We now write up the Lagrangian as
(6)
Since we must have that is in the dual cone in order for the Lagrangian to be a lower bound for any feasible . This comes directly from the definition of the dual cone, i.e.
(7)
so that, in particular, for every with .
Now since we want to find a stationary point we compute the gradient of the Lagrangian and set it to zero
(8)
Now notice that the Lagrangian can be written as
(9)
The thing inside the parentheses, is almost equal to the zero constraint on the gradient. By performing the mathematicianโs favorite magic trick of adding zero followed by rearranging the expressions we end up with
(10)
As such the dual formulation of the problem becomes
(11)
2.2. Homogeneous embedding
The standard KKT conditions for the primal problem are
(12)
However, we can take a different path in order to solve the same problem. First we define the duality gap as the difference between the primal and dual objectives
(13)
where we used that (from the gradient constraint) and (from the definition of the equality constraints). Because the duality gap is always nonnegative for any feasible point, and is zero at the optimal point when strong duality holds. We can therefore come up with a different optimization problem by combining the constraints of the primal and dual problem and with an objective to minimize the duality gap
(14)
An issue with the above is that the duality gap is explicitly set to zero in the third equality constraint. This condition can be relaxed after a change of variables and and instead solve
(15)
In [1] they go on to show the existence of solutions and infeasibility detection. This will be skipped here.
3. Barrier functions
Barrier functions are functions that are defined only inside of the feasible region (i.e. when ) and tend towards infinity when we move towards the boundary of the feasible set. They are useful as they can be used to approximate the constrained problem by an unconstrained problem
(16)
As the solution to the unconstrained problem tends towards the solution of the constrained problem. A naive approach would simply be to pick to be a small value in order to get a good approximation of the original problem. However, this is not a good idea as the resulting optimization problem is very ill-conditioned and hard to solve. Instead, interior-point methods start with a large value of and then track the solution of the unconstrained problem as decreases until we are reasonably close to the optimal solution of the original problem. Methods that rely on this strategy of solving a series of simpler problems are known as homotopy methods. As an example we will now describe the properties of the logarithmic barrier functions for the three symmetric cones22 That is the nonnegative, second-order, and positive semidefinite cone., but later we will also discuss the barrier functions for the exponential and power cones.
3.1. The logarithmic barrier function for the three symmetric cones
For a composite cone where each component is one of the three symmetric cones we have that the logarithmic barrier function is given by
(17)
where with and
(18)
meaning that 33 The notation here is a little sloppy as we use that . for all . Furthermore, the logarithmic barrier function satisfies the relation for where
(19)
We refer to as the degree of the th cone, so that is the degree of the composite cone .
3.2. Gradients of the barrier function for the three symmetric cones
By linearity the gradient of the logarithmic barrier function is given by the sum of gradients of the individual barrier functions for each symmetric cone given by
(20)
where is a -vector of ones. It can be shown that and that for .
3.3. Hessians of the barrier function for the three symmetric cones
We denote the Hessian of and as and :
(21)
where is the symmetric Kronecker product, defined in the section on semidefinite cones at the end of the post. For the scaling matrices below, we also need , which depends on both and , with
(22)
In addition, we have that
(23)
Further properties of the Hessian of the logarithmic barrier function are
(24)
3.4. The Jordan product for the three symmetric cones
The Jordan products for the three symmetric cones are given by
(25)
where is the idempotent for the cones given by
(26)
Note that and . In addition, the inverse, square, and square root are defined by the relations , , and .
3.5. Logarithmically homogeneous self-concordant barrier
The ideas of the logarithmic barrier functions can be extended to the nonsymmetric cones as well. We often refer to the general class of logarithmically homogeneous self-concordant barrier functions, which are a special class of barrier functions that have nice properties that can be exploited in the design of interior-point methods as follows: A function is called a logarithmically homogeneous self-concordant barrier with degree (-LHSCB)44 The logarithmic barrier functions from the previous section are all -LHSCB functions. for the convex cone if it satisfies the following properties
(27)
The conjugate barrier function is defined as 55 This is not to be confused with the convex conjugate of a function, which is denoted by . The relation between the two conjugates are and .
(28)
The function is -LHSCB for if the associated is. The primal gradient satisfies
(29)
In cases where the conjugate barrier function is known only through the definition (i.e. rather than a closed-form representation) we can compute its gradient as the solution to
(30)
4. The central path
As described previously, the idea of interior-point methods is to track the solution of an approximate unconstrained problem as decreases until we are reasonably close to the optimal solution of the original constrained problem. The central path denotes this path. In order to describe the central path mathematically we define the function representing the equality constraints of the homogeneous embedding
(31)
Now assume that is an -LHSCB function on with conjugate barrier for some Given any initial , we define the central path of as the unique solution to
(32)
Now inserting the definition of while using that it follows that
(33)
If the cone is symmetric, then we can replace the condition with a simpler condition defined in terms of the Jordan product on , i.e.
(34)
where is the idempotent for each of the symmetric cones.
Interactive figureย 1: A central path in two dimensions
Interactive figure 1 (A central path in two dimensions)ย ย Consider , the objective , and the composite cone with
(35)
The three cones give, respectively, the half-plane , the disk , and the region , and the barrier is
(36)
of degree (here the second-order cone uses , twice the barrier of the previous section, so it contributes degree 2). The central path is the curve of minimizers of and along it . For large the barrier dominates, and lies close to the analytic center, well inside the feasible region. As decreases the linear term takes over, and the level sets are pushed against the boundary, where they follow its shape.
4.1. Scaling matrices
We now introduce the idea of a scaling matrix . The choice of scaling matrix depends on which way we linearize the central path. For symmetric cones the most common choice is the Nesterov-Todd scaling. For nonsymmetric cones the central path is defined by the set of points satisfying (32). For the zero cone we set .
4.1.1. Symmetric cones
For symmetric cones the central path described with (34) is linearized. The Nesterov-Todd scaling exploits the self-scaled property of symmetric cones to compute a unique scaling point satisfying
(37)
We can factorize as .
4.1.2. Nonsymmetric cones
As nonsymmetric cones are not self-scaled, we cannot use (34) to describe the central path and must instead linearize (32). A general primal-dual scaling strategy suitable for nonsymmetric cones was proposed in [3], and used later in [4], which relies on the satisfaction of the two secant equations
(38)
We now define shadow iterates as
(39)
with
(40)
A scaling matrix can be obtained from the rank-4 Broyden-Fletcher-Goldfarb-Shanno (BFGS) update, which is commonly used in quasi-Newton methods,
(41)
where , , and is an approximation of the Hessian. In our implementation we choose following [4]. Putting things together means that the computation of reduces to a rank-3-update as
(42)
where and . A more detailed description can be found in [4].
The above is defined in terms of the conjugate barrier function . This is in contrast to [4], which defines it in terms of the standard barrier function.
5. Computing step directions
The overall aim is to find the optimal solution to the homogeneous embedding. This amounts to solving the nonlinear system of equations with the additional constraint . The aim of most interior-point methods is to track the central path for until reasonably close to the optimum. In order to solve the non-linear system Newtonโs method is applied. This requires a linearization of the central path which can be seen below,
(43)
where is the vector of residuals, while and is a positive semidefinite block-diagonal matrix (zero on zero-cone blocks) with blocks equal to the scaling matrices 66 Ignoring the sparse form of the scaling matrices that are usually required in practice. This will be explained in a later section.. Note that in order to allow for nonsymmetric cones we use , which is in contrast to [2] that uses with .
We now eliminate from the system resulting in
(44)
The above system can be solved by a pair of linear systems with a common coefficient matrix, meaning that it only has to be factorized once
(45)
From the above solution we can recover the search direction as follows
(46)
The actual step is then obtained by computing the maximal step size that ensures that the new update is still in the interior of the conic constraints.
Interactive figureย 2: The largest step inside the cones
Interactive figure 2 (The largest step inside the cones)ย ย The feasible region of the central path example, with an iterate and a search direction , both of which can be dragged. Following from , the first cone boundary is reached at the step (dashed). Clarabel moves only a fraction of the way, with , so that the iterate stays strictly inside the cones.
5.1. The affine and centering directions
At every interior-point iteration we solve the KKT system for two sets of right-hand sides each, corresponding to the so-called affine and centering directions. In short this means solving (45) twice, however since the system matrix stays the same and the right-hand side stays the same the computation requires only a single numerical factorization 77 As the sparsity pattern does not change the symbolic factorization can be reused and three solves.
The two sets of right-hand sides correspond to a predictor step and a corrector step. The steps are also known as the affine step and the centering step. In our case the affine step has the right-hand side of
(47)
where are the three components of the residual at the current iterate , while the corrector step has the right-hand side of
(48)
where denotes the inverse operator of . Computation of a higher-order correction term is a heuristic technique that is known to accelerate the convergence of IPMs significantly. The choice of this term varies depending on the choice of the scaling matrix and whether a given constraint is symmetric or not. For symmetric cones we use the Mehrotra correction , while for nonsymmetric cones we compute using the 3rd-order correction from [4], i.e.
(49)
We set where is the step size of the affine step.
Interactive figureย 3: Affine and centering directions
Interactive figure 3 (Affine and centering directions)ย ย A primal-only version on the central path example, with the dual variable tied to the iterate by , so that the step towards the central path for a target is the Newton step , where . From , the affine step (dashed, target ) is taken a fraction of the way to the boundary, which leaves the central path and reduces to . The centering step (dotted) is one damped Newton step for .88 The next iteration starts where the centering step ends, near but not on the central path. Only the number enters this step; is unknown to the method and drawn for reference only. This is the classical predictor-corrector pair; Clarabel combines the two steps into one through .
5.2. Solver initialization
An essential consideration is how to choose the initial point . The initialization strategies depend on whether the objective is linear or quadratic and whether the cones are symmetric or not. However, in all cases the initial scalar values are set as .
5.2.1. Symmetric cones
The initialization strategies below can be thought of as projections of the equality constraints onto cones in the direction of the idempotent for each symmetric cone.
Quadratic objective. If the initialization happens by solving the following linear system
(50)
with with being a matrix with ones on the diagonal corresponding to zero cones (i.e. equality constraints) but otherwise zero. The above linear system corresponds to solving the following optimization problem
(51)
From this solution we project and back to the interior of the cone
(52)
where and .
Linear objective. In the case of we instead solve two linear systems
(53)
From this we set
(54)
where and .
5.2.2. Nonsymmetric cones
When the composite cone contains any nonsymmetric cone both primal and dual variables are set as (corresponding to ). This is equivalent to solving the unconstrained optimization problem
(55)
which is strictly convex and has a unique solution. It yields for symmetric cones, and
(56)
for exponential cones, and
(57)
for power cones with parameter .
5.3. Termination criteria
All termination criteria are based on unscaled problem data and iterates, i.e. after the Ruiz scaling has been reverted.
5.3.1. Feasibility checks
For checks of primal and dual feasibility we introduce the normalized variables , , and define the primal and dual residual as follows
(58)
Likewise, we define the primal and dual objectives as
(59)
Using the above definitions we can declare convergence if all three of the following hold:
(60)
We specify a default value of as well as a weaker threshold of when testing for โnear optimalityโ in cases of early termination (e.g. lack of progress, timeout, iterations limit, etc.).
5.3.2. Infeasibility checks
When testing for infeasibility we do not normalize iterates, but rather work directly with the unscaled variables since infeasibility corresponds to the case where . We declare primal infeasibility if the following holds
(61)
Similarly, we define dual infeasibility if the following hold
(62)
We set the relative and absolute tolerances as and allow for weaker thresholds to declare โnear infeasibilityโ certificates in cases of early termination.
6. Implementation details
6.1. Solving the KKT system
The main computational effort in the interior-point method is to solve the Karush-Kuhn-Tucker (KKT) system of the form
(63)
The scaling matrix, however, has the unfortunate property that it becomes ill-conditioned when the iterates are close to the boundary. As such one instead solves the regularized problem
(64)
where denotes the added diagonal part. Note that while solving (64) is more numerically stable, it is not the system that we actually aim to solve i.e. (63). The regularization is computed as
(65)
6.2. Regularized iterative refinement
As described in [5], the regularization term can be removed by solving a sequence of systems of the form
(66)
The sequence converges to the true solution of , provided that it exists. To show this first notice that we can rewrite (66) as
(67)
Now assume that is the solution to the equation (which is the equation we aim to solve). Now we perform the mathematicianโs favorite trick of adding 0 (in this case ), it follows that
(68)
We now subtract (68) from (67)
(69)
Rewriting the above gives us
(70)
The final step is to take norms on both sides resulting in
(71)
Thus, if we have that for (more precisely, it suffices that the spectral radius of is less than one).
6.3. Matrix equilibration
The equilibration in Clarabel is a modified version of Ruiz scaling [6], [7], similar as to what is done in the OSQP package [5]. The equilibration is based on the scaling of the constant part of the KKT system (i.e. the part excluding the primal-dual scaling matrices) as shown below
(72)
The aim is to find a diagonal scaling matrix such that
(73)
is better conditioned. The above can be seen as a transformation of input data to a conic optimization problem
(74)
where , , , , , , with a cost scaling and chosen such that .
The main idea of the equilibration procedure is to scale the rows (and columns) for the matrix so that they have equal -norm. An efficient approximate solution to this problem is the so-called Modified Ruiz scaling described in [5] based on the Ruiz scaling described in [6].
7. Sparse solvers
More often than not the main computational time in an interior-point method is solving (64). Luckily, the linear system is often sparse leading to fast factorization algorithms. As such it is important to use an efficient implementation of a direct sparse solver if one wants the interior-point solver to be computationally efficient. In Clarabel it is possible to utilize the following sparse solvers
- (Rust) faer-rs. Multithreaded. Wasm compatible.
- (Rust/Julia) Quasi-Definite LDL (QDLDL) based on [8]. Single threaded.
- (Rust/Julia) PanuaPardiso (Requires license). Multithreaded.
- (Rust/Julia) oneMKL-Pardiso (Only Intel CPUs). Multithreaded.
- (Julia) cuDSS (CUDA Direct Sparse Solver). GPU-based.
- (Julia) MA57 (Requires license). Multithreaded.
- (Julia) CHOLMOD (Standard Julia Solver). Multithreaded.
7.1. Sparsity exploitation
7.1.1. Augmented sparsity
In numerical computations one often meets a matrix of the form sparse-plus-low-rank. The general form of this is the following
(75)
where is sparse and and with . The problem with the above matrix is that forming the outer products (i.e. assembling the plus-low-rank part) will ruin the sparsity of and in turn will be a dense matrix. Given that our aim is to solve a system of the form lets look at the structure of by performing the product
(76)
The above together with the constraints and we can solve by solving the following equivalent system
(77)
Note that while is sparse it is larger. An important property of the augmented system is that if (and hence ) then is Quasi-Definite and therefore strongly factorizable, meaning that for every permutation one can find and so that [9].
7.2. Second-order cones
7.2.1. The Clarabel approach
Clarabel uses the same approach as in ECOS [10]. In short, they utilize that the structure of for a second-order cone is augmented-sparse, meaning that it can be split as follows
(78)
where . We can generalize the above for all second-order cones by defining
(79)
meaning that
(80)
As such the KKT of the form
(81)
can equivalently be solved by solving
(82)
The approach is simple as it leaves intact and does not scale . However, one has to deal with computing and , which is not unique. In fact Clarabel and ECOS apply different approaches when calculating and . A detail here is that one wants to compute and in a way for which so that the system remains quasi-definite (and therefore strongly factorizable).
7.2.2. The CVXOPT approach
Another approach is that of CVXOPT. Here the diagonal-plus-low-rank structure of the scaling matrix of a second-order cone (and its inverse) is used, i.e. that
(83)
where the and are diagonal. We can again bunch all the scaling matrices together by defining
(84)
so that
(85)
Note that and are defined as before, but are different since the and come from (83) rather than (78). We now show how the rank-update and the known inverse can be used explicitly in order to preserve sparsity. The KKT system of interest using Nesterov-Todd scaling is the following
(86)
By scaling the -variable and multiplying the last row with one finds that
(87)
For simplicity, we now define
(88)
We can now introduce new variables resulting in
(89)
Where we have used that to show why the system is also symmetric. Now the above preserves sparsity. For SOCs, for a scalar (in CVXOPT, for a vector ), so is diagonal with blocks . If the scaling is normalized so that , then , and we can reduce the above as
(90)
7.3. Rotated second-order cones
By rotating the rotated second-order cone back to the second-order cone form we can exploit the sparsity similarly to the regular second-order cone. This rotation can be done by applying the following transformation
(91)
7.4. Power cones
The conjugate barrier for certain power cones has a Hessian that, similar to that of second-order cones, can be represented using augmented sparsity [11]. The intuition here is that e.g. the generalized power cone reduces to a second-order cone when . Given that the augmented sparsity is only available for the conjugate barrier the following is only relevant in the case of dual scaling.
The generalized power cone is parametrized by such that
(92)
and is defined as
(93)
with dual cone
(94)
The power mean cone is parametrized by such that
(95)
and is defined as
(96)
with dual cone
(97)
The relative entropy cone is defined as
(98)
with dual cone
(99)
7.5. Generalized power cones
As shown in [11] the Hessian of the conjugate barrier for the generalized power cones is augmented sparse with and , i.e. that
(100)
where and with
(101)
where
(102)
and , and .
7.6. Power mean cone
For the power mean cone it is shown in [11] that the Hessian of the conjugate barrier is augmented sparse with and , i.e. that
(103)
where and with
(104)
where
(105)
and
, and .
7.7. Relative entropy cone
For the relative entropy cone it is shown in [11] that the Hessian of the conjugate barrier is sparse with the following structure
(106)
where and
(107)
with .
7.8. Semidefinite cones
We start by introducing the vectorization of a symmetric matrix defined below
(108)
Note that the scaling of is in order to preserve inner-products i.e. that . We equivalently introduce the matrization of a vector (and denote it by ) which unsurprisingly has the property as
(109)
Note that the scaling ensures that we preserve inner-products i.e. that .
7.8.1. Computing dense
In CVXOPT the Nesterov-Todd scaling of a semidefinite cone is described by the product
(110)
However, stating it like this gives no insights into the structure of , which is needed when assembling the KKT system (to be precise is needed for the KKT assembly). It turns out that the structure comes from the symmetric Kronecker product given by
(111)
Using the above we can see that this means that the Nesterov-Todd scaling of the semidefinite cone is
(112)
from which it becomes clear that . Weโre now almost ready to describe , but first we need to introduce the following property of the symmetric Kronecker product [12]
(113)
Using the above it follows that
(114)
Now how do we write the symmetric Kronecker product as an explicit matrix? First we need to introduce a mapping that works as follows
(115)
Using it is now possible to describe the symmetric Kronecker product as
(116)
This definition intuitively makes sense. The on the right is applied first and lifts a to i.e. from a symmetric vector to a regular vector. We then apply the sum of regular Kronecker products (the sum makes it map symmetric matrices to symmetric matrices) and then pull the product down back to using . Note that in general is not symmetric. Instead, it represents a single half of an otherwise symmetric product. In the case where , as is the case of NT-scaling, the product is symmetric and in fact
(117)
Cite this post
@misc{paltorp2026conicoptimization, author = {Paltorp, Mikkel}, title = {{Conic Optimization}}, year = {2026}, month = jan, url = {https://mipals.github.io/pdf/2026/01-04-conic-optimization/conic-optimization.pdf}, note = {Blog post}}Bibliography
- [1] P. J. Goulart and Y. Chen, โClarabel: An interior-point solver for conic programs with quadratic objectives.โ [Online]. Available: https://arxiv.org/abs/2405.12762
- [2] L. Vandenberghe, โThe CVXOPT linear and quadratic cone program solvers.โ [Online]. Available: https://www.seas.ucla.edu/~vandenbe/publications/coneprog.pdf
- [3] L. Tunรงel, โGeneralization of Primal-Dual Interior-Point Methods to Convex Optimization Problems in Conic Form,โ Foundations of Computational Mathematics, vol. 1, no. 3, pp. 229โ254, 2001, doi: 10.1007/s002080010009.
- [4] J. Dahl and E. D. Andersen, โA primal-dual interior-point algorithm for nonsymmetric exponential-cone optimization,โ Mathematical Programming, 2022, doi: 10.1007/s10107-021-01631-4.
- [5] B. Stellato, G. Banjac, P. Goulart, A. Bemporad, and S. Boyd, โOSQP: an operator splitting solver for quadratic programs,โ Mathematical Programming Computation, vol. 12, no. 4, 2020, doi: 10.1007/s12532-020-00179-2.
- [6] D. Ruiz, โA scaling algorithm to equilibrate both rows and columns norms in matrices.โ [Online]. Available: https://cerfacs.fr/wp-content/uploads/2017/06/14_DanielRuiz.pdf
- [7] R. Takapoui and H. Javadi, โPreconditioning via Diagonal Scaling.โ [Online]. Available: https://arxiv.org/abs/1610.03871
- [8] T. A. Davis, โAlgorithm 849: A concise sparse Cholesky factorization package,โ ACM Transactions on Mathematical Software, vol. 31, no. 4, pp. 587โ591, 2005, doi: 10.1145/1114268.1114277.
- [9] R. J. Vanderbei, โSymmetric Quasidefinite Matrices,โ SIAM Journal on Optimization, 1995, doi: 10.1137/0805005.
- [10] A. Domahidi, E. Chu, and S. Boyd, โECOS: An SOCP solver for embedded systems,โ in European Control Conference (ECC), EUCA, 2013, pp. 3071โ3076. doi: 10.23919/ECC.2013.6669541.
- [11] Y. Chen and P. Goulart, โAn Efficient IPM Implementation for A Class of Nonsymmetric Cones.โ [Online]. Available: https://arxiv.org/abs/2305.12275
- [12] K. Schacke, โOn the Kronecker Product.โ [Online]. Available: https://www.math.uwaterloo.ca/~hwolkowi/henry/reports/kronthesisschaecke04.pdf