pub struct PyProgram(/* private fields */);
Implementations§
Source§impl PyProgram
impl PyProgram
pub fn __richcmp__( &self, py: Python<'_>, other: &Self, op: CompareOp, ) -> PyObject
Source§impl PyProgram
impl PyProgram
pub fn new() -> Self
pub fn clone_without_body_instructions(&self) -> Self
pub fn copy(&self) -> Self
pub fn control_flow_graph(&self) -> PyControlFlowGraph
pub fn expand_calibrations_with_source_map( &self, ) -> PyResult<PyProgramCalibrationExpansion>
pub fn body_instructions<'a>(&self, py: Python<'a>) -> PyResult<&'a PyList>
pub fn calibrations(&self, py: Python<'_>) -> PyResult<PyCalibrationSet>
pub fn set_calibrations( &mut self, py: Python<'_>, calibrations: PyCalibrationSet, ) -> PyResult<()>
pub fn waveforms( &self, py: Python<'_>, ) -> PyResult<IndexMap<String, PyWaveform>>
pub fn set_waveforms( &mut self, py: Python<'_>, waveforms: IndexMap<String, PyWaveform>, ) -> PyResult<()>
pub fn frames(&self, py: Python<'_>) -> PyResult<PyFrameSet>
pub fn set_frames(&mut self, py: Python<'_>, frames: PyFrameSet) -> PyResult<()>
pub fn memory_regions( &self, py: Python<'_>, ) -> PyResult<IndexMap<String, PyMemoryRegion>>
pub fn set_memory_regions( &mut self, py: Python<'_>, memory_regions: IndexMap<String, PyMemoryRegion>, ) -> PyResult<()>
pub fn declarations( &self, py: Python<'_>, ) -> PyResult<HashMap<String, PyDeclaration>>
pub fn gate_definitions( &self, py: Python<'_>, ) -> PyResult<IndexMap<String, PyGateDefinition>>
pub fn set_gate_definitions( &mut self, definitions: IndexMap<String, PyGateDefinition>, )
pub fn pragma_extern_map(&self) -> IndexMap<Option<String>, PyPragma>
pub fn dagger(&self) -> PyResult<Self>
pub fn expand_calibrations(&self) -> PyResult<Self>
pub fn into_simplified(&self) -> PyResult<Self>
pub fn get_used_qubits(&self, py: Python<'_>) -> PyResult<HashSet<PyQubit>>
pub fn add_instruction(&mut self, instruction: PyInstruction)
pub fn add_instructions(&mut self, instructions: Vec<PyInstruction>)
pub fn to_instructions(&self, py: Python<'_>) -> PyResult<Vec<PyInstruction>>
pub fn to_unitary( &self, py: Python<'_>, n_qubits: u64, ) -> PyResult<Py<PyArray2<Complex64>>>
pub fn filter_instructions( &self, py: Python<'_>, predicate: Py<PyFunction>, ) -> PyResult<Self>
pub fn resolve_placeholders(&mut self)
pub fn wrap_in_loop( &self, loop_count_reference: PyMemoryReference, start_target: PyTarget, end_target: PyTarget, iterations: u32, ) -> Self
pub fn resolve_placeholders_with_custom_resolvers( &mut self, target_resolver: Option<Py<PyFunction>>, qubit_resolver: Option<Py<PyFunction>>, )
pub fn __add__(&self, py: Python<'_>, rhs: Self) -> PyResult<Self>
pub fn __iadd__(&mut self, rhs: Self)
pub fn __getstate__(&self, py: Python<'_>) -> PyResult<Py<PyBytes>>
pub fn __setstate__(&mut self, py: Python<'_>, state: &PyBytes) -> PyResult<()>
Trait Implementations§
Source§impl PyClassImpl for PyProgram
impl PyClassImpl for PyProgram
Source§const IS_BASETYPE: bool = false
const IS_BASETYPE: bool = false
#[pyclass(subclass)]
Source§const IS_SUBCLASS: bool = false
const IS_SUBCLASS: bool = false
#[pyclass(extends=…)]
Source§const IS_MAPPING: bool = false
const IS_MAPPING: bool = false
#[pyclass(mapping)]
Source§const IS_SEQUENCE: bool = false
const IS_SEQUENCE: bool = false
#[pyclass(sequence)]
Source§type ThreadChecker = SendablePyClass<PyProgram>
type ThreadChecker = SendablePyClass<PyProgram>
This handles following two situations: Read more
type Inventory = Pyo3MethodsInventoryForPyProgram
Source§type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
Immutable or mutable
Source§type BaseNativeType = PyAny
type BaseNativeType = PyAny
The closest native ancestor. This is
PyAny
by default, and when you declare
#[pyclass(extends=PyDict)]
, it’s PyDict
.fn items_iter() -> PyClassItemsIter
fn lazy_type_object() -> &'static LazyTypeObject<Self>
fn dict_offset() -> Option<isize>
fn weaklist_offset() -> Option<isize>
Source§impl PyClassNewTextSignature<PyProgram> for PyClassImplCollector<PyProgram>
impl PyClassNewTextSignature<PyProgram> for PyClassImplCollector<PyProgram>
fn new_text_signature(self) -> Option<&'static str>
Source§impl PyTypeInfo for PyProgram
impl PyTypeInfo for PyProgram
Source§type AsRefTarget = PyCell<PyProgram>
type AsRefTarget = PyCell<PyProgram>
Utility type to make Py::as_ref work.
Source§fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
Returns the PyTypeObject instance for this type.
Source§fn type_object(py: Python<'_>) -> &PyType
fn type_object(py: Python<'_>) -> &PyType
Returns the safe abstraction over the type object.
Source§fn is_type_of(object: &PyAny) -> bool
fn is_type_of(object: &PyAny) -> bool
Checks if
object
is an instance of this type or a subclass of this type.Source§fn is_exact_type_of(object: &PyAny) -> bool
fn is_exact_type_of(object: &PyAny) -> bool
Checks if
object
is an instance of this type.Source§impl ToPyObject for PyProgram
impl ToPyObject for PyProgram
impl StructuralPartialEq for PyProgram
Auto Trait Implementations§
impl Freeze for PyProgram
impl RefUnwindSafe for PyProgram
impl Send for PyProgram
impl Sync for PyProgram
impl Unpin for PyProgram
impl UnwindSafe for PyProgram
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,
Source§impl<'a, T> FromPyObject<'a> for T
impl<'a, T> FromPyObject<'a> for T
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> PyErrArguments for T
impl<T> PyErrArguments for T
Source§impl<T> PyWrapperMut for T
impl<T> PyWrapperMut for T
Source§fn as_inner_mut(&mut self) -> &mut Self::Inner
fn as_inner_mut(&mut self) -> &mut Self::Inner
Returns a mutable reference to the inner item. Read more
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.