[−][src]Struct dqcsim::common::types::Gate
Represents a quantum gate.
Fields
data: ArbData
User-defined classical data to pass along with the gate.
Methods
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>
) -> Result<Gate>
[src]
qubits: impl IntoIterator<Item = QubitRef>
) -> Result<Gate>
Constructs a new measurement gate.
The qubits are measured in the Z basis.
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_name(&self) -> Option<&str>
[src]
Returns the name of the gate, if any.
No name implies DQCsim-defined gate behavior, named gates imply plugin-defined behavior.
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<Vec<Complex64>>
[src]
Returns the gate matrix.
Trait Implementations
impl PartialEq<Gate> for Gate
[src]
impl Clone for Gate
[src]
fn clone(&self) -> Gate
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Debug for Gate
[src]
impl Serialize for Gate
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl<'de> Deserialize<'de> for Gate
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
Auto Trait Implementations
impl Send for Gate
impl Unpin for Gate
impl Sync for Gate
impl UnwindSafe for Gate
impl RefUnwindSafe for Gate
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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.
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.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,