[][src]Struct dqcsim::common::types::Gate

pub struct Gate {
    pub data: ArbData,
    // some fields omitted
}

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]

Constructs a new unitary gate.

pub fn new_measurement(
    qubits: impl IntoIterator<Item = QubitRef>
) -> Result<Gate>
[src]

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]

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_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]

impl<'de> Deserialize<'de> for Gate[src]

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]

type Owned = T

The resulting type after obtaining ownership.

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,