Struct roqoqo::operations::PMInteraction
source · pub struct PMInteraction {
control: usize,
target: usize,
t: CalculatorFloat,
}
Expand description
The transversal interaction gate.
exp(-i * θ *[X_c X_t + Y_c Y_t]) = exp( -i * θ * [σ^+_c * σ^-_t + σ^-_c σ^+_t])
Where X_c is the Pauli matrix σ^x acting on the control qubit, and Y_t is the Pauli matrix σ^y acting on the target qubit.
Fields§
§control: usize
The index of the most significant qubit in the unitary representation.
target: usize
The index of the least significant qubit in the unitary representation.
t: CalculatorFloat
The strength of the rotation θ.
Implementations§
source§impl PMInteraction
impl PMInteraction
sourcepub fn t(&self) -> &CalculatorFloat
pub fn t(&self) -> &CalculatorFloat
Returns the value of the field t
.
sourcepub fn new(control: usize, target: usize, t: CalculatorFloat) -> Self
pub fn new(control: usize, target: usize, t: CalculatorFloat) -> Self
Creates a new instance of PMInteraction
.
Trait Implementations§
source§impl Clone for PMInteraction
impl Clone for PMInteraction
source§fn clone(&self) -> PMInteraction
fn clone(&self) -> PMInteraction
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for PMInteraction
impl Debug for PMInteraction
source§impl<'de> Deserialize<'de> for PMInteraction
impl<'de> Deserialize<'de> for PMInteraction
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<PMInteraction> for GateOperation
impl From<PMInteraction> for GateOperation
Implements the From trait from this Operation.
source§fn from(v: PMInteraction) -> Self
fn from(v: PMInteraction) -> Self
Performs the conversion.
source§impl From<PMInteraction> for Operation
impl From<PMInteraction> for Operation
Implements the From trait from this Operation.
source§fn from(v: PMInteraction) -> Self
fn from(v: PMInteraction) -> Self
Performs the conversion.
source§impl From<PMInteraction> for TwoQubitGateOperation
impl From<PMInteraction> for TwoQubitGateOperation
Implements the From trait from this Operation.
source§fn from(v: PMInteraction) -> Self
fn from(v: PMInteraction) -> Self
Performs the conversion.
source§impl From<PMInteraction> for TwoQubitOperation
impl From<PMInteraction> for TwoQubitOperation
Implements the From trait from this Operation.
source§fn from(v: PMInteraction) -> Self
fn from(v: PMInteraction) -> Self
Performs the conversion.
source§impl InvolveQubits for PMInteraction
impl InvolveQubits for PMInteraction
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 PMInteraction
impl Operate for PMInteraction
Implements the universal basic trait Operate for this Operation.
source§impl OperateGate for PMInteraction
impl OperateGate for PMInteraction
Trait for all Operations acting with a unitary gate on a set of qubits.
source§fn unitary_matrix(&self) -> Result<Array2<Complex64>, RoqoqoError>
fn unitary_matrix(&self) -> Result<Array2<Complex64>, RoqoqoError>
Returns unitary matrix of the gate.
§Returns
Ok(Array2<Complex64>)
- The unitary matrix representation of the gate.Err(RoqoqoError)
- The conversion of parameters to f64 failed.
source§impl OperateTwoQubit for PMInteraction
impl OperateTwoQubit for PMInteraction
Trait for Operations acting on exactly two qubits.
source§impl OperateTwoQubitGate for PMInteraction
impl OperateTwoQubitGate for PMInteraction
Trait for all gate operations acting on exactly two qubits.
source§fn kak_decomposition(&self) -> KakDecomposition
fn kak_decomposition(&self) -> KakDecomposition
Returns KakDecomposition of the gate.
§Returns
- struct
KakDecomposition { global_phase, k_vector, circuit_before, circuit_after }
source§impl PartialEq for PMInteraction
impl PartialEq for PMInteraction
source§fn eq(&self, other: &PMInteraction) -> bool
fn eq(&self, other: &PMInteraction) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for PMInteraction
impl Serialize for PMInteraction
source§impl Substitute for PMInteraction
impl Substitute for PMInteraction
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 PMInteraction
impl SupportedVersion for PMInteraction
source§impl TryFrom<GateOperation> for PMInteraction
impl TryFrom<GateOperation> for PMInteraction
Implements the core::convert::TryFrom trait into this Operation.
source§impl TryFrom<Operation> for PMInteraction
impl TryFrom<Operation> for PMInteraction
Implements the core::convert::TryFrom trait into this Operation.
source§impl TryFrom<TwoQubitGateOperation> for PMInteraction
impl TryFrom<TwoQubitGateOperation> for PMInteraction
Implements the core::convert::TryFrom trait into this Operation.
source§impl TryFrom<TwoQubitOperation> for PMInteraction
impl TryFrom<TwoQubitOperation> for PMInteraction
Implements the core::convert::TryFrom trait into this Operation.
impl StructuralPartialEq for PMInteraction
Auto Trait Implementations§
impl Freeze for PMInteraction
impl RefUnwindSafe for PMInteraction
impl Send for PMInteraction
impl Sync for PMInteraction
impl Unpin for PMInteraction
impl UnwindSafe for PMInteraction
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.