What the code currently calls a polarizer_dir is actually a Bloch vector. Variables should be renamed.
polarizer_dir