pub struct GateData { /* private fields */ }Expand description
Data associated with a gate operation.
Implementations§
Source§impl GateData
impl GateData
Sourcepub fn new(gate_type: GateType, args: Vec<usize>) -> Self
pub fn new(gate_type: GateType, args: Vec<usize>) -> Self
Creates gate data with a gate type and positional arguments.
Sourcepub fn with_params(self, params: Vec<f64>) -> Self
pub fn with_params(self, params: Vec<f64>) -> Self
Sets the floating-point parameters associated with the gate.
Sourcepub fn with_data(self, data: String) -> Self
pub fn with_data(self, data: String) -> Self
Sets the optional opaque payload associated with the gate.
Sourcepub fn with_conditional(
self,
conditional_bits: Vec<usize>,
conditional_values: Vec<bool>,
) -> Self
pub fn with_conditional( self, conditional_bits: Vec<usize>, conditional_values: Vec<bool>, ) -> Self
Sets the classical conditions required for the gate to execute.
Sourcepub fn get_gate_type(&self) -> &GateType
pub fn get_gate_type(&self) -> &GateType
Returns the gate type.
Sourcepub fn get_params(&self) -> &Vec<f64>
pub fn get_params(&self) -> &Vec<f64>
Returns the gate parameters.
Sourcepub fn get_conditional_bits(&self) -> &Vec<usize>
pub fn get_conditional_bits(&self) -> &Vec<usize>
Returns the classical bits used as conditions.
Sourcepub fn get_conditional_values(&self) -> &Vec<bool>
pub fn get_conditional_values(&self) -> &Vec<bool>
Returns the required values for the classical conditions.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for GateData
impl<'de> Deserialize<'de> for GateData
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for GateData
Auto Trait Implementations§
impl Freeze for GateData
impl RefUnwindSafe for GateData
impl Send for GateData
impl Sync for GateData
impl Unpin for GateData
impl UnsafeUnpin for GateData
impl UnwindSafe for GateData
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