pub struct SingleExcitationLoad {
qubit: usize,
mode: usize,
}
Expand description
Loads a single excitation from a bosonic mode into a qubit as follows (c1 |0⟩_B + c2 |1⟩_B) ⨂ |0⟩_Q -> |0⟩_B ⨂ (c1 |0⟩_Q + c2 |1⟩_Q)
Note: if the initial qubit state is |1⟩_Q the operation is only defined if c2 = 0
Fields§
§qubit: usize
The qubit involved.
mode: usize
The bosonic mode involved.
Implementations§
Trait Implementations§
source§impl Clone for SingleExcitationLoad
impl Clone for SingleExcitationLoad
source§fn clone(&self) -> SingleExcitationLoad
fn clone(&self) -> SingleExcitationLoad
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for SingleExcitationLoad
impl Debug for SingleExcitationLoad
source§impl<'de> Deserialize<'de> for SingleExcitationLoad
impl<'de> Deserialize<'de> for SingleExcitationLoad
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<SingleExcitationLoad> for ModeGateOperation
impl From<SingleExcitationLoad> for ModeGateOperation
Implements the From trait from this Operation.
source§fn from(v: SingleExcitationLoad) -> Self
fn from(v: SingleExcitationLoad) -> Self
Performs the conversion.
source§impl From<SingleExcitationLoad> for Operation
impl From<SingleExcitationLoad> for Operation
Implements the From trait from this Operation.
source§fn from(v: SingleExcitationLoad) -> Self
fn from(v: SingleExcitationLoad) -> Self
Performs the conversion.
source§impl From<SingleExcitationLoad> for SingleModeGateOperation
impl From<SingleExcitationLoad> for SingleModeGateOperation
Implements the From trait from this Operation.
source§fn from(v: SingleExcitationLoad) -> Self
fn from(v: SingleExcitationLoad) -> Self
Performs the conversion.
source§impl From<SingleExcitationLoad> for SingleModeOperation
impl From<SingleExcitationLoad> for SingleModeOperation
Implements the From trait from this Operation.
source§fn from(v: SingleExcitationLoad) -> Self
fn from(v: SingleExcitationLoad) -> Self
Performs the conversion.
source§impl From<SingleExcitationLoad> for SingleQubitOperation
impl From<SingleExcitationLoad> for SingleQubitOperation
Implements the From trait from this Operation.
source§fn from(v: SingleExcitationLoad) -> Self
fn from(v: SingleExcitationLoad) -> Self
Performs the conversion.
source§impl InvolveModes for SingleExcitationLoad
impl InvolveModes for SingleExcitationLoad
Implements InvolveModes trait for the bosonic modes involved in this Operation.
source§fn involved_modes(&self) -> InvolvedModes
fn involved_modes(&self) -> InvolvedModes
Returns a list of all involved bosonic modes.
source§impl InvolveQubits for SingleExcitationLoad
impl InvolveQubits for SingleExcitationLoad
Implements InvolveQubits trait for the qubits involved in this Operation.
source§fn involved_qubits(&self) -> InvolvedQubits
fn involved_qubits(&self) -> InvolvedQubits
Returns a list of all involved qubits.
source§fn involved_classical(&self) -> InvolvedClassical
fn involved_classical(&self) -> InvolvedClassical
source§impl Operate for SingleExcitationLoad
impl Operate for SingleExcitationLoad
Implements the universal basic trait Operate for this Operation.
source§impl OperateSingleMode for SingleExcitationLoad
impl OperateSingleMode for SingleExcitationLoad
Implements OperateSingleMode trait for this Operation acting on exactly one bosonic mode.
source§impl OperateSingleQubit for SingleExcitationLoad
impl OperateSingleQubit for SingleExcitationLoad
Implements OperateSingleQubit trait for this Operation acting on exactly one qubit.
source§impl PartialEq for SingleExcitationLoad
impl PartialEq for SingleExcitationLoad
source§fn eq(&self, other: &SingleExcitationLoad) -> bool
fn eq(&self, other: &SingleExcitationLoad) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for SingleExcitationLoad
impl Serialize for SingleExcitationLoad
source§impl Substitute for SingleExcitationLoad
impl Substitute for SingleExcitationLoad
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 SubstituteModes for SingleExcitationLoad
impl SubstituteModes for SingleExcitationLoad
Implements SubstituteModes trait allowing to perform bosonic mode mappings.
source§fn remap_modes(
&self,
mapping: &HashMap<usize, usize>
) -> Result<Self, RoqoqoError>
fn remap_modes( &self, mapping: &HashMap<usize, usize> ) -> Result<Self, RoqoqoError>
Remaps the modes in clone of the operation.
source§impl TryFrom<ModeGateOperation> for SingleExcitationLoad
impl TryFrom<ModeGateOperation> for SingleExcitationLoad
Implements the core::convert::TryFrom trait into this Operation.
source§impl TryFrom<Operation> for SingleExcitationLoad
impl TryFrom<Operation> for SingleExcitationLoad
Implements the core::convert::TryFrom trait into this Operation.
source§impl TryFrom<SingleModeGateOperation> for SingleExcitationLoad
impl TryFrom<SingleModeGateOperation> for SingleExcitationLoad
Implements the core::convert::TryFrom trait into this Operation.
source§impl TryFrom<SingleModeOperation> for SingleExcitationLoad
impl TryFrom<SingleModeOperation> for SingleExcitationLoad
Implements the core::convert::TryFrom trait into this Operation.
source§impl TryFrom<SingleQubitOperation> for SingleExcitationLoad
impl TryFrom<SingleQubitOperation> for SingleExcitationLoad
Implements the core::convert::TryFrom trait into this Operation.
impl ImplementedIn1point11 for SingleExcitationLoad
impl OperateModeGate for SingleExcitationLoad
impl OperateSingleModeGate for SingleExcitationLoad
impl StructuralPartialEq for SingleExcitationLoad
Auto Trait Implementations§
impl Freeze for SingleExcitationLoad
impl RefUnwindSafe for SingleExcitationLoad
impl Send for SingleExcitationLoad
impl Sync for SingleExcitationLoad
impl Unpin for SingleExcitationLoad
impl UnwindSafe for SingleExcitationLoad
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.