pub struct SamplerProgram { /* private fields */ }Expand description
Integer-indexed program used by the native forward sampler.
The program is an immutable, compiler-validated representation. Its collections are exposed as read-only slices so downstream safe Rust code cannot invalidate the indices trusted by the packed runtime.
ⓘ
use faultscope_core::{compile_sampler_program_ref, SamplerOperation};
let mut program = compile_sampler_program_ref(1, &[], Vec::new()).unwrap();
program.operations.push(SamplerOperation::H(usize::MAX));Implementations§
Source§impl SamplerProgram
impl SamplerProgram
pub fn n_qubits(&self) -> usize
pub fn operations(&self) -> &[SamplerOperation]
pub fn observables(&self) -> &[LogicalObservable]
pub fn compiled_observables(&self) -> &[SamplerObservable]
pub fn measurement_keys(&self) -> &[String]
pub fn noise_locations(&self) -> &[IndexedNoiseLocation]
pub fn location_catalog(&self) -> &LocationCatalog
pub fn capacities(&self) -> &RuntimeCapacities
pub fn stored_operation_count(&self) -> usize
pub fn logical_operation_count(&self) -> usize
pub fn loop_kernel_count(&self) -> usize
Sourcepub fn estimate_from_loss(
&self,
state: &RuntimeState,
loss_mask: &Mask,
baseline: Option<f64>,
top_k: usize,
) -> NpResult<HotspotEstimate>
pub fn estimate_from_loss( &self, state: &RuntimeState, loss_mask: &Mask, baseline: Option<f64>, top_k: usize, ) -> NpResult<HotspotEstimate>
Estimate hotspots from a state produced by this program or one of its clones.
Trait Implementations§
Source§impl Clone for SamplerProgram
impl Clone for SamplerProgram
Source§impl Debug for SamplerProgram
impl Debug for SamplerProgram
Source§impl PartialEq for SamplerProgram
impl PartialEq for SamplerProgram
impl StructuralPartialEq for SamplerProgram
Auto Trait Implementations§
impl Freeze for SamplerProgram
impl RefUnwindSafe for SamplerProgram
impl Send for SamplerProgram
impl Sync for SamplerProgram
impl Unpin for SamplerProgram
impl UnsafeUnpin for SamplerProgram
impl UnwindSafe for SamplerProgram
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