pub struct QuantRS2Device { /* private fields */ }Expand description
The QuantRS2 PennyLane device backend.
Use QuantRS2Device::execute to run a PennyLane circuit description
(in JSON or as a PennyLaneCircuit struct) and get a PennyLaneResult.
Implementations§
Source§impl QuantRS2Device
impl QuantRS2Device
Sourcepub fn with_simulator(simulator: StateVectorSimulator) -> Self
pub fn with_simulator(simulator: StateVectorSimulator) -> Self
Create a new device with a custom simulator configuration.
Sourcepub fn execute(
&self,
circuit: &PennyLaneCircuit,
) -> Result<PennyLaneResult, DeviceError>
pub fn execute( &self, circuit: &PennyLaneCircuit, ) -> Result<PennyLaneResult, DeviceError>
Execute a PennyLaneCircuit and return a PennyLaneResult.
§Errors
Returns DeviceError if any gate is unsupported, the qubit count is
not supported by the simulator, or the underlying simulation fails.
Sourcepub fn execute_json(&self, json_input: &str) -> Result<String, DeviceError>
pub fn execute_json(&self, json_input: &str) -> Result<String, DeviceError>
Execute a circuit from a JSON string and return a JSON result string.
§Errors
Returns DeviceError if JSON deserialization fails, or if the execution
fails.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for QuantRS2Device
impl !RefUnwindSafe for QuantRS2Device
impl !UnwindSafe for QuantRS2Device
impl Send for QuantRS2Device
impl Sync for QuantRS2Device
impl Unpin for QuantRS2Device
impl UnsafeUnpin for QuantRS2Device
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
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.