Struct roqoqo_aqt::Backend
source · pub struct Backend {
pub device: AqtDevice,
/* private fields */
}
Expand description
AQT backend
provides functions to run circuits and measurements on AQT devices.
Fields§
§device: AqtDevice
Device the backend calls to run circuits remotely
Implementations§
source§impl Backend
impl Backend
sourcepub fn new(
device: AqtDevice,
access_token: Option<String>
) -> Result<Self, RoqoqoBackendError>
pub fn new( device: AqtDevice, access_token: Option<String> ) -> Result<Self, RoqoqoBackendError>
Creates a new AQT backend.
§Arguments
device
- The AQT device the Backend uses to execute operations and circuits.
At the moment limited to the AQT simulator.
access_token
- An access_token is required to access AQT hardware and simulators.
The access_token can either be given as an argument here or set via the environmental variable $AQT_ACCESS_TOKEN
sourcepub fn to_aqt_json<'a>(
&self,
circuit: impl Iterator<Item = &'a Operation>
) -> Result<String, RoqoqoBackendError>
pub fn to_aqt_json<'a>( &self, circuit: impl Iterator<Item = &'a Operation> ) -> Result<String, RoqoqoBackendError>
Creates an AQT json represenstaion of a roqoqo::Circuit.
§Arguments
circuit
- An iterator over Operations that represents a circuit that is translated
Trait Implementations§
source§impl<'de> Deserialize<'de> for Backend
impl<'de> Deserialize<'de> for Backend
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>,
Deserialize this value from the given Serde deserializer. Read more
source§impl EvaluatingBackend for Backend
impl EvaluatingBackend for Backend
source§fn run_circuit_iterator<'a>(
&self,
circuit: impl Iterator<Item = &'a Operation>
) -> RegisterResult
fn run_circuit_iterator<'a>( &self, circuit: impl Iterator<Item = &'a Operation> ) -> RegisterResult
Runs each operation obtained from an iterator over operations on the backend. Read more
source§fn run_circuit(
&self,
circuit: &Circuit
) -> Result<(HashMap<String, Vec<Vec<bool>>>, HashMap<String, Vec<Vec<f64>>>, HashMap<String, Vec<Vec<Complex<f64>>>>), RoqoqoBackendError>
fn run_circuit( &self, circuit: &Circuit ) -> Result<(HashMap<String, Vec<Vec<bool>>>, HashMap<String, Vec<Vec<f64>>>, HashMap<String, Vec<Vec<Complex<f64>>>>), RoqoqoBackendError>
Runs a circuit with the backend. Read more
source§fn run_measurement_registers<T>(
&self,
measurement: &T
) -> Result<(HashMap<String, Vec<Vec<bool>>>, HashMap<String, Vec<Vec<f64>>>, HashMap<String, Vec<Vec<Complex<f64>>>>), RoqoqoBackendError>where
T: Measure,
fn run_measurement_registers<T>(
&self,
measurement: &T
) -> Result<(HashMap<String, Vec<Vec<bool>>>, HashMap<String, Vec<Vec<f64>>>, HashMap<String, Vec<Vec<Complex<f64>>>>), RoqoqoBackendError>where
T: Measure,
Runs all circuits corresponding to one measurement with the backend. Read more
source§fn run_measurement<T>(
&self,
measurement: &T
) -> Result<Option<HashMap<String, f64>>, RoqoqoBackendError>where
T: MeasureExpectationValues,
fn run_measurement<T>(
&self,
measurement: &T
) -> Result<Option<HashMap<String, f64>>, RoqoqoBackendError>where
T: MeasureExpectationValues,
Evaluates expectation values of a measurement with the backend. Read more
source§impl PartialEq for Backend
impl PartialEq for Backend
impl Eq for Backend
impl StructuralPartialEq for Backend
Auto Trait Implementations§
impl RefUnwindSafe for Backend
impl Send for Backend
impl Sync for Backend
impl Unpin for Backend
impl UnwindSafe for Backend
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
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read moresource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
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
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.