[−][src]Struct dqcsim::common::types::Gate
Represents a type of quantum or mixed quantum-classical gate.
Fields
data: ArbData
User-defined classical data to pass along with the gate.
Implementations
impl Gate
[src]
pub fn new_unitary(
targets: impl IntoIterator<Item = QubitRef>,
controls: impl IntoIterator<Item = QubitRef>,
matrix: impl IntoIterator<Item = Complex64>
) -> Result<Gate>
[src]
targets: impl IntoIterator<Item = QubitRef>,
controls: impl IntoIterator<Item = QubitRef>,
matrix: impl IntoIterator<Item = Complex64>
) -> Result<Gate>
Constructs a new unitary gate.
pub fn new_measurement(
qubits: impl IntoIterator<Item = QubitRef>,
basis: impl IntoIterator<Item = Complex64>
) -> Result<Gate>
[src]
qubits: impl IntoIterator<Item = QubitRef>,
basis: impl IntoIterator<Item = Complex64>
) -> Result<Gate>
Constructs a new measurement gate.
pub fn new_prep(
qubits: impl IntoIterator<Item = QubitRef>,
matrix: impl IntoIterator<Item = Complex64>
) -> Result<Gate>
[src]
qubits: impl IntoIterator<Item = QubitRef>,
matrix: impl IntoIterator<Item = Complex64>
) -> Result<Gate>
Constructs a new prep gate.
pub fn new_custom(
name: impl Into<String>,
targets: impl IntoIterator<Item = QubitRef>,
controls: impl IntoIterator<Item = QubitRef>,
measures: impl IntoIterator<Item = QubitRef>,
matrix: Option<impl IntoIterator<Item = Complex64>>,
data: impl Into<ArbData>
) -> Result<Gate>
[src]
name: impl Into<String>,
targets: impl IntoIterator<Item = QubitRef>,
controls: impl IntoIterator<Item = QubitRef>,
measures: impl IntoIterator<Item = QubitRef>,
matrix: Option<impl IntoIterator<Item = Complex64>>,
data: impl Into<ArbData>
) -> Result<Gate>
Constructs a new implementation-defined gate.
pub fn get_type(&self) -> &GateType
[src]
Returns the gate type.
pub fn get_name(&self) -> Option<&str>
[src]
Returns the name of the gate, if any.
pub fn get_targets(&self) -> &[QubitRef]
[src]
Returns the list of target qubits.
pub fn get_controls(&self) -> &[QubitRef]
[src]
Returns the list of control qubits.
pub fn get_measures(&self) -> &[QubitRef]
[src]
Returns the list of measured qubits.
pub fn get_matrix(&self) -> Option<&Matrix>
[src]
Returns the gate matrix.
pub fn with_matrix_controls(&self) -> Self
[src]
Returns a new Gate with its controls moved to the matrix.
pub fn with_gate_controls(
&self,
epsilon: f64,
ignore_global_phase: bool
) -> Self
[src]
&self,
epsilon: f64,
ignore_global_phase: bool
) -> Self
Returns a new Gate with controls encoded in the matrix moved to the Gate controls field. Forwards the epsilon and ignore_global_phase args to the Matrix::strip_control method.
pub fn without_qubit_refs(&self) -> Self
[src]
Replaces all qubit references in the gate with undefined qubits. This is used as a gate detector cache preprocessing step when the detector functions do not depend on which qubits are bound to the gate, only the amount of each kind,
Trait Implementations
impl Clone for Gate
[src]
impl Debug for Gate
[src]
impl<'de> Deserialize<'de> for Gate
[src]
pub fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl Eq for Gate
[src]
impl<'_, '_> From<BoundUnitaryGate<'_, '_>> for Gate
[src]
pub fn from(bound_gate: BoundUnitaryGate<'_, '_>) -> Gate
[src]
impl Hash for Gate
[src]
pub fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl PartialEq<Gate> for Gate
[src]
impl Serialize for Gate
[src]
pub fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl StructuralEq for Gate
[src]
impl StructuralPartialEq for Gate
[src]
Auto Trait Implementations
impl RefUnwindSafe for Gate
impl Send for Gate
impl Sync for Gate
impl Unpin for Gate
impl UnwindSafe for Gate
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,