Struct PathSum
pub struct PathSum {
pub p: PhasePolynomial,
pub f: BooleanState,
pub v: VariableManager,
pub stats: StatisticsManager,
pub rr_tolerance: f64,
pub rr_approximate: bool,
}Fields§
§p: PhasePolynomial§f: BooleanState§v: VariableManager§stats: StatisticsManager§rr_tolerance: f64Per-request tolerance for approximate RR matching (cycles).
rr_approximate: boolWhether a reduction rule used approximate coefficient matching.
Implementations§
§impl PathSum
impl PathSum
pub fn new(num_qubits: usize) -> Self
pub fn set_auto_reduce(&mut self, enable: bool)
pub fn is_auto_reduce(&self) -> bool
pub fn quantum_circuit(regs: &[Register], initial_state: Option<&[u8]>) -> Self
pub fn set_initial_state(&mut self, state: &[u8])
pub fn set_initial_state(&mut self, state: &[u8])
Set the initial quantum state (e.g., |010> passed as &[0, 1, 0]). This triggers algebraic substitution across both Phase Polynomial (P) and Boolean State (F).
pub fn is_identity(&self) -> bool
pub fn is_identity_up_to_phase(&self) -> bool
pub fn get_global_phase(&self) -> Option<PhaseCoeff>
pub fn print_status(&self) -> String
§impl PathSum
impl PathSum
pub fn get_reducible_vars(&self) -> Vec<u32>
pub fn full_reduce(&mut self)
pub fn try_reduce_elim(&mut self, reducible_vars: &[u32]) -> bool
pub fn try_reduce_hh(&mut self, reducible_vars: &[u32]) -> bool
pub fn try_reduce_hh(&mut self, reducible_vars: &[u32]) -> bool
Attempt to execute HH Rule (Feynman path cancellation)
pub fn try_reduce_omega(&mut self, reducible_vars: &[u32]) -> bool
pub fn try_reduce_omega(&mut self, reducible_vars: &[u32]) -> bool
Attempt to execute ω-rule (Phase Gadget simplification)
Trait Implementations§
§impl QuantumGates for PathSum
impl QuantumGates for PathSum
§fn apply_u2(&mut self, qubit: usize, phi: Angle, lam: Angle, side: Side)
fn apply_u2(&mut self, qubit: usize, phi: Angle, lam: Angle, side: Side)
U2 Gate: X-Y plane rotation defined as U2(phi, lam) = U3(pi/2, phi, lam)
§fn apply_u3(
&mut self,
qubit: usize,
theta: Angle,
phi: Angle,
lam: Angle,
side: Side,
)
fn apply_u3( &mut self, qubit: usize, theta: Angle, phi: Angle, lam: Angle, side: Side, )
U3(theta, phi, lam)
fn apply_x(&mut self, qubit: usize, side: Side)
fn apply_z(&mut self, qubit: usize, side: Side)
fn apply_y(&mut self, qubit: usize, side: Side)
fn apply_h(&mut self, qubit: usize, side: Side)
fn apply_s(&mut self, qubit: usize, side: Side)
fn apply_sdg(&mut self, qubit: usize, side: Side)
fn apply_cx(&mut self, control: usize, target: usize, side: Side)
fn apply_cz(&mut self, control: usize, target: usize, side: Side)
fn apply_ccx( &mut self, control1: usize, control2: usize, target: usize, side: Side, )
fn apply_t(&mut self, qubit: usize, side: Side)
fn apply_tdg(&mut self, qubit: usize, side: Side)
fn apply_rz(&mut self, qubit: usize, theta: Angle, side: Side)
fn apply_p(&mut self, qubit: usize, theta: Angle, side: Side)
fn apply_u1(&mut self, qubit: usize, theta: Angle, side: Side)
fn apply_u( &mut self, qubit: usize, theta: Angle, phi: Angle, lam: Angle, side: Side, )
Auto Trait Implementations§
impl Freeze for PathSum
impl RefUnwindSafe for PathSum
impl Send for PathSum
impl Sync for PathSum
impl Unpin for PathSum
impl UnsafeUnpin for PathSum
impl UnwindSafe for PathSum
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