pub struct OperatorArchive { /* private fields */ }Implementations§
Source§impl OperatorArchive
impl OperatorArchive
pub fn new() -> Self
pub fn insert( &mut self, name: impl Into<String>, operator: Operator, default: Option<Complex64>, ) -> Result<()>
pub fn get(&self, name: &str) -> Option<&OperatorArchiveEntry>
pub fn iter(&self) -> impl Iterator<Item = (&str, &OperatorArchiveEntry)>
Sourcepub fn insert_metadata(
&mut self,
key: impl Into<String>,
value: impl Into<String>,
) -> Result<()>
pub fn insert_metadata( &mut self, key: impl Into<String>, value: impl Into<String>, ) -> Result<()>
Attach small, language-neutral metadata to the archive.
Metadata is deliberately scalar text rather than executable serialization. This keeps archives safe to inspect and lets frontends preserve contracts such as declared scalar dtype or a basis-schema version without embedding pickled language objects.
pub fn metadata(&self) -> impl Iterator<Item = (&str, &str)>
pub fn metadata_value(&self, key: &str) -> Option<&str>
pub fn from_quantum_operator(operator: &QuantumOperator) -> Result<Self>
pub fn into_quantum_operator(self) -> Result<QuantumOperator>
Trait Implementations§
Source§impl Clone for OperatorArchive
impl Clone for OperatorArchive
Source§fn clone(&self) -> OperatorArchive
fn clone(&self) -> OperatorArchive
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 OperatorArchive
impl Debug for OperatorArchive
Source§impl Default for OperatorArchive
impl Default for OperatorArchive
Source§fn default() -> OperatorArchive
fn default() -> OperatorArchive
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for OperatorArchive
impl RefUnwindSafe for OperatorArchive
impl Send for OperatorArchive
impl Sync for OperatorArchive
impl Unpin for OperatorArchive
impl UnsafeUnpin for OperatorArchive
impl UnwindSafe for OperatorArchive
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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§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 more§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).§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.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.