Proof of concept implementation to find optimal mixers. The code is far from an optimal implementation, so do not expect good run times.
Run sample to get the average cost for randomly chosen B, or open the notebook LogicalXMixer to see a few examples.
If you use the code, citing our paper is highly appreciated. https://arxiv.org/abs/2306.17083.