Struct qasmsim::Computation
source · pub struct Computation { /* private fields */ }
Expand description
Represent the result of a simulation.
API functions such as simulate()
or simulate_with_shots()
return
Computation
instances.
Examples:
See simulate()
or simulate_with_shots()
for an example of generating
a Computation
instance.
Implementations§
source§impl Computation
impl Computation
sourcepub fn new(
memory: HashMap<String, u64>,
statevector: StateVector,
histogram: Option<Histogram>
) -> Self
pub fn new( memory: HashMap<String, u64>, statevector: StateVector, histogram: Option<Histogram> ) -> Self
Create a new computation.
Probabilities are computed from the state-vector.
sourcepub fn statevector(&self) -> &StateVector
pub fn statevector(&self) -> &StateVector
Return the statevector of the quantum system.
sourcepub fn memory(&self) -> &HashMap<String, u64>
pub fn memory(&self) -> &HashMap<String, u64>
Return an associative map with classical names and the classical outcomes.
sourcepub fn probabilities(&self) -> &[f64]
pub fn probabilities(&self) -> &[f64]
Return the probabilities associated with the state-vector.
Trait Implementations§
source§impl Clone for Computation
impl Clone for Computation
source§fn clone(&self) -> Computation
fn clone(&self) -> Computation
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for Computation
impl Debug for Computation
source§impl PartialEq for Computation
impl PartialEq for Computation
source§fn eq(&self, other: &Computation) -> bool
fn eq(&self, other: &Computation) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl StructuralPartialEq for Computation
Auto Trait Implementations§
impl RefUnwindSafe for Computation
impl Send for Computation
impl Sync for Computation
impl Unpin for Computation
impl UnwindSafe for Computation
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
Mutably borrows from an owned value. Read more