paulistrings/channel/
unitary.rs1#![allow(unused)]
4
5use super::{Channel, OutputBuffer};
6use num_complex::Complex64;
7
8pub struct GeneralUnitary1Q {
14 pub support: [u32; 1],
16 pub table: [[Complex64; 4]; 4],
19}
20
21impl Channel<1> for GeneralUnitary1Q {
22 fn max_fanout(&self) -> usize {
23 4
24 }
25
26 fn support(&self) -> &[u32] {
27 &self.support
28 }
29
30 fn apply(
31 &self,
32 _input_x: &[u64; 1],
33 _input_z: &[u64; 1],
34 _coeff: Complex64,
35 _out: &mut OutputBuffer<'_, 1>,
36 ) {
37 todo!("§6: index `table` by input bits at support; emit nonzero output Paulis")
38 }
39}
40
41pub struct GeneralUnitary2Q {
43 pub support: [u32; 2],
45 pub table: [[Complex64; 16]; 16],
49}
50
51impl Channel<1> for GeneralUnitary2Q {
52 fn max_fanout(&self) -> usize {
53 16
54 }
55
56 fn support(&self) -> &[u32] {
57 &self.support
58 }
59
60 fn apply(
61 &self,
62 _input_x: &[u64; 1],
63 _input_z: &[u64; 1],
64 _coeff: Complex64,
65 _out: &mut OutputBuffer<'_, 1>,
66 ) {
67 todo!("§6: index `table` by 4 input bits at support; emit nonzero output Paulis")
68 }
69}