Struct roqoqo::operations::PragmaGlobalPhase
source · pub struct PragmaGlobalPhase {
phase: CalculatorFloat,
}
Expand description
The global phase PRAGMA operation.
This PRAGMA Operation signals that the quantum register picks up a global phase, i.e. it provides information that there is a global phase to be considered.
Fields§
§phase: CalculatorFloat
The picked up global phase.
Implementations§
source§impl PragmaGlobalPhase
impl PragmaGlobalPhase
sourcepub fn phase(&self) -> &CalculatorFloat
pub fn phase(&self) -> &CalculatorFloat
Returns the value of the field phase
.
sourcepub fn new(phase: CalculatorFloat) -> Self
pub fn new(phase: CalculatorFloat) -> Self
Creates a new instance of PragmaGlobalPhase
.
Trait Implementations§
source§impl Clone for PragmaGlobalPhase
impl Clone for PragmaGlobalPhase
source§fn clone(&self) -> PragmaGlobalPhase
fn clone(&self) -> PragmaGlobalPhase
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for PragmaGlobalPhase
impl Debug for PragmaGlobalPhase
source§impl<'de> Deserialize<'de> for PragmaGlobalPhase
impl<'de> Deserialize<'de> for PragmaGlobalPhase
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<PragmaGlobalPhase> for Operation
impl From<PragmaGlobalPhase> for Operation
Implements the From trait from this Operation.
source§fn from(v: PragmaGlobalPhase) -> Self
fn from(v: PragmaGlobalPhase) -> Self
Performs the conversion.
source§impl From<PragmaGlobalPhase> for PragmaOperation
impl From<PragmaGlobalPhase> for PragmaOperation
Implements the From trait from this Operation.
source§fn from(v: PragmaGlobalPhase) -> Self
fn from(v: PragmaGlobalPhase) -> Self
Performs the conversion.
source§impl InvolveQubits for PragmaGlobalPhase
impl InvolveQubits for PragmaGlobalPhase
source§fn involved_qubits(&self) -> InvolvedQubits
fn involved_qubits(&self) -> InvolvedQubits
Lists all involved qubits (here, none).
source§fn involved_classical(&self) -> InvolvedClassical
fn involved_classical(&self) -> InvolvedClassical
source§impl Operate for PragmaGlobalPhase
impl Operate for PragmaGlobalPhase
Implements the universal basic trait Operate for this Operation.
source§impl PartialEq for PragmaGlobalPhase
impl PartialEq for PragmaGlobalPhase
source§fn eq(&self, other: &PragmaGlobalPhase) -> bool
fn eq(&self, other: &PragmaGlobalPhase) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for PragmaGlobalPhase
impl Serialize for PragmaGlobalPhase
source§impl Substitute for PragmaGlobalPhase
impl Substitute for PragmaGlobalPhase
Implements Substitute trait allowing to replace symbolic parameters and to perform qubit mappings.
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§fn remap_qubits(
&self,
mapping: &HashMap<usize, usize>
) -> Result<Self, RoqoqoError>
fn remap_qubits( &self, mapping: &HashMap<usize, usize> ) -> Result<Self, RoqoqoError>
Remaps the qubits in clone of the operation.
source§impl SupportedVersion for PragmaGlobalPhase
impl SupportedVersion for PragmaGlobalPhase
source§impl TryFrom<Operation> for PragmaGlobalPhase
impl TryFrom<Operation> for PragmaGlobalPhase
Implements the core::convert::TryFrom trait into this Operation.
source§impl TryFrom<PragmaOperation> for PragmaGlobalPhase
impl TryFrom<PragmaOperation> for PragmaGlobalPhase
Implements the core::convert::TryFrom trait into this Operation.
impl OperatePragma for PragmaGlobalPhase
impl StructuralPartialEq for PragmaGlobalPhase
Auto Trait Implementations§
impl Freeze for PragmaGlobalPhase
impl RefUnwindSafe for PragmaGlobalPhase
impl Send for PragmaGlobalPhase
impl Sync for PragmaGlobalPhase
impl Unpin for PragmaGlobalPhase
impl UnwindSafe for PragmaGlobalPhase
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.