Struct BooleanState
pub struct BooleanState {
pub functions: Vec<FxHashSet<Monomial>>,
pub registers: Vec<Register>,
}Fields§
§functions: Vec<FxHashSet<Monomial>>§registers: Vec<Register>Implementations§
§impl BooleanState
impl BooleanState
pub fn new_with_regs(regs: &[Register]) -> Self
pub fn new_with_regs(regs: &[Register]) -> Self
Construct a BooleanState using explicit register definitions. This initializes each qubit’s boolean function to its corresponding input variable x_i, preserving the generic unitary matrix representation.
pub fn new(num_qubits: usize) -> Self
pub fn new(num_qubits: usize) -> Self
Backward-compatible constructor that defaults to a single register named “q”.
pub fn apply_xor_with_poly(&mut self, target: usize, poly: &FxHashSet<Monomial>)
pub fn apply_xor(&mut self, control: usize, target: usize)
pub fn apply_xor(&mut self, control: usize, target: usize)
Apply XOR logic for CNOT gates and pure boolean operations.
pub fn get_single_var(&self, qubit: usize) -> Option<u32>
pub fn get_single_var(&self, qubit: usize) -> Option<u32>
Extract the variable ID if the boolean function is a single linear variable.
pub fn get_used_vars(&self) -> FxHashSet<u32>
pub fn substitute_var_with_poly( &mut self, target_var: u32, sub_poly: &FxHashSet<Monomial>, )
pub fn format_qubit_name(&self, flat_index: usize) -> String
pub fn format_qubit_name(&self, flat_index: usize) -> String
Format a flat qubit index into its physical register name (e.g., “|ancilla_0>”).
Trait Implementations§
§impl Clone for BooleanState
impl Clone for BooleanState
Auto Trait Implementations§
impl Freeze for BooleanState
impl RefUnwindSafe for BooleanState
impl Send for BooleanState
impl Sync for BooleanState
impl Unpin for BooleanState
impl UnsafeUnpin for BooleanState
impl UnwindSafe for BooleanState
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more