X-Git-Url: https://s3miclassical.com/gitweb/?p=weak_simulation_stab_extent.git;a=blobdiff_plain;f=randomstabilizerstate_equatorial.c;fp=randomstabilizerstate_equatorial.c;h=9a615911858ec29170af8ecd74ad81cc0b0507f6;hp=0000000000000000000000000000000000000000;hb=7bc25656311c391af6a4d5814cc82080981c63c4;hpb=d914e7c183347b1340988e0869a6e053dd573991 diff --git a/randomstabilizerstate_equatorial.c b/randomstabilizerstate_equatorial.c new file mode 100644 index 0000000..9a61591 --- /dev/null +++ b/randomstabilizerstate_equatorial.c @@ -0,0 +1,66 @@ +#include +#include +#include +#include +#include + +#include "matrix.h" + +#include "randomstabilizerstate_equatorial.h" + +#define ZEROTHRESHOLD (0.00000001) + +// Note: Make sure you seed the random number generator before calling this! +// i.e. srand((unsigned)time(NULL)); +void randomstabilizerstate_equatorial(int n, int* k, int** h, int*** G, int*** GBar, int* Q, int** D, int*** J) +{ + // vector and matrix pointers should all be passed unallocated! (no freeing of memory performed) + + int d; + + int i, j; + + d = 0; + + *k = n; // we will get it to be k=n-d by calling shrinkstar d times below + + int info; + int numsingvals = -1; + + *G = calloc(n, sizeof(int*)); *GBar = calloc(n, sizeof(int*)); + *h = calloc(n, sizeof(int)); + + for(i=0; i