fn write_channel_state( writer: &mut Writer, ks: [Complex; 2], q: &[[f64; 2]], polarizations: &[u8], measure: f64, )