Struct roqoqo::operations::MeasureQubit
source · pub struct MeasureQubit {
qubit: usize,
readout: String,
readout_index: usize,
}
Expand description
Measurement gate operation.
This Operation acts on one qubit writing the result of the measurement into a readout. The classical register for the readout needs to be defined in advance by using a Definition operation.
§Note
Here, it is a measurement in terms of quantum mechanics. The obtained result of a single measurement will be either a 0
or a 1
.
In order to be able to derive probabilities in the post-processing, the actual measurement needs to be repeated lots of times.
Fields§
§qubit: usize
The measured qubit.
readout: String
The register for the readout.
readout_index: usize
The index in the readout the result is saved to.
Implementations§
source§impl MeasureQubit
impl MeasureQubit
Trait Implementations§
source§impl Clone for MeasureQubit
impl Clone for MeasureQubit
source§fn clone(&self) -> MeasureQubit
fn clone(&self) -> MeasureQubit
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for MeasureQubit
impl Debug for MeasureQubit
source§impl<'de> Deserialize<'de> for MeasureQubit
impl<'de> Deserialize<'de> for MeasureQubit
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<MeasureQubit> for Operation
impl From<MeasureQubit> for Operation
Implements the From trait from this Operation.
source§fn from(v: MeasureQubit) -> Self
fn from(v: MeasureQubit) -> Self
Performs the conversion.
source§impl From<MeasureQubit> for SingleQubitOperation
impl From<MeasureQubit> for SingleQubitOperation
Implements the From trait from this Operation.
source§fn from(v: MeasureQubit) -> Self
fn from(v: MeasureQubit) -> Self
Performs the conversion.
source§impl InvolveQubits for MeasureQubit
impl InvolveQubits for MeasureQubit
source§fn involved_qubits(&self) -> InvolvedQubits
fn involved_qubits(&self) -> InvolvedQubits
source§fn involved_classical(&self) -> InvolvedClassical
fn involved_classical(&self) -> InvolvedClassical
source§impl Operate for MeasureQubit
impl Operate for MeasureQubit
Implements the universal basic trait Operate for this Operation.
source§impl OperateSingleQubit for MeasureQubit
impl OperateSingleQubit for MeasureQubit
Implements OperateSingleQubit trait for this Operation acting on exactly one qubit.
source§impl PartialEq for MeasureQubit
impl PartialEq for MeasureQubit
source§fn eq(&self, other: &MeasureQubit) -> bool
fn eq(&self, other: &MeasureQubit) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for MeasureQubit
impl Serialize for MeasureQubit
source§impl Substitute for MeasureQubit
impl Substitute for MeasureQubit
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 MeasureQubit
impl SupportedVersion for MeasureQubit
source§impl TryFrom<Operation> for MeasureQubit
impl TryFrom<Operation> for MeasureQubit
Implements the core::convert::TryFrom trait into this Operation.
source§impl TryFrom<SingleQubitOperation> for MeasureQubit
impl TryFrom<SingleQubitOperation> for MeasureQubit
Implements the core::convert::TryFrom trait into this Operation.
impl Eq for MeasureQubit
impl StructuralPartialEq for MeasureQubit
Auto Trait Implementations§
impl Freeze for MeasureQubit
impl RefUnwindSafe for MeasureQubit
impl Send for MeasureQubit
impl Sync for MeasureQubit
impl Unpin for MeasureQubit
impl UnwindSafe for MeasureQubit
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.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.