Skip to main content
deleted 23 characters in body
Source Link
xzczd
  • 68.4k
  • 9
  • 174
  • 489

Here's a fully compiled version, principles applied in modifying the code has been mentioned in the links above:

ssamp2 = Compile[{{n, _Integer}, {nd, _Integer}}, 
  Partition[Function[xyzw, {{xyzw[[1]] + I xyzw[[2]], 
                             -xyzw[[3]] + I xyzw[[4]]}, 
                            {xyzw[[3]] + I xyzw[[4]], 
                             xyzw[[1]] - I xyzw[[2]]}}]@#/Sqrt@Total[#^2] & /@ 
   Flatten[Transpose@RandomVariate[NormalDistribution[0RandomVariate[NormalDistribution[0, 1], {n, nd, 4}], 1], n]]

Here's a fully compiled version, principles applied in modifying the code has been mentioned in the links above:

ssamp2 = Compile[{{n, _Integer}, {nd, _Integer}}, 
  Partition[Function[xyzw, {{xyzw[[1]] + I xyzw[[2]], 
                             -xyzw[[3]] + I xyzw[[4]]}, 
                            {xyzw[[3]] + I xyzw[[4]], 
                             xyzw[[1]] - I xyzw[[2]]}}]@#/Sqrt@Total[#^2] & /@ 
   Flatten[Transpose@RandomVariate[NormalDistribution[0, 1], {n, nd, 4}], 1], n]]

Here's a fully compiled version, principles applied in modifying the code has been mentioned in the links above:

ssamp2 = Compile[{{n, _Integer}, {nd, _Integer}}, 
  Partition[Function[xyzw, {{xyzw[[1]] + I xyzw[[2]], 
                             -xyzw[[3]] + I xyzw[[4]]}, 
                            {xyzw[[3]] + I xyzw[[4]], 
                             xyzw[[1]] - I xyzw[[2]]}}]@#/Sqrt@Total[#^2] & /@ 
   RandomVariate[NormalDistribution[0, 1], {n nd, 4}], n]]
added 101 characters in body
Source Link
xzczd
  • 68.4k
  • 9
  • 174
  • 489

Here's a fully compiled version, principles applied in modifying the code has been mentioned in the links above:

ssamp2 = Compile[{{n, _Integer}, {nd, _Integer}}, 
  Function[xyzwPartition[Function[xyzw, {{xyzw[[1]] + I xyzw[[2]], 
                             -xyzw[[3]] + I xyzw[[4]]}, 
                            {xyzw[[3]] + I xyzw[[4]], 
          I xyzw[[4]],                  xyzw[[1]] - I xyzw[[2]]}}]@#/Sqrt@Total[#^2] & /@ 
   Flatten[Transpose@RandomVariate[NormalDistribution[0, 1], {n, nd, 4}], 1]]1], n]]

Here's a fully compiled version, principles applied in modifying the code has been mentioned in the links above:

ssamp2 = Compile[{{n, _Integer}, {nd, _Integer}}, 
  Function[xyzw, {{xyzw[[1]] + I xyzw[[2]], -xyzw[[3]] + I xyzw[[4]]}, {xyzw[[3]] + 
          I xyzw[[4]], xyzw[[1]] - I xyzw[[2]]}}]@#/Sqrt@Total[#^2] & /@ 
   Flatten[Transpose@RandomVariate[NormalDistribution[0, 1], {n, nd, 4}], 1]]

Here's a fully compiled version, principles applied in modifying the code has been mentioned in the links above:

ssamp2 = Compile[{{n, _Integer}, {nd, _Integer}}, 
  Partition[Function[xyzw, {{xyzw[[1]] + I xyzw[[2]], 
                             -xyzw[[3]] + I xyzw[[4]]}, 
                            {xyzw[[3]] + I xyzw[[4]], 
                             xyzw[[1]] - I xyzw[[2]]}}]@#/Sqrt@Total[#^2] & /@ 
   Flatten[Transpose@RandomVariate[NormalDistribution[0, 1], {n, nd, 4}], 1], n]]
deleted 1 character in body
Source Link
xzczd
  • 68.4k
  • 9
  • 174
  • 489

Here's a fully compiled version, principles applied in modifying the code has been mentioned in the links above:

ssamp2 = Compile[{{n, _Integer}, {nd, _Integer}}, 
  Function[xyzw, {{xyzw[[1]] + I xyzw[[2]], -xyzw[[3]] + I xyzw[[4]]}, {xyzw[[3]] + 
          I xyzw[[4]], xyzw[[1]] - I xyzw[[2]]}}]@#/Sqrt[Total[#^2]]Sqrt@Total[#^2] & /@ 
   Flatten[Transpose@RandomVariate[NormalDistribution[0, 1], {n, nd, 4}], 1]]

Here's a fully compiled version, principles applied in modifying the code has been mentioned in the links above:

ssamp2 = Compile[{{n, _Integer}, {nd, _Integer}}, 
  Function[xyzw, {{xyzw[[1]] + I xyzw[[2]], -xyzw[[3]] + I xyzw[[4]]}, {xyzw[[3]] + 
          I xyzw[[4]], xyzw[[1]] - I xyzw[[2]]}}]@#/Sqrt[Total[#^2]] & /@ 
   Flatten[Transpose@RandomVariate[NormalDistribution[0, 1], {n, nd, 4}], 1]]

Here's a fully compiled version, principles applied in modifying the code has been mentioned in the links above:

ssamp2 = Compile[{{n, _Integer}, {nd, _Integer}}, 
  Function[xyzw, {{xyzw[[1]] + I xyzw[[2]], -xyzw[[3]] + I xyzw[[4]]}, {xyzw[[3]] + 
          I xyzw[[4]], xyzw[[1]] - I xyzw[[2]]}}]@#/Sqrt@Total[#^2] & /@ 
   Flatten[Transpose@RandomVariate[NormalDistribution[0, 1], {n, nd, 4}], 1]]
Source Link
xzczd
  • 68.4k
  • 9
  • 174
  • 489
Loading