This folder contains code based on the methods of arXiv:1611.08012 by N. Chancellor, A. Kissenger, J. Roffe, S. Zohren, and D. Horsman
feel free to reuse/modify but please attribute the source and cite our paper in any published work.
All code in this folder was written by Nicholas Chancellor

The programs given here provides a utility to search for CPC codes of arbitrary code distance (in the form of CPC matrices) using random search, and to process the resulting codes both by turning the matrices into latex arrays and by converting them into stabilizer tables. We make no claim that random search is the optimal way to find these codes, in fact we strongly suspect that huge gains could be made by using more sophisticated numerical searching algorithms. This code is meant to provide proof-of-principle of the CPC idea, and allows a utility for others to experiment with simple codes found using the CPC formalism without having to understand our paper and produce the code themselves*.

This folder contains the following GNU Octave code:

CPC_randSearch_simple.m - an octave script which searches for and stores the CPC matrices for distance 3 codes. 
Matrices are stored in cellular arrays MbCell, MpCell, and McCell. This program is directly referenced in the paper.

CPC_randSearch_allDists_simple.m - an octave script which searches for and stores the CPC matrices for codes of arbitrary user specified distance (expressed in terms of the number of errors the code can correct). Matrices are stored in cellular arrays MbCell, MpCell, and McCell. This program is directly referenced in the paper.

CPC_randSearch_allDists_includeY.m - same as CPC_randSearch_allDists_simple.m, but using an error model which includes Pauli Y errors

CPC_mats_2_stabalizers.m - an octave function which takes CPC matrices and a filename as input, and saves the stabalizer table to the user specified filename in latex format

convert_to_latex_array.m - an octave function which takes a numerical array and filename as input, and saves the array in latex format to the user specified filename.

* Note that this statement of intended purpose does NOT imply that we provide any kind of warranty on our code, which we do not.
