## Code for Computing Some Unextendible Product Bases

This page contains MATLAB code that can be used to construct matrices satisfying the conditions of Lemmas 4, 5, and 6 of , and thus construct minimal unextendible product bases in the dimensions discussed in that paper.

Step 2: Unzip the file.

Step 3: Place all of the files in your MATLAB scripts directory.

### Usage

The three functions that are relevant for us are CJ_Lemma5, CJ_Lemma6, and HollowUnitary. The first two functions construct matrices satisfying the conditions of Lemmas 5 and 6, respectively, using the methods discussed in Section 5 of . The HollowUnitary function produces a unitary matrix with zeroes along the diagonal but no zero entries elsewhere. This unitary matrix has been numerically verified to satisfy all conditions of Lemma 4 when 4 ≤ d ≤ 19. All three functions have help files that can be accessed within MATLAB. We include some usage examples here.

### CJ_Lemma5 Examples

The following code produces a matrix satisfying both conditions of Lemma 5 in the q = 4, r = 2, s = 1 case:

```>> CJ_Lemma5(4,2,1)

ans =

-0.6636    0.2561   -0.7762    0.7038   -0.5810   -0.5808    0.7382    0.4663
-0.7206    0.2534    0.5652    0.1211   -0.4691    0.6656   -0.6744    0.8129
0.2009   -0.9328   -0.2794    0.7001    0.6651    0.4688    0.0194    0.3489```

By specifying an optional fourth argument, we can produce matrices that not only satisfy the conditions of the lemma, but also has integer entries. This procedure causes it to take much longer to construct the desired matrix, however. The fourth argument should be a positive integer – the smaller this integer is, the smaller the entries of the matrix will be, but the longer the computation will take (and if the argument is too small, the computation may never finish, so be careful).

```>> CJ_Lemma5(4,2,1,10)

ans =

[ 6, 7,  7, 3, 14,  2, -8, -72]
[ 8, 8, 10, 5, -9, -3,  5,  56]
[ 4, 8, -8, 3,  1,  3,  2,   7]

>> CJ_Lemma5(4,2,1,2)

ans =

[  2, -1, 1,  2, -1, 1,  6, -2]
[  1,  2, 1, -2, -3, 0, -2, -4]
[ -2,  2, 2, -2,  2, 1,  5,  3]

>> CJ_Lemma5(4,2,1,1)
Warning: Tried (and failed) 10 times to find a matrix satisfying all imposed conditions. You may
have better luck if you increase (or omit) the NICE argument.```

### CJ_Lemma6 Examples

The following code produces a matrix satisfying both conditions of Lemma 6 in the k = 1 (i.e., d = 5) case:

```>> CJ_Lemma6(1)

ans =

-0.5128   -0.2448    0.5115    0.3582    0.4373    0.4124   -0.5073   -0.5474
0.5115    0.3582    0.8270    0.8969   -0.1258   -0.1394    0.1460    0.1851
0.3981    0.7601   -0.1346   -0.2188    0.1248   -0.0073   -0.5819   -0.5984
0.3901    0.0136   -0.1319   -0.0039    0.8767    0.8878    0.2990    0.1907
-0.4059    0.4835    0.1372   -0.1391    0.0937    0.1495    0.5416    0.5212```

As before, we can create a matrix satisfying the requirements of the lemma with the additional property that the entries are integers by specifying an optional “niceness” argument. The smaller this argument is, the smaller the entries in the matrix will be but the longer the computation will take.

```>> CJ_Lemma6(1,10)

ans =

[  5, -1, 2, -3,  0,  0,  277, -65]
[ -2, -3, 5,  1,  0,  0,  831,  26]
[  6, -1, 0,  0, -9, -5,  -41, -18]
[  5, -9, 0,  0,  1,  6, -369, -15]
[  8, -2, 0,  0,  0,  0,  296,  70]

>> CJ_Lemma6(1,2)

ans =

[  1,  1, -1, 2, 0, 0,  2,  2]
[  1, -2,  1, 1, 0, 0, -4,  2]
[  2, -2,  0, 0, 1, 1,  8,  4]
[ -1,  2,  0, 0, 1, 2, -8, -2]
[ -2,  2,  0, 0, 0, 0, 11,  7]

>> CJ_Lemma6(1,1)
Warning: Tried (and failed) 10 times to find a matrix satisfying all imposed conditions. You may
have better luck if you increase (or omit) the NICE argument.```

### HollowUnitary Examples

The following code produces a matrix that satisfies the conditions of Lemma 4 in the d = 4, b = 0 case:

```>> HollowUnitary(4)

ans =

0             0.5774             0.5774             0.5774
0.5774                  0 - 0.0000i  -0.0000 + 0.5774i   0.0000 - 0.5774i
0.5774            -0.0000 - 0.5774i        0 - 0.0000i  -0.0000 + 0.5774i
0.5774             0.0000 + 0.5774i  -0.0000 - 0.5774i   0.0000 - 0.0000i```

Note that this function can only compute matrices that satisfy the conditions of the lemma in the b = 0 case. Furthermore, this matrix is only guaranteed to satisfy condition (iii) of the lemma when 4 ≤ d ≤ 19. In general, computing a matrix that satisfies conditions (i) and (ii) requires solving a system of linear and quadratic equations, which itself is computationally very difficult, and then verifying condition (iii) seems to require roughly an additional $O(4^d)$ time.

Furthermore, note that matrix output by this function is not random (unlike the matrices produced by the CJ_Lemma5 and CJ_Lemma6 functions) – it is constructed from an eigenbasis using the method described in Section 5 of .

### References

1. J. Chen and N. Johnston. The Minimum Size of Unextendible Product Bases in the Bipartite Case (and Some Multipartite Cases). E-print: arXiv:1301.1406 [quant-ph], 2013.