Struct quil_rs::program::CalibrationSet
source · pub struct CalibrationSet { /* private fields */ }
Expand description
A collection of Quil calibrations (DEFCAL
instructions) with utility methods.
Implementations§
source§impl CalibrationSet
impl CalibrationSet
sourcepub fn expand(
&self,
instruction: &Instruction,
previous_calibrations: &[Instruction]
) -> Result<Option<Vec<Instruction>>, ProgramError<Program>>
pub fn expand( &self, instruction: &Instruction, previous_calibrations: &[Instruction] ) -> Result<Option<Vec<Instruction>>, ProgramError<Program>>
Given an instruction, return the instructions to which it is expanded if there is a match. Recursively calibrate instructions, returning an error if a calibration directly or indirectly expands into itself.
sourcepub fn get_match_for_gate(
&self,
gate_modifiers: &[GateModifier],
gate_name: &str,
gate_parameters: &[Expression],
gate_qubits: &[Qubit]
) -> Option<&Calibration>
pub fn get_match_for_gate( &self, gate_modifiers: &[GateModifier], gate_name: &str, gate_parameters: &[Expression], gate_qubits: &[Qubit] ) -> Option<&Calibration>
Return the final calibration which matches the gate per the QuilT specification:
A calibration matches a gate if:
- It has the same name
- It has the same modifiers
- It has the same qubit count (any mix of fixed & variable)
- It has the same parameter count (both specified and unspecified)
- All fixed qubits in the calibration definition match those in the gate
- All specified parameters in the calibration definition match those in the gate
sourcepub fn push(&mut self, calibration: Calibration)
👎Deprecated: use ScheduledProgram#push_calibration instead
pub fn push(&mut self, calibration: Calibration)
Add another gate calibration to the set.
Deprecated in favor of Self::push_calibration
sourcepub fn push_calibration(&mut self, calibration: Calibration)
pub fn push_calibration(&mut self, calibration: Calibration)
Add another gate calibration (DEFCAL
) to the set.
sourcepub fn push_measurement_calibration(
&mut self,
calibration: MeasureCalibrationDefinition
)
pub fn push_measurement_calibration( &mut self, calibration: MeasureCalibrationDefinition )
Add another measurement calibration (DEFCAL MEASURE
) to the set.
sourcepub fn to_instructions(&self) -> Vec<Instruction>
pub fn to_instructions(&self) -> Vec<Instruction>
Return the Quil instructions which describe the contained calibrations.
Trait Implementations§
source§impl Clone for CalibrationSet
impl Clone for CalibrationSet
source§fn clone(&self) -> CalibrationSet
fn clone(&self) -> CalibrationSet
Returns a copy of the value. Read more
1.0.0 · 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 CalibrationSet
impl Debug for CalibrationSet
source§impl Default for CalibrationSet
impl Default for CalibrationSet
source§fn default() -> CalibrationSet
fn default() -> CalibrationSet
Returns the “default value” for a type. Read more
source§impl PartialEq<CalibrationSet> for CalibrationSet
impl PartialEq<CalibrationSet> for CalibrationSet
source§fn eq(&self, other: &CalibrationSet) -> bool
fn eq(&self, other: &CalibrationSet) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.