Struct roqoqo::operations::PragmaConditional
source · pub struct PragmaConditional {
condition_register: String,
condition_index: usize,
circuit: Circuit,
}
Expand description
The conditional PRAGMA operation.
This PRAGMA executes a circuit when the condition bit/bool stored in a crate::registers::BitRegister is true.
Fields§
§condition_register: String
The name of the crate::registers::BitRegister containting the condition bool value.
condition_index: usize
The index in the crate::registers::BitRegister containting the condition bool value.
circuit: Circuit
The circuit executed if the condition is met.
Implementations§
source§impl PragmaConditional
impl PragmaConditional
sourcepub fn condition_register(&self) -> &String
pub fn condition_register(&self) -> &String
Returns the value of the field condition_register
.
sourcepub fn condition_index(&self) -> &usize
pub fn condition_index(&self) -> &usize
Returns the value of the field condition_index
.
Trait Implementations§
source§impl Clone for PragmaConditional
impl Clone for PragmaConditional
source§fn clone(&self) -> PragmaConditional
fn clone(&self) -> PragmaConditional
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for PragmaConditional
impl Debug for PragmaConditional
source§impl<'de> Deserialize<'de> for PragmaConditional
impl<'de> Deserialize<'de> for PragmaConditional
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>,
source§impl From<PragmaConditional> for Operation
impl From<PragmaConditional> for Operation
Implements the From trait from this Operation.
source§fn from(v: PragmaConditional) -> Self
fn from(v: PragmaConditional) -> Self
Performs the conversion.
source§impl From<PragmaConditional> for PragmaOperation
impl From<PragmaConditional> for PragmaOperation
Implements the From trait from this Operation.
source§fn from(v: PragmaConditional) -> Self
fn from(v: PragmaConditional) -> Self
Performs the conversion.
source§impl InvolveQubits for PragmaConditional
impl InvolveQubits for PragmaConditional
source§fn involved_qubits(&self) -> InvolvedQubits
fn involved_qubits(&self) -> InvolvedQubits
Lists all involved qubits.
source§fn involved_classical(&self) -> InvolvedClassical
fn involved_classical(&self) -> InvolvedClassical
source§impl Operate for PragmaConditional
impl Operate for PragmaConditional
Implements the universal basic trait Operate for this Operation.
source§impl PartialEq for PragmaConditional
impl PartialEq for PragmaConditional
source§fn eq(&self, other: &PragmaConditional) -> bool
fn eq(&self, other: &PragmaConditional) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for PragmaConditional
impl Serialize for PragmaConditional
source§impl Substitute for PragmaConditional
impl Substitute for PragmaConditional
Substitute trait allowing to replace symbolic parameters and to perform qubit mappings.
source§fn remap_qubits(
&self,
mapping: &HashMap<usize, usize>
) -> Result<Self, RoqoqoError>
fn remap_qubits( &self, mapping: &HashMap<usize, usize> ) -> Result<Self, RoqoqoError>
Remaps qubits in clone of the operation.
source§fn substitute_parameters(
&self,
calculator: &Calculator
) -> Result<Self, RoqoqoError>
fn substitute_parameters( &self, calculator: &Calculator ) -> Result<Self, RoqoqoError>
Substitutes symbolic parameters in clone of the operation.
source§impl SupportedVersion for PragmaConditional
impl SupportedVersion for PragmaConditional
source§impl TryFrom<Operation> for PragmaConditional
impl TryFrom<Operation> for PragmaConditional
Implements the core::convert::TryFrom trait into this Operation.
source§impl TryFrom<PragmaOperation> for PragmaConditional
impl TryFrom<PragmaOperation> for PragmaConditional
Implements the core::convert::TryFrom trait into this Operation.
impl OperatePragma for PragmaConditional
impl StructuralPartialEq for PragmaConditional
Auto Trait Implementations§
impl Freeze for PragmaConditional
impl RefUnwindSafe for PragmaConditional
impl Send for PragmaConditional
impl Sync for PragmaConditional
impl Unpin for PragmaConditional
impl UnwindSafe for PragmaConditional
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
source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self
from the equivalent element of its
superset. Read moresource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self
is actually part of its subset T
(and can be converted to it).source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset
but without any property checks. Always succeeds.source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self
to the equivalent element of its superset.