stabilizer-ch-form-rust 0.1.0

A Rust library implementing CH form representation of stabilizer states for quantum computing simulations.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use crate::{StabilizerCHForm, error::Result};

impl StabilizerCHForm {
    // This implementation may not be the most efficient due to multiple H gate applications.
    // We assume that SqrtX gate is not so frequently used in practice...
    pub(crate) fn left_multiply_sqrt_x(&mut self, qarg: usize) -> Result<()> {
        self.left_multiply_h(qarg)?;
        self.left_multiply_s(qarg)?;
        self.left_multiply_h(qarg)
    }

    pub(crate) fn left_multiply_sqrt_xdg(&mut self, qarg: usize) -> Result<()> {
        self.left_multiply_h(qarg)?;
        self.left_multiply_sdg(qarg)?;
        self.left_multiply_h(qarg)
    }
}