# TraceNorm

 Other toolboxes required TraceNorm Computes the trace norm of an operator none kpNormKyFanNormSchattenNorm Norms yes (convex)

TraceNorm is a function that computes the trace norm of an operator (i.e., the sum of its singular values). It works with both full and sparse matrices.

## Syntax

• NRM = TraceNorm(X)

## Argument descriptions

• X: An operator to have its trace norm computed.

## Examples

### Trace norm of a density matrix

Density matrices all have trace norm equal to 1:

>> rho = RandomDensityMatrix(100);
>> TraceNorm(rho)

ans =

1.0000

### Can be used with CVX

This function can be used in the objective function or constraints of a CVX optimization problem. For example, the following code computes the minimum value of $\mathrm{Tr}(S\rho)$ over all density matrices $\rho$ with the property that the trace norm of their realignment is no larger than 1 (this set of state approximates the set of separable states), where $S$ is the swap operator:

>> cvx_begin sdp quiet
variable rho(9,9) hermitian;
minimize trace(rho*SwapOperator(3));
subject to
trace(rho) == 1;
rho >= 0;
TraceNorm(Realignment(rho)) <= 1;
cvx_end
cvx_optval

cvx_optval =

-0.3333

## Source code

Click on "expand" to the right to view the MATLAB source code for this function.

1. %%  TRACENORM  Computes the trace norm of an operator
2. %   This function has one required argument:
3. %     X: an operator
4. %
5. %   NRM = TraceNorm(X) is the trace norm of X.
6. %
7. %   URL: http://www.qetlab.com/TraceNorm
8. 
9. %   requires: kpNorm.m
10. %   author: Nathaniel Johnston (nathaniel@njohnston.ca)
11. %   package: QETLAB
12. %   last updated: October 22, 2014
13. 
14. function nrm = TraceNorm(X)
15. 
16. nrm = kpNorm(X,min(size(X)),1);